Why isn't this function working?

Hi, everyone. Can anyone tell me why this function isn't working? The assignment is to find out if the diagonal elements dominate their rows and columns.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  void diagonalsDominate (double a[][20], int  s,  int  t)
{
   int i, j, d, q;
   double max;
   bool notDominant = false;
   for (i = 0; i <= s-1; i++)
   {
      for (j = 0; j <= t-1; j++)
	  {
	     
	     if (i == j)
		 {
		    for (d = 0; d<= t-1; d++)
	             {
			   for (q = 0; q <= t-1; q++)
			   {
		    
			   

		              if(a[d][q] > a[d][d] && q!=d)
		                 notDominant = true;
		              else 
		                 notDominant = false;
			   } 
		     }
		 }
	  }
   }
   if (notDominant == true)
      cout << "Not all diagonal elements are dominant" << endl << endl;
   else
      cout << "All diagonal elements are dominant" << endl << endl;
}
> Can anyone tell me why this function isn't working?
*sigh*

Because you don't seem to know the difference between `for all' `exists' `last'
Also, you don't know or are using some weird definition of diagonally dominant

¿why so much repetition?
Thanks for the help. Remind me your purpose on this forum other than to criticize beginners?
I figured it out myself. Thanks for the encouragement. Now, why don't you look at your self in the mirror and *sigh* because you have no other purpose in this world other than to bring down or negate others. Have a nice day.
Another satisfied customer, ¡next!


If you are serious, you should submit your "solution" for peer review.
Topic archived. No new replies allowed.