• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

determinant solver

 
Greenhorn
Posts: 22
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I am trying to solve matrix determinants by reading matrices from a text file followed first by their order. Something is happening on the matrix assignment on the Test.java because Im printing the matrices out as I assign them and they are fine but when I print out the matrix out in the SolveDeterminant.java it is way off. Any help would be appreciated, I need fresh eyes on it

example test txt file:


2
2 3
5 9
3
3 -2 4
-1 5 2
-3 6 4
4
2 4 5 6
0 3 6 9
0 0 9 8
0 0 0 5





 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In which way is it off? For example, what is the output of the 2x2 case, and what should it be?
 
paul spriesterbach
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I actually figured it out shortly after I posted this. I just needed to take a step back then come back to it. Thanks though!
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like the rubber duck strikes again. If you would kindly post the solution you found, it's likely to help someone else in the future who is struggling with a similar problem and happens upon this thread.
 
paul spriesterbach
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

J. Kevin Robbins wrote:Sounds like the rubber duck strikes again. If you would kindly post the solution you found, it's likely to help someone else in the future who is struggling with a similar problem and happens upon this thread.



Yep the matrix was getting all messed up getting passed to the determinant solver by passing both the matrix and the order, originally. So I just tried just passing the matrix by itself and finding the order in the solver by doing a matrix.length and that worked
 
J. Kevin Robbins
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for posting the solution. You've earned a cow.
reply
    Bookmark Topic Watch Topic
  • New Topic