Results 21 to 27 of 27
Thread: matrix isDiagonaL?
 03292011, 04:47 PM #21Member
 Join Date
 Feb 2011
 Posts
 44
 Rep Power
 0
 03292011, 04:50 PM #22Member
 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 ??
 03292011, 04:50 PM #23Senior 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
 03292011, 04:54 PM #24
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,231
 Blog Entries
 7
 Rep Power
 24
 03292011, 04:59 PM #25Member
 Join Date
 Feb 2011
 Posts
 44
 Rep Power
 0
if(exp) return true; here expr what could be ??
return false
 03292011, 05:11 PM #26Member
 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
 03292011, 05:21 PM #27
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,231
 Blog Entries
 7
 Rep Power
 24
Please try again because your question doesn't make any sense (and it is a runon 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,
JosThe only person who got everything done by Friday was Robinson Crusoe.
Similar Threads

Help with dox matrix printer
By Albert in forum Advanced JavaReplies: 7Last Post: 09062011, 08:50 AM 
Matrix class
By maz22 in forum New To JavaReplies: 5Last Post: 10152010, 06:53 AM 
help in matrix
By Engineer in forum New To JavaReplies: 7Last Post: 10062010, 01:26 PM 
matrix multiply
By slixtrix in forum New To JavaReplies: 8Last Post: 09132010, 06:50 AM 
Help with matrix
By susan in forum New To JavaReplies: 1Last Post: 08072007, 04:37 AM
Bookmarks