Results 21 to 27 of 27
Thread: matrix isDiagonaL?
- 03-29-2011, 04:47 PM #21
Member
- Join Date
- Feb 2011
- Posts
- 44
- Rep Power
- 0
- 03-29-2011, 04:50 PM #22
Member
- Join Date
- Feb 2011
- Posts
- 44
- Rep Power
- 0
for (int i= 0; i < matrix.length; i++)
for (int j= 0; j < matrix.length; j++) // assume a square matrix
if (i != j && matrix[i][j] != 0) return false;
return true;
what is the if condition for return true ??
- 03-29-2011, 04:50 PM #23
Senior Member
- Join Date
- Feb 2011
- Location
- Georgia, USA
- Posts
- 122
- Rep Power
- 0
Wow, I should have looked up the definition of diagnol matrix and brush on my algebra, I was going by my own made up definition based on how I intrepreted your post. I am really sorry for misleading you. Regards
- 03-29-2011, 04:54 PM #24
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 03-29-2011, 04:59 PM #25
Member
- Join Date
- Feb 2011
- Posts
- 44
- Rep Power
- 0
if(exp) return true; here expr what could be ??
return false
- 03-29-2011, 05:11 PM #26
Member
- Join Date
- Feb 2011
- Posts
- 44
- Rep Power
- 0
My question is how to make an if condition that first return true i mean what is expression within if condition that returns true statement
- 03-29-2011, 05:21 PM #27
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
Please try again because your question doesn't make any sense (and it is a run-on sentense). b.t.w. there is no condition that returns true; if all the matrix elements are tested the matrix is a diagonal matrix and you can simply return true; no condition needed.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Help with dox matrix printer
By Albert in forum Advanced JavaReplies: 7Last Post: 09-06-2011, 08:50 AM -
Matrix class
By maz22 in forum New To JavaReplies: 5Last Post: 10-15-2010, 06:53 AM -
help in matrix
By Engineer in forum New To JavaReplies: 7Last Post: 10-06-2010, 01:26 PM -
matrix multiply
By slixtrix in forum New To JavaReplies: 8Last Post: 09-13-2010, 06:50 AM -
Help with matrix
By susan in forum New To JavaReplies: 1Last Post: 08-07-2007, 04:37 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks