• Post Reply Bookmark Topic Watch Topic
  • New Topic

determinant solver  RSS feed

 
paul spriesterbach
Greenhorn
Posts: 22
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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





 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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
  • 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: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution. You've earned a cow.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!