Torna indietro   Hardware Upgrade Forum > Software > Programmazione

iPhone 17 Pro: più di uno smartphone. È uno studio di produzione in formato tascabile
iPhone 17 Pro: più di uno smartphone. È uno studio di produzione in formato tascabile
C'è tanta sostanza nel nuovo smartphone della Mela dedicato ai creator digitali. Nuovo telaio in alluminio, sistema di raffreddamento vapor chamber e tre fotocamere da 48 megapixel: non è un semplice smartphone, ma uno studio di produzione digitale on-the-go
Intel Panther Lake: i processori per i notebook del 2026
Intel Panther Lake: i processori per i notebook del 2026
Panther Lake è il nome in codice della prossima generazione di processori Intel Core Ultra, che vedremo al debutto da inizio 2026 nei notebook e nei sistemi desktop più compatti. Nuovi core, nuove GPU e soprattutto una struttura a tile che vede per la prima volta l'utilizzo della tecnologia produttiva Intel 18A: tanta potenza in più, ma senza perdere in efficienza
Intel Xeon 6+: è tempo di Clearwater Forest
Intel Xeon 6+: è tempo di Clearwater Forest
Intel ha annunciato la prossima generazione di processori Xeon dotati di E-Core, quelli per la massima efficienza energetica e densità di elaborazione. Grazie al processo produttivo Intel 18A, i core passano a un massimo di 288 per ogni socket, con aumento della potenza di calcolo e dell'efficienza complessiva.
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 31-03-2009, 22:44   #1
fix87
Member
 
Iscritto dal: Jan 2008
Città: Firenze
Messaggi: 150
[Java] Algoritmo di gauss

Salve ragazzi,

sto provando ad implementare l'algoritmo di gauss tramite java!!! Però c'è un piccolo problemino, sto semplicemente uscendo pazzo!!! Qualcuno di voi conosce qualche sito dove c'è l'intero codice per l'implementazione???

Grazie anticipatamente!!!

P.s: Non lo devo portare ad un esame quindi non mi serve per fini scolastici ma soltanto per curiosità personale!!!
__________________
ACER ASPIRE 5920G - INTEL CORE2 DUO T7700 - NVIDIA GEFORCE 8600GT - 2GB RAM DDR2 - 250GB HDD - HD DVD

Ultima modifica di fix87 : 31-03-2009 alle 22:59.
fix87 è offline   Rispondi citando il messaggio o parte di esso
Old 31-03-2009, 22:53   #2
wingman87
Senior Member
 
Iscritto dal: Nov 2005
Messaggi: 2776
Fixa il titolo: http://www.hwupgrade.it/forum/showthread.php?t=1649196
E poi posta il codice e il problema.
Se invece cerchi il codice già fatto basta spendere un po' di tempo su google e lo trovi, dubito che qualcuno ce l'abbia da parte solo per tirarlo fuori nel caso qualcuno sul forum lo chieda.
wingman87 è offline   Rispondi citando il messaggio o parte di esso
Old 31-03-2009, 23:11   #3
fix87
Member
 
Iscritto dal: Jan 2008
Città: Firenze
Messaggi: 150
Quote:
Originariamente inviato da wingman87 Guarda i messaggi
Se invece cerchi il codice già fatto basta spendere un po' di tempo su google e lo trovi.
Ho girato per parecchio tempo e non avendo trovato niente, mi sono rivolto a voi. Ne dubito anche io che se qualcuno ce l'abbia da parte lo tira fuori appena un fesso come me lo chiede. Infatti ho chiesto se qualcuno conosce un sito dove c'è il codice e non che uno mi deve dare il codice se ce l'ha.
__________________
ACER ASPIRE 5920G - INTEL CORE2 DUO T7700 - NVIDIA GEFORCE 8600GT - 2GB RAM DDR2 - 250GB HDD - HD DVD
fix87 è offline   Rispondi citando il messaggio o parte di esso
Old 31-03-2009, 23:49   #4
wingman87
Senior Member
 
Iscritto dal: Nov 2005
Messaggi: 2776
Ho cercato Gauss Java:
http://www.math.tu-berlin.de/~moehri...ogramme/Gauss/
wingman87 è offline   Rispondi citando il messaggio o parte di esso
Old 01-04-2009, 00:22   #5
fix87
Member
 
Iscritto dal: Jan 2008
Città: Firenze
Messaggi: 150
Quote:
Originariamente inviato da wingman87 Guarda i messaggi
Ho provato a scaricare il file gauss.java ma non si capisce niente è tutto in disordine. Cmq grazie per la disponibilità!!
__________________
ACER ASPIRE 5920G - INTEL CORE2 DUO T7700 - NVIDIA GEFORCE 8600GT - 2GB RAM DDR2 - 250GB HDD - HD DVD
fix87 è offline   Rispondi citando il messaggio o parte di esso
Old 01-04-2009, 09:12   #6
banryu79
Senior Member
 
L'Avatar di banryu79
 
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
Quote:
Originariamente inviato da fix87 Guarda i messaggi
Ho provato a scaricare il file gauss.java ma non si capisce niente è tutto in disordine. Cmq grazie per la disponibilità!!
tutto in disordine?

Codice:
/**
 * Gauss.java
 * 
 * demonstrates the use of Gauss' algorithms for solving linear equations
 * 
 * Assumptions:
 * Input is per row, row i contains coefficients a_ij and
 * the righthandside b_j as last number, 
 * missing a_ij are interpreted as 0
 * numbers in a row are separated by white space
 */
import java.awt.*;
import java.applet.Applet;
import java.util.*;   // for class StringTokenizer
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class Gauss extends Applet {

        private TextArea input, output;  
        private Button startBtn, helpBtn;
        private Choice choiceBtn;
        private Panel p1, p2, p3;
        private String helpStr = 
                "Bitte oben Koeffizienten a_ij und rechte Seite b_i \n" 
                + "zeilenweise eingeben.\n"
                + "Die letze Zahl der Zeile i ist die rechte Seite b_i,\n"
                + "die Zahlen davor als a_i1, a_i2, ...\n"
                + "Fehlende a_ij in Zeile i werden als 0 interpretiert.\n" 
                + "Das eingegebene Gleichungssystem wird mit  \n"
                + "der gewaehlten Pivotsuche geloest. \nDabei wird die Zeit "
                + "gemessen und ausgegeben.\n";
                           
        public LinearEquation linEq = new LinearEquation(); 
    
        // setup the graphical user interface components
        public void init() {
                setLayout(new FlowLayout(FlowLayout.LEFT));
                setFont(new Font("Times", Font.PLAIN, 18));
                Font courier = new Font("Courier", Font.PLAIN, 18);

                p1 = new Panel();
                p2 = new Panel();
                p3 = new Panel();
        
                p1.setLayout(new FlowLayout(FlowLayout.LEFT));
        
                input = new TextArea(" 1  0  1  0    4 \n" 
                                   + " 1  1  0  1    7 \n"
                                   + " 1  1  2  0    6 \n"
                                   + " 1  0  0  1    5 ", 10, 60);
                input.setFont(courier);       
                p1.add(input);          // put input on panel

                p2.setLayout(new FlowLayout(FlowLayout.LEFT));
        
                helpBtn = new Button("   Hilfe   ");
                helpBtn.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                                showHelp();
                        }
                });
                p2.add(helpBtn);
        
                choiceBtn = new Choice();
                choiceBtn.addItem("ohne Pivotsuche");
                choiceBtn.addItem("mit totaler Pivotsuche");
                p2.add(choiceBtn);
        
                startBtn = new Button("   Start   ");
                startBtn.addActionListener(new ActionListener(){
                        public void actionPerformed(ActionEvent e){
                                runGauss();
                        }
                });
                p2.add(startBtn);
        
                p3.setLayout(new FlowLayout(FlowLayout.LEFT));
                output = new TextArea(helpStr, 15, 60);
                output.setFont(courier);
                p3.add(output);
                            
                add(p1);
                add(p2);
                add(p3);
        }
    
        /**
         * reads numbers from input to arrays a and b and to precision
         */
        private void initialize() throws NumberFormatException, 
                                NoSuchElementException, DimensionException, 
                                NullPointerException {
        
                String inputStr = input.getText();
                             
                // divide input into lines 
                StringTokenizer inputLines = new StringTokenizer(inputStr, 
                                                                  "\n\r");
            
                // get the number of rows           
                if (! inputLines.hasMoreTokens()) {
                        throw new NoSuchElementException();
                }
                int m = inputLines.countTokens();  
    
                StringBuffer strBuf = new StringBuffer();
                strBuf.append(m + " Gleichungen");
        
                // define array of m lines of tokens 
                StringTokenizer[] line = new StringTokenizer[m];
                for (int i = 0; i < m; i++) {
                       line[i] = new StringTokenizer(inputLines.nextToken());
                }
        
                // get the number of columns including b
                int n = 0;
                for (int i = 0; i < m; i++) {
                        if (line[i].countTokens() < 2) {
                                throw new NoSuchElementException();
                        }
                        if (line[i].countTokens() - 1 > n) {
                                n = line[i].countTokens() - 1;
                        }
                }
        
                strBuf.append(" und " + n + " Variable\n");
        
                // initialize linEq
                double[][] a = new double[m][n];
                double[] b = new double[m];
                for (int i = 0; i < m; i++) {
                        int j; 
                        int k = line[i].countTokens() - 1; 
                        // that many coeffs on line i
                        for (j = 0; j < k; j++) {
                                a[i][j] = Double.parseDouble(
                                                line[i].nextToken());
                        }
                        for (j = k; j < n; j++) {
                                a[i][j] = 0;
                        }
                        b[i] = Double.parseDouble(line[i].nextToken());     
                }
        
                linEq = new LinearEquation(a, b);
        
                // write info in output field
                output.setText(strBuf.toString());
        }
    
        /**
         * displays help text
         */
        public void showHelp() {
                output.setText(helpStr); 
        }       
         
        /**
         * solves system of linear equations by Gaussian elimination
         * 
         * @see <code>LinearEquationSolver</code>
         */
        public void runGauss() {  
                try {
                        output.setText("Rechne ...\n");
                        initialize();                       
            
                        int choice = choiceBtn.getSelectedIndex();
                        String choiceStr = choiceBtn.getSelectedItem();

                        long startTime = System.currentTimeMillis();
                        switch (choice) {
                        case 0 : 
                                linEq.solveWithoutPivotSearch();      
                                break;
                        case 1 : 
                                linEq.solveByTotalPivotSearch(); 
                                break;
                        }
                        long endTime = System.currentTimeMillis();
                        long runTime = endTime - startTime;        
                    
                        // Construct the output string in a 
                        // StringBuffer object
                        StringBuffer outputBuf = new StringBuffer();
                        outputBuf.append("Benoetigte Zeit " 
                                + choiceStr + " in Millisekunden: " 
                                + Long.toString(runTime) + "\n");    
            
                        outputBuf.append("solvable = " + linEq.isSolvable() 
                                                       + "\n");
                        outputBuf.append(linEq.equationsToString() + "\n");
                        if (linEq.isSolvable()) {
                                outputBuf.append(linEq.solutionToString());
                        }
                        output.append("\n" + outputBuf.toString());  
                        
                } catch (NoSuchElementException exp) { 
                        output.append("\nJede Zeile muss mindestens "
                                        + "2 Zahlen enthalten.");    
                } catch (NumberFormatException exp) { 
                        output.append("\nNur double Zahlen eingeben.");
                } catch (DimensionException exp) { 
                        output.append(exp.toString());
                } catch (Exception exp) { // other exceptions
                        output.append(exp.toString());
                }
        }   
}
__________________

As long as you are basically literate in programming, you should be able to express any logical relationship you understand.
If you don’t understand a logical relationship, you can use the attempt to program it as a means to learn about it.
(Chris Crawford)
banryu79 è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


iPhone 17 Pro: più di uno smartphone. È uno studio di produzione in formato tascabile iPhone 17 Pro: più di uno smartphone. &Eg...
Intel Panther Lake: i processori per i notebook del 2026 Intel Panther Lake: i processori per i notebook ...
Intel Xeon 6+: è tempo di Clearwater Forest Intel Xeon 6+: è tempo di Clearwater Fore...
4K a 160Hz o Full HD a 320Hz? Titan Army P2712V, a un prezzo molto basso 4K a 160Hz o Full HD a 320Hz? Titan Army P2712V,...
Recensione Google Pixel Watch 4: basta sollevarlo e si ha Gemini sempre al polso Recensione Google Pixel Watch 4: basta sollevarl...
Disney+ cambia: arriva Hulu, ma il servi...
Google annuncia Gemini Enterprise: l'IA ...
Battlefield 6 debutta tra code infinite ...
Gli iPhone di seconda mano dominano il m...
Pavel Durov (Telegram) lancia l'allarme:...
Occhiali Smart come lo smartphone: il fu...
Arriva NVIDIA GB300 NVL72, il cluster di...
Copilot si collega a OneDrive, Gmail e D...
Il Liquid Glass di iOS 26 è stato...
I biocarburanti fanno più danni d...
ELF, il Frankenstein di Mercedes che ant...
Da Kia arriva il passaporto per le batte...
The Elder Scrolls 6 renderà omagg...
YouTube dà una 'seconda chance' a...
Attacco hacker a Oracle E-Business Suite...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 03:11.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Served by www3v