Why won't it print everything?

i can't seem to get the first part of my code to print. it just prints the last few iterations but it won't let me scroll up to see the beginning part of my results. does anyone know why this happens?
thanks in adavnce.
public class GEGS
      public static void main (String [] args)
           // Declare working variables
           double [][] a = {{12,     -2,     1,     0,     0,     0,     0,     0,     0,     0},
                                   {-2,     12,     -2,     1,     0,     0,     0,     0,     0,     0},
                                   {1,      -2,     12,     -2,     1,     0,     0,     0,     0,     0},
                                   {0,      1,      -2,     12,     -2,     1,     0,     0,     0,     0},
                                   {0,      0,      1,     -2,     12,     -2,     1,     0,     0,     0},
                                   {0,      0,      0,     1,     -2,     12,     -2,     1,     0,     0},
                                   {0,      0,      0,     0,     1,     -2,     12,     -2,     1,     0},
                                   {0,      0,      0,     0,     0,     1,     -2,     12,     -2,     1},
                                   {0,      0,      0,     0,     0,     0,     1,     -2,     12,     -2},
                                   {0,      0,      0,     0,     0,     0,     0,     1,     -2,     12}};
           double [] b = {13.97,
                               5.93,
                               -6.02,
                               8.32,
                                -23.75,
                                28.45,
                                -8.9,
                                -10.5,
                                10.34,
                                -38.74};
           int n=10;
           System.out.println("The following is the coefficient matrix A");
           for (int i=0; i<n; i++)
                for (int j=0; j<n; j++)
                     System.out.print((a[i][j]) + "\t");
                System.out.println();
           System.out.println("The following is the vector b");
           for (int i=0; i<10; i++)
                System.out.print((b) + "\t");
               System.out.println();
          System.out.println("\n");
          // Gaussian Elimination with Partial Pivoting (column)
          double [][] u = new double [10][10];
          double [][] l = new double [10][10];
          double [] g = new double [10];
          double [] x = new double [10];
          double [] xold = new double [10];
          double [] xnew = new double [10];
          // Matrix L with ones in diagonal
          for (int i=0; i<n; i++)
               for (int j=0; j<n; j++)
                    if (i==j)
                         l[i][j] = 1;
                    if (i<j)
                         l[i][j] = 0;
          // Copying matrix A to the "working" matrix u
          for (int i=0; i<n; i++)
               for (int j=0; j<n; j++)
                    u[i][j]=a[i][j];
          // Copying vector b to the "working" vector g
          for (int i=0; i<10; i++)
               g[i] = b[i];
          // NOW OFFICIALLY APPLYING PARTIAL PIVOTING!!!!!!!!!!!!
          for (int p=0; p<n; p++)
               int max = p;
               for (int i=p+1; i<n; i++)
                    if (Math.abs(u[i][p]) > Math.abs(u[max][p]))
                         max = i;
               double [] temp = u[p]; u[p] = u[max]; u[max] = temp;
               double t = g[p]; g[p] = g[max]; g[max] = t;
               for (int i=p+1; i<n; i++)
                    l[i][p] = u[i][p]/u[p][p];
                    g[i] -= l[i][p]*g[p];
                    for (int j=p; j<n; j++)
                         u[i][j] -= l[i][p] * u[p][j];
          System.out.println("\n");
          System.out.println("The following is the resultant L matrix!");
          for (int i=0; i<n; i++)
               for (int j=0; j<n; j++)
                    System.out.print(Math.round((l[i][j])*10000)/10000.0 + "\t");
               System.out.println();
          System.out.println("\n");
          System.out.println("The following is the resultant U matrix!");
          for (int i=0; i<n; i++)
               for (int j=0; j<n; j++)
                    System.out.print(Math.round((u[i][j])*10000)/10000.0 + "\t");
               System.out.println();
          // BACK SUBSTITUTION!!!!!!!!!
          for (int i=9; i>=0; i--)
               double sum = 0.0;
               for (int j=i+1; j<n; j++)
                    sum += u[i][j] * x[j];
               x[i] = ((g[i]) - sum)/u[i][i];
          System.out.println("\n");
          System.out.println("The following is the resultant X matrix," + "\n" + "ie. the sol'n to the system of linear equations!");
          for (int i=0; i<n; i++)
               System.out.print((x[i]) + "\t");
               System.out.println();
          // GAUSS-SEIDEL ITERATION METHOD!!!!!!!!!!!!!
          for (int i=0; i<n; i++)
               xold[i] = 0;
          System.out.println("\n");
          System.out.println("\n");
          System.out.println("The following is the resultant X matrix from Gauss Seidel," + "\n" + "ie. the sol'n to the system of linear equation!");
          System.out.println("\n");
          // ERROR ASSESSEMENT!!!!!!!!!!!!
          double e = .000001;
          double [] xerror = new double [10];
          double maximum = 0.0;
          System.out.println("The following is the new x's");
          for (int i=0; i<n; i++)
               double sum3 = 0.0;
               double sum4 = 0.0;
               for (int j=i+1; j<n; j++)
                    sum3 += a[i][j] * xold[j];
               for (int j=0; j<i; j++)
                    sum4 += a[i][j] * xnew[j];
               xnew[i] = ((b[i]) - sum4 - sum3)/a[i][i];
               System.out.print((xnew[i]) + "\t");
               System.out.println();
          System.out.println();
          System.out.println("The following is the error");
          for (int j=0; j<1; j++)
               maximum = 0.0;
               for (int i=0; i<n; i++)
                    xerror[i] = Math.abs(xnew[i] - xold[i]);
                    System.out.print((xerror[i]) + "\t");
                    System.out.println();
                    if (xerror[i]>maximum)
                         maximum = xerror[i];
               System.out.println();
          System.out.println("The following is the max error");
          System.out.println(Math.round(maximum*10000000)/10000000.0);
          System.out.println("\n");
          while (maximum>=e)
               System.out.println("\n");
               System.out.println("The following is the new x's");
               for (int i=0; i<n; i++)
                    double sum3 = 0.0;
                    double sum4 = 0.0;
                    xold[i] = xnew[i];
                    for (int j=i+1; j<n; j++)
                         sum3 += a[i][j] * xold[j];
                    for (int j=0; j<i-1; j++)
                         sum4 += a[i][j] * xnew[j];
                    xnew[i] = ((b[i]) - sum4 - sum3)/a[i][i];
                    System.out.print((xnew[i]) + "\t");
                    System.out.println();
               System.out.println("\n");
               System.out.println("The following is the error");
               for (int j=0; j<1; j++)
                    maximum = 0.0;
                    for (int i=0; i<n; i++)
                         xerror[i] = Math.abs(xnew[i] - xold[i]);
                         System.out.print((xerror[i]) + "\t");
                         System.out.println();
                         if (xerror[i]>maximum)
                              maximum = xerror[i];
                    System.out.println();
               System.out.println("The following is the max error");
               System.out.println(Math.round(maximum*10000000)/10000000.0);
     } //END OF MAIN METHOD
} //END OF CLASS

i'm not familiar with java so where would i put that
in my code.you wouldn't. it's how you run the code. whatever you typed at the prompt to run your code before, do that again, but add > log.txt to the end of it. after it's run, have a look in log.txt, to see what happened

Similar Messages

  • Why won't my printer print with Windows 8?

    Why won’t my printer print with Windows 8?
    Have you just upgraded, or purchased a new computer with Windows 8, and now you can’t get your printer to work?  If so, this may help you.  A lot of people have questions about installing their printer on a new OS.  This will help you answer those questions and make sure that you get everything installed. 
    Before You Start
    Before you try to install the printer on a Windows 8 computer, you should check to make sure the printer is compatible with the new OS.  The link below will give you a list of the printers that will work in Windows 8.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03168175&lc=en&cc=us&destPage=document&dlc=en
    If you have upgraded your computer to Windows 8 form another version of Windows, make sure to completely uninstall all of the software for your printer.  It should still print, but to use all the functions you will need to reinstall the software, if it’s available.
    Another thing to consider is how you want to connect the printer to the computer. 
    USB.  You should make sure that you have a USB cable that is no longer than 6 ft. (roughly 2m).  Make sure to connect the printer directly to the computer.  Do not use a USB hub. 
    Ethernet cable.  Make sure you have the network setup, that you have a free cable port on the router, and that you have an Ethernet cable available.
    Wireless.  You should make sure that you have the wireless network setup, and that you have the password for the wireless network. 
     1.     Installing Via USB
    Installing via USB in Windows 8 has become much simpler for HP printer users.  In other versions of the Windows OS you had to start the installation and wait for it to ask you for the USB connection.  If you didn’t, you would have to uninstall the printer from the Printers/Devices folder, and then start the install.  In Windows 8, that will not be a problem.  If you plug the printer’s USB cable in and then install the printer’s software, it will still work.  Now for in depth instructions on installing the printer via USB click the link below.
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03460670&tmp_task=solveCategory&cc=us&dlc=en&la...
    2.     Installing Via an Ethernet Network Connection
    For an Ethernet network connected printer the install is amazingly simple.  All you have to do is connect the printer to the network.  Once you have that done, Windows 8 will automatically install the drivers for you.  Then, all you have to do is install the rest of the software, if it’s available.  It’s really that easy.
    http://www8.hp.com/us/en/support-drivers.html
    3.     Installing Via a Wireless Network Connection.
    For a wireless network connected printer the install is amazingly simple as well.  All you have to do is connect the printer to the network.  Once you have that done, Windows 8 will automatically install the drivers for you.  Then, all you have to do is install the rest of the software, if it’s available.  It’s pretty much the same as an Ethernet install, just wireless.
    http://www8.hp.com/us/en/support-drivers.html
    Alternate Install Methods
    With Windows 8, many printers’ drivers are installed with the OS.  These are known as InOS drivers, since they come built into the operating system.  If you have one of those printers, all you should have to do is connect it to the computer via USB, or connect it to the network via Ethernet or wireless.  Once you have that done Windows will handle the rest.  There are alternate methods of installing your printer if the normal methods are not working for some reason.  You can install the printer either using the Printer Install Wizard, or through Windows Updates. 
    Printer Install Wizard:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02681060&tmp_task=solveCategory&cc=us&dlc=en&la...
    Windows Update:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03460648&tmp_task=solveCategory&cc=us&dlc=en&la...
    Note: The Laserjet drivers for the Asia-Pacific and Japan won’t be released until a later date.  Check the support site linked below for driver availability.  I will update this post once they become available.
    http://www8.hp.com/us/en/support-drivers.html
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------
    This question was solved.
    View Solution.

    Hope this answers some questions.  
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • Why won't my printer (Brother HL2270DW) print out Elements User bi-monthly magazine?  Screen says PDF format not supported or printer not connected (it is) or shows an empty screen.  No other printing problems on any website.

    Why won't my printer (Brother HL2270DW) print out Elements bi-monthly magazine.  Screen says either printed not connected (not true) or PDF not supported of shows a blank document.  No problems printing on any other website.

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • Why won't my printer print page numbers? The page numbers show up when I preview the document by don't print on the page.

    Why won't my printer print page numbers in a document? The page numbers show in print preview, but will not print on document.

    Perhaps you have set the margins so tight to the edge of the paper that you have gotten into the non-printing area for your printer. Most printers have a dead zone.
    What are your margin settings?
    Jerry

  • Why won't my printer recognize my goggle email?

    why won't my printer recognize my goggle email? I keep getting no email associated with printer. what do I need to do? I have set up my eprint account with my goggle email.
    {Personal Information Removed}

    If you see the error message "no email associated with printer" where are you seeing this error (example: on the printer, a print app, at the hpconnected website, etc)?  
    What model of printer do you have?
    --ePrint Support Website--
    Answer those questions please so I can be of more assistance.
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • Just upgraded to snow leopard, downloader apple support drivers for canon mp620.  Why won't a printer list display in add printer window?

    Just upgraded to snow leopard, downloader apple support drivers for canon mp620.  Why won't a printer list display in add printer window?

    Assuming the MP620 is connected to your wireless network, then there are two components to this device - the printer and the scanner. The printer uses Canon proprietary software while the scanner is supported by Apple's Bonjour service. So in many cases, you will at least see the scanner, shown as Bonjour Scanner in the Kind column, while the printer can take longer to appear and is shown as canonijnetwork in the Kind column. If you cannot see either then you have a network issue. Try turning off the MP620 for a minute and then turning back on. Then see if the scanner / printer component appears in the Add Printer window. If you still don't see either, then confirm the MP and the Mac are using the same network. If you know the MP's IP address you can use Network Utility to Ping the address. You can also enable Bonjour Bookmarks in Safari preferences and when selected, the MP620 should appear.

  • Why won't preview print the actual size of the photo?

    Why can't I print directly from Photoshop instead of having to print through preview? I believe I've checked the proper settings in preview preference but it keeps scaling my photos.

    Rusty, you always get a preview before printing whether from Preview.app or from PS.
    This is the dialogue I get printing from within PS....
    and this is the one I get printing through preview...
    I'm not sure what your issue is with printing from PS, perhaps try on the Adobe forums?
    -mj

  • Why won't air print wont work after ios6 update on iphone?

    It was working before I updated....my printer is KodakEPS2170

    I had the same issue.  BTW, that troubleshooting assistant is worthless.  I did 2 things to get it working.  I'm not sure if one or the other fixed it or it was combination of both.  I had the "No Air Printers Found" and did the usual rebooting everything, firmware updates, etc.  I could print and scan from the epson app fine.  I downloaded the epson airprint app from the app store (It's called Epson Printer Finder) and verified my settings under the Airprint section and choose to save the settings.  I didn't change anything, just looked at the settings.  I also setup the epson connect feature on the printer.  After I did both of those I went into mail and tried to print an email message and all of a sudden I could see my printer.  It's worked perfect since then.  I hope this helps someone.

  • Why won't the print button print?

    first off i have to thank everybody here for such a great resource and thank those who have answered my topics!
    i have my forms coming along and almost finished. one form works flawlessly and now my final form is done and the damn print button won't print. i used the javascript code on here for validating fields in the print button and it worked fine on one form but now on this form it just doesnt. ive racked my brain for hours and tried countless things. here is the form
    http://www.hotwaxsurf.com/rentalequip.pdf
    if someone would be so kind to look at it with fresh eyes. thanks
    Jay

    Looks like you've added a subform (Subform1) to the form which is breaking your script. You need to add it to your script. ie: Subform1.name.rawValue rather than just name.rawValue. another option is to unwarp that subform.
    Rich Ruiz
    Novanis

  • Why won't the printer work,i have all the driver&software done.hp 5610 officejet all-in one.

    hp5610 printer won/t  work,the mac laptop dosent seem to comunicate with it.someone please help???{Personal Information Removed}

    Hey Walldo. How do you have the printer connected to the Mac, wirelessly or by USB? Also what version of OS X (10.5, 10.6, 10.7) are you using?
    Thanks!
    -SeanS
    -------------How do I give Kudos? | How do I mark a post as Solved? --------------------------------------------------------

  • WHY WON'T MY PRINTER UNINSTALL IN THE ADD/REMOVE PROGRAMS

    OFFICE JET J6480
    USING WINDOWS XP
    PRINTER WILL NOT UNINSTALL FROM THE ADD/REMOVE PROGRAMS LIST
    EVERYTHING WAS WORKING FINE.  I HAD TO TAKE MY PRINTER TO THE OFFICE.  WHEN I PLUGGED IT BACK IN AT HOME AND IT HAS WORKED SINCE.  I HAVE TRIED EVERYTHING RECOMMENDED THUS FAR.  I NOW AT THE UNINSTALL PHASE, AND THE PRINTER WILL NOT UNINSTALL FROM THEADD/REMOVE PROGRAMS LIST. THE SOLUTIONS CENTER AND SEVERAL OF THE OTHER APPLICATIONS HAVE BEEN REMOVED BUT THE PRINTER WILL NOT. I HAVE EVEN WENT AS FAR AS RESTORING TO  AN EARLIER DATE.
    I AM AT A LOSS.

    i want to reinstall ap printer driver by downloading 1 as when i go 2 print it goes to a save box so i assumed cos my driver may have gone wrong . i wanted 2 remove printer an then reload it but it will not uninstall via add and remove programs 
    please advise 

  • Why won't emails print without the word "print" be...

    I am tired of not being able to print emails without the word "Print" appearing at the top of the page.  I don't think this used to happen in the "old" BT email system, so why now?  It just looks silly.  Can I print an email without this appearing at the top?

    Thank you SO much for your help but
    I tried that.. It did not work
    I read on another forum ... An he dis this...
    Settings> Phone> My number
    It was 0000000000 ( a bunch of zeross)
    I changed it to my number ...
    AND IT WORKED ! Lol
    Thank you for your help all the same though

  • Why won't Contacts print the "company" field?

    When trying to print a list from Contacts, it won't include the Company. I am using Mavericks 10.9.1. This problem doesn't exist on my old iMac with OS 10.6.8. Contacts on the Cloud will let me print the company field.

    Hi,
    Same problem here.
    The printable lists from Contacts exclude the Company name. The photo also sometimes excludes, sometimes does not. Same with Nickname, and some other fields.
    Yes, I check off the items in the Attributes selection when printing the list. The information is also excluded when choosing "Export as PDF..."
    If I export the contact as a VCF, the information is exported. Re-importing it does not help, though.

  • Why won't iCal print all my Calendars when I can see them on the screen?

    I have eight Calendars set up in iCal. When I select 'Print' a new screen appears and, once again, I can see all eight Calendars. The word 'Print' is at the top of this screen. I press the Continue box and a second Print screen appears. This time all but two of my Calendars have disappeared (confirmed if I open in Preview). And of course it's only this version that prints. What happened between the first Print screen and the second, and how can I manage to print all my Calendars?

    Hi st louis,
    Are the tickets you downloaded from Ticketmaster PDFs? If so, have you opened them in Acrobat or Reader to print them? I haven't ever been required to enter a password to print an e-ticket from Ticketmaster, but they may have changed their policy. Did they provide you with a password when you purchased your tickets--perhaps in the confirmation email?
    Best,
    Sara

  • Why won't edge print?

    howdy all,
    i'm working on a new site using edge in 2 places (nav and pix rotator) - when you try to print the page none of the edge components show up??
    [http://salesdigital.com/newsite/ | http://salesdigital.com/newsite/]
    http://salesdigital.com/print-missing-edge.pdf
    anyone know of a workaround?
    thanks,
    keith

    OK, I downloaded and installed the Deskjet 3050 driver and it seems pretty basic, but it did work to print to my Photosmart c310a.  That would indicate it is PCL3GUI compatible.  I then installed the Officejet 4500 driver and it also works printing to the c310a.  Given all that I would suggest the following:
    Go to Start, Devices and Printers, right click on the Deskjet 3050 and select Printer Properties, Advanced, New Driver,  Next, select HP for the manufacturer and select the HP Officejet 4500 G510g-m driver, Next, Finish.  [If the Officejet 4500 is not in the list then download the driver from HP, install the driver and select Network for the connection.  When the installer says it cannot find the 4500 check the "connect later" box.  Once this is all done then go back the the Go to Start above and change the driver.]
    This will change the name of hte printer to Officejet 4500, you may want to rename this to indicate it is a Deskjet 3050.  You can do this by right clicking on the printer, selecting Printer Properties and then checnging the name to whatever you want.
    Once this is done you should have the driver options available with the 4500.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

Maybe you are looking for

  • Reg: table name find

    Hi All, i need some information, how can i find the table name for the below feild. i am using the T:Code : MC44, in this i gave the materian, plant and selected the check box all plant cumulated and  then press enter. in the inside screen i hava sel

  • Two major bugs in Lion - Zoom and Safari auto fill search bar

    hey there every since I updated to Lion I've been experiencing two major bugs... zoom randomly stops working (the one where you press control and zoom in and out) even though it's set to work on the settings. Safari is also experincing a problem conc

  • Phone froze, then i tried to restart and is frozen with apple logo.

    What do i do? The phone froze so i did a hard restart. held the wake/sleep button and home button, then i turned it back on and it doesnt go to anything else but with the load up apple screen. Has been like this for hours and its sitting on the charg

  • Processing Classes in SAP Payroll

    Hi all, could you kindly fwd me the file,if u have it with u . How Do I Use Processing Classes in SAP Payroll?  by Steve Bogner, Managing Partner, Insight Consulting Partners Explore how your Payroll system uses processing classes. Our HR expert offe

  • Regd : Planned Independent requirements

    Hi - Is there any possibility of blocking the entered PIR quantities in MD61 transaction , as the transaction opens in change mode every time. Is there any alternative transaction for entering the requirement quantity other than MD61.