OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
newmat8.cpp
Go to the documentation of this file.
1 //$$ newmat8.cpp Advanced LU transform, scalar functions
2 
3 // Copyright (C) 1991,2,3,4,8: R B Davies
4 
5 #define WANT_MATH
6 
7 #include <ossim/matrix/include.h>
8 
9 #include <ossim/matrix/newmat.h>
10 #include <ossim/matrix/newmatrc.h>
11 #include <ossim/matrix/precisio.h>
12 
13 #ifdef use_namespace
14 namespace NEWMAT {
15 #endif
16 
17 
18 #ifdef DO_REPORT
19 #define REPORT { static ExeCounter ExeCount(__LINE__,8); ++ExeCount; }
20 #else
21 #define REPORT {}
22 #endif
23 
24 
25 /************************** LU transformation ****************************/
26 
28 // LU decomposition from Golub & Van Loan, algorithm 3.4.1, (the "outer
29 // product" version).
30 // This replaces the code derived from Numerical Recipes in C in previous
31 // versions of newmat and being row oriented runs much faster with large
32 // matrices.
33 {
34  REPORT
35  Tracer trace( "Crout(ludcmp)" ); sing = false;
36  Real* akk = store; // runs down diagonal
37 
38  Real big = fabs(*akk); int mu = 0; Real* ai = akk; int k;
39 
40  for (k = 1; k < nrows; k++)
41  {
42  ai += nrows; const Real trybig = fabs(*ai);
43  if (big < trybig) { big = trybig; mu = k; }
44  }
45 
46 
47  if (nrows) for (k = 0;;)
48  {
49  /*
50  int mu1;
51  {
52  Real big = fabs(*akk); mu1 = k; Real* ai = akk; int i;
53 
54  for (i = k+1; i < nrows; i++)
55  {
56  ai += nrows; const Real trybig = fabs(*ai);
57  if (big < trybig) { big = trybig; mu1 = i; }
58  }
59  }
60  if (mu1 != mu) cout << k << " " << mu << " " << mu1 << endl;
61  */
62 
63  indx[k] = mu;
64 
65  if (mu != k) //row swap
66  {
67  Real* a1 = store + nrows * k; Real* a2 = store + nrows * mu; d = !d;
68  int j = nrows;
69  while (j--) { const Real temp = *a1; *a1++ = *a2; *a2++ = temp; }
70  }
71 
72  Real diag = *akk; big = 0; mu = k + 1;
73  if (diag != 0)
74  {
75  ai = akk; int i = nrows - k - 1;
76  while (i--)
77  {
78  ai += nrows; Real* al = ai; Real mult = *al / diag; *al = mult;
79  int l = nrows - k - 1; Real* aj = akk;
80  // work out the next pivot as part of this loop
81  // this saves a column operation
82  if (l-- != 0)
83  {
84  *(++al) -= (mult * *(++aj));
85  const Real trybig = fabs(*al);
86  if (big < trybig) { big = trybig; mu = nrows - i - 1; }
87  while (l--) *(++al) -= (mult * *(++aj));
88  }
89  }
90  }
91  else sing = true;
92  if (++k == nrows) break; // so next line won't overflow
93  akk += nrows + 1;
94  }
95 }
96 
97 
98 void CroutMatrix::lubksb(Real* B, int mini)
99 {
100  REPORT
101  // this has been adapted from Numerical Recipes in C. The code has been
102  // substantially streamlined, so I do not think much of the original
103  // copyright remains. However there is not much opportunity for
104  // variation in the code, so it is still similar to the NR code.
105  // I follow the NR code in skipping over initial zeros in the B vector.
106  Tracer trace("Crout(lubksb)");
107  sing = false;
108  // if ((this->LogDeterminant()).Value() != 0) sing = false;
109  if (sing) Throw(SingularException(*this));
110  int i, j, ii = nrows; // ii initialised : B might be all zeros
111 
112 
113  // scan for first non-zero in B
114  for (i = 0; i < nrows; i++)
115  {
116  int ip = indx[i]; Real temp = B[ip]; B[ip] = B[i]; B[i] = temp;
117  if (temp != 0.0) { ii = i; break; }
118  }
119 
120  Real* bi; Real* ai;
121  i = ii + 1;
122 
123  if (i < nrows)
124  {
125  bi = B + ii; ai = store + ii + i * nrows;
126  for (;;)
127  {
128  int ip = indx[i]; Real sum = B[ip]; B[ip] = B[i];
129  Real* aij = ai; Real* bj = bi; j = i - ii;
130  while (j--) sum -= *aij++ * *bj++;
131  B[i] = sum;
132  if (++i == nrows) break;
133  ai += nrows;
134  }
135  }
136 
137  ai = store + nrows * nrows;
138 
139  for (i = nrows - 1; i >= mini; i--)
140  {
141  Real* bj = B+i; ai -= nrows; Real* ajx = ai+i;
142  Real sum = *bj; Real diag = *ajx;
143  j = nrows - i; while(--j) sum -= *(++ajx) * *(++bj);
144  B[i] = sum / diag;
145  }
146 }
147 
148 /****************************** scalar functions ****************************/
149 
150 inline Real square(Real x) { return x*x; }
151 
153 {
154  REPORT
155  Real sum = 0.0; int i = storage; Real* s = store;
156  while (i--) sum += square(*s++);
157  ((GeneralMatrix&)*this).tDelete(); return sum;
158 }
159 
161 {
162  REPORT
163  Real sum = 0.0; int i = storage; Real* s = store;
164  while (i--) sum += fabs(*s++);
165  ((GeneralMatrix&)*this).tDelete(); return sum;
166 }
167 
169 {
170  REPORT
171  Real sum = 0.0; int i = storage; Real* s = store;
172  while (i--) sum += *s++;
173  ((GeneralMatrix&)*this).tDelete(); return sum;
174 }
175 
176 // maxima and minima
177 
178 // There are three sets of routines
179 // MaximumAbsoluteValue, MinimumAbsoluteValue, Maximum, Minimum
180 // ... these find just the maxima and minima
181 // MaximumAbsoluteValue1, MinimumAbsoluteValue1, Maximum1, Minimum1
182 // ... these find the maxima and minima and their locations in a
183 // one dimensional object
184 // MaximumAbsoluteValue2, MinimumAbsoluteValue2, Maximum2, Minimum2
185 // ... these find the maxima and minima and their locations in a
186 // two dimensional object
187 
188 // If the matrix has no values throw an exception
189 
190 // If we do not want the location find the maximum or minimum on the
191 // array stored by GeneralMatrix
192 // This won't work for BandMatrices. We call ClearCorner for
193 // MaximumAbsoluteValue but for the others use the AbsoluteMinimumValue2
194 // version and discard the location.
195 
196 // For one dimensional objects, when we want the location of the
197 // maximum or minimum, work with the array stored by GeneralMatrix
198 
199 // For two dimensional objects where we want the location of the maximum or
200 // minimum proceed as follows:
201 
202 // For rectangular matrices use the array stored by GeneralMatrix and
203 // deduce the location from the location in the GeneralMatrix
204 
205 // For other two dimensional matrices use the Matrix Row routine to find the
206 // maximum or minimum for each row.
207 
208 static void NullMatrixError(const GeneralMatrix* gm)
209 {
210  ((GeneralMatrix&)*gm).tDelete();
211  Throw(ProgramException("Maximum or minimum of null matrix"));
212 }
213 
215 {
216  REPORT
217  if (storage == 0) NullMatrixError(this);
218  Real maxval = 0.0; int l = storage; Real* s = store;
219  while (l--) { Real a = fabs(*s++); if (maxval < a) maxval = a; }
220  ((GeneralMatrix&)*this).tDelete(); return maxval;
221 }
222 
224 {
225  REPORT
226  if (storage == 0) NullMatrixError(this);
227  Real maxval = 0.0; int l = storage; Real* s = store; int li = storage;
228  while (l--)
229  { Real a = fabs(*s++); if (maxval <= a) { maxval = a; li = l; } }
230  i = storage - li;
231  ((GeneralMatrix&)*this).tDelete(); return maxval;
232 }
233 
235 {
236  REPORT
237  if (storage == 0) NullMatrixError(this);
238  int l = storage - 1; Real* s = store; Real minval = fabs(*s++);
239  while (l--) { Real a = fabs(*s++); if (minval > a) minval = a; }
240  ((GeneralMatrix&)*this).tDelete(); return minval;
241 }
242 
244 {
245  REPORT
246  if (storage == 0) NullMatrixError(this);
247  int l = storage - 1; Real* s = store; Real minval = fabs(*s++); int li = l;
248  while (l--)
249  { Real a = fabs(*s++); if (minval >= a) { minval = a; li = l; } }
250  i = storage - li;
251  ((GeneralMatrix&)*this).tDelete(); return minval;
252 }
253 
255 {
256  REPORT
257  if (storage == 0) NullMatrixError(this);
258  int l = storage - 1; Real* s = store; Real maxval = *s++;
259  while (l--) { Real a = *s++; if (maxval < a) maxval = a; }
260  ((GeneralMatrix&)*this).tDelete(); return maxval;
261 }
262 
264 {
265  REPORT
266  if (storage == 0) NullMatrixError(this);
267  int l = storage - 1; Real* s = store; Real maxval = *s++; int li = l;
268  while (l--) { Real a = *s++; if (maxval <= a) { maxval = a; li = l; } }
269  i = storage - li;
270  ((GeneralMatrix&)*this).tDelete(); return maxval;
271 }
272 
274 {
275  REPORT
276  if (storage == 0) NullMatrixError(this);
277  int l = storage - 1; Real* s = store; Real minval = *s++;
278  while (l--) { Real a = *s++; if (minval > a) minval = a; }
279  ((GeneralMatrix&)*this).tDelete(); return minval;
280 }
281 
283 {
284  REPORT
285  if (storage == 0) NullMatrixError(this);
286  int l = storage - 1; Real* s = store; Real minval = *s++; int li = l;
287  while (l--) { Real a = *s++; if (minval >= a) { minval = a; li = l; } }
288  i = storage - li;
289  ((GeneralMatrix&)*this).tDelete(); return minval;
290 }
291 
293 {
294  REPORT
295  if (storage == 0) NullMatrixError(this);
296  Real maxval = 0.0; int nr = Nrows();
298  for (int r = 1; r <= nr; r++)
299  {
300  int c; maxval = mr.MaximumAbsoluteValue1(maxval, c);
301  if (c > 0) { i = r; j = c; }
302  mr.Next();
303  }
304  ((GeneralMatrix&)*this).tDelete(); return maxval;
305 }
306 
308 {
309  REPORT
310  if (storage == 0) NullMatrixError(this);
311  Real minval = FloatingPointPrecision::Maximum(); int nr = Nrows();
313  for (int r = 1; r <= nr; r++)
314  {
315  int c; minval = mr.MinimumAbsoluteValue1(minval, c);
316  if (c > 0) { i = r; j = c; }
317  mr.Next();
318  }
319  ((GeneralMatrix&)*this).tDelete(); return minval;
320 }
321 
322 Real GeneralMatrix::Maximum2(int& i, int& j) const
323 {
324  REPORT
325  if (storage == 0) NullMatrixError(this);
326  Real maxval = -FloatingPointPrecision::Maximum(); int nr = Nrows();
328  for (int r = 1; r <= nr; r++)
329  {
330  int c; maxval = mr.Maximum1(maxval, c);
331  if (c > 0) { i = r; j = c; }
332  mr.Next();
333  }
334  ((GeneralMatrix&)*this).tDelete(); return maxval;
335 }
336 
337 Real GeneralMatrix::Minimum2(int& i, int& j) const
338 {
339  REPORT
340  if (storage == 0) NullMatrixError(this);
341  Real minval = FloatingPointPrecision::Maximum(); int nr = Nrows();
343  for (int r = 1; r <= nr; r++)
344  {
345  int c; minval = mr.Minimum1(minval, c);
346  if (c > 0) { i = r; j = c; }
347  mr.Next();
348  }
349  ((GeneralMatrix&)*this).tDelete(); return minval;
350 }
351 
352 Real Matrix::MaximumAbsoluteValue2(int& i, int& j) const
353 {
354  REPORT
355  int k; Real m = GeneralMatrix::MaximumAbsoluteValue1(k); k--;
356  i = k / Ncols(); j = k - i * Ncols(); i++; j++;
357  return m;
358 }
359 
360 Real Matrix::MinimumAbsoluteValue2(int& i, int& j) const
361 {
362  REPORT
363  int k; Real m = GeneralMatrix::MinimumAbsoluteValue1(k); k--;
364  i = k / Ncols(); j = k - i * Ncols(); i++; j++;
365  return m;
366 }
367 
368 Real Matrix::Maximum2(int& i, int& j) const
369 {
370  REPORT
371  int k; Real m = GeneralMatrix::Maximum1(k); k--;
372  i = k / Ncols(); j = k - i * Ncols(); i++; j++;
373  return m;
374 }
375 
376 Real Matrix::Minimum2(int& i, int& j) const
377 {
378  REPORT
379  int k; Real m = GeneralMatrix::Minimum1(k); k--;
380  i = k / Ncols(); j = k - i * Ncols(); i++; j++;
381  return m;
382 }
383 
385 {
386  REPORT
387  Real sum1 = 0.0; Real sum2 = 0.0; Real* s = store; int nr = nrows;
388  for (int i = 0; i<nr; i++)
389  {
390  int j = i;
391  while (j--) sum2 += square(*s++);
392  sum1 += square(*s++);
393  }
394  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
395 }
396 
398 {
399  REPORT
400  Real sum1 = 0.0; Real sum2 = 0.0; Real* s = store; int nr = nrows;
401  for (int i = 0; i<nr; i++)
402  {
403  int j = i;
404  while (j--) sum2 += fabs(*s++);
405  sum1 += fabs(*s++);
406  }
407  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
408 }
409 
411  { REPORT return fabs(Trace()); } // no need to do tDelete?
412 
414 {
415  REPORT
416  Real sum1 = 0.0; Real sum2 = 0.0; Real* s = store; int nr = nrows;
417  for (int i = 0; i<nr; i++)
418  {
419  int j = i;
420  while (j--) sum2 += *s++;
421  sum1 += *s++;
422  }
423  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
424 }
425 
427 {
428  Real sum = *store * *store * nrows;
429  ((GeneralMatrix&)*this).tDelete(); return sum;
430 }
431 
432 
434 {
435  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
436  Real s = gm->SumSquare(); return s;
437 }
438 
440  { REPORT return sqrt(SumSquare()); }
441 
443 {
444  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
445  Real s = gm->SumAbsoluteValue(); return s;
446 }
447 
449 {
450  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
451  Real s = gm->Sum(); return s;
452 }
453 
455 {
456  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
457  Real s = gm->MaximumAbsoluteValue(); return s;
458 }
459 
461 {
462  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
463  Real s = gm->MaximumAbsoluteValue1(i); return s;
464 }
465 
467 {
468  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
469  Real s = gm->MaximumAbsoluteValue2(i, j); return s;
470 }
471 
473 {
474  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
475  Real s = gm->MinimumAbsoluteValue(); return s;
476 }
477 
479 {
480  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
481  Real s = gm->MinimumAbsoluteValue1(i); return s;
482 }
483 
485 {
486  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
487  Real s = gm->MinimumAbsoluteValue2(i, j); return s;
488 }
489 
491 {
492  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
493  Real s = gm->Maximum(); return s;
494 }
495 
497 {
498  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
499  Real s = gm->Maximum1(i); return s;
500 }
501 
502 Real BaseMatrix::Maximum2(int& i, int& j) const
503 {
504  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
505  Real s = gm->Maximum2(i, j); return s;
506 }
507 
509 {
510  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
511  Real s = gm->Minimum(); return s;
512 }
513 
515 {
516  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
517  Real s = gm->Minimum1(i); return s;
518 }
519 
520 Real BaseMatrix::Minimum2(int& i, int& j) const
521 {
522  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
523  Real s = gm->Minimum2(i, j); return s;
524 }
525 
526 Real DotProduct(const Matrix& A, const Matrix& B)
527 {
528  REPORT
529  int n = A.storage;
530  if (n != B.storage) Throw(IncompatibleDimensionsException(A,B));
531  Real sum = 0.0; Real* a = A.store; Real* b = B.store;
532  while (n--) sum += *a++ * *b++;
533  return sum;
534 }
535 
537 {
538  REPORT
539  Tracer trace("Trace");
540  int i = nrows; int d = i+1;
541  if (i != ncols) Throw(NotSquareException(*this));
542  Real sum = 0.0; Real* s = store;
543 // while (i--) { sum += *s; s += d; }
544  if (i) for (;;) { sum += *s; if (!(--i)) break; s += d; }
545  ((GeneralMatrix&)*this).tDelete(); return sum;
546 }
547 
549 {
550  REPORT
551  int i = nrows; Real sum = 0.0; Real* s = store;
552  while (i--) sum += *s++;
553  ((GeneralMatrix&)*this).tDelete(); return sum;
554 }
555 
557 {
558  REPORT
559  int i = nrows; Real sum = 0.0; Real* s = store; int j = 2;
560  // while (i--) { sum += *s; s += j++; }
561  if (i) for (;;) { sum += *s; if (!(--i)) break; s += j++; }
562  ((GeneralMatrix&)*this).tDelete(); return sum;
563 }
564 
566 {
567  REPORT
568  int i = nrows; Real sum = 0.0; Real* s = store; int j = 2;
569  // while (i--) { sum += *s; s += j++; }
570  if (i) for (;;) { sum += *s; if (!(--i)) break; s += j++; }
571  ((GeneralMatrix&)*this).tDelete(); return sum;
572 }
573 
575 {
576  REPORT
577  int i = nrows; Real sum = 0.0; Real* s = store;
578  while (i) { sum += *s; s += i--; } // won t cause a problem
579  ((GeneralMatrix&)*this).tDelete(); return sum;
580 }
581 
583 {
584  REPORT
585  int i = nrows; int w = lower+upper+1;
586  Real sum = 0.0; Real* s = store+lower;
587  // while (i--) { sum += *s; s += w; }
588  if (i) for (;;) { sum += *s; if (!(--i)) break; s += w; }
589  ((GeneralMatrix&)*this).tDelete(); return sum;
590 }
591 
593 {
594  REPORT
595  int i = nrows; int w = lower+1;
596  Real sum = 0.0; Real* s = store+lower;
597  // while (i--) { sum += *s; s += w; }
598  if (i) for (;;) { sum += *s; if (!(--i)) break; s += w; }
599  ((GeneralMatrix&)*this).tDelete(); return sum;
600 }
601 
603 {
604  Real sum = *store * nrows;
605  ((GeneralMatrix&)*this).tDelete(); return sum;
606 }
607 
608 
610 {
611  REPORT
612  MatrixType Diag = MatrixType::Dg; Diag.SetDataLossOK();
613  GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(Diag);
614  Real sum = gm->Trace(); return sum;
615 }
616 
618 {
619  if (x > 0.0) { log_value += log(x); }
620  else if (x < 0.0) { log_value += log(-x); sign = -sign; }
621  else sign = 0;
622 }
623 
624 void LogAndSign::PowEq(int k)
625 {
626  if (sign)
627  {
628  log_value *= k;
629  if ( (k & 1) == 0 ) sign = 1;
630  }
631 }
632 
634 {
635  Tracer et("LogAndSign::Value");
636  if (log_value >= FloatingPointPrecision::LnMaximum())
637  Throw(OverflowException("Overflow in exponential"));
638  return sign * exp(log_value);
639 }
640 
642 {
643  if (f == 0.0) { log_value = 0.0; sign = 0; return; }
644  else if (f < 0.0) { sign = -1; f = -f; }
645  else sign = 1;
646  log_value = log(f);
647 }
648 
650 {
651  REPORT
652  int i = nrows; LogAndSign sum; Real* s = store;
653  while (i--) sum *= *s++;
654  ((GeneralMatrix&)*this).tDelete(); return sum;
655 }
656 
658 {
659  REPORT
660  int i = nrows; LogAndSign sum; Real* s = store; int j = 2;
661  // while (i--) { sum *= *s; s += j++; }
662  if (i) for(;;) { sum *= *s; if (!(--i)) break; s += j++; }
663  ((GeneralMatrix&)*this).tDelete(); return sum;
664 }
665 
667 {
668  REPORT
669  int i = nrows; LogAndSign sum; Real* s = store;
670  while (i) { sum *= *s; s += i--; }
671  ((GeneralMatrix&)*this).tDelete(); return sum;
672 }
673 
675 {
676  REPORT
677  int i = nrows; LogAndSign sum;
678  if (i > 0) { sum = *store; sum.PowEq(i); }
679  ((GeneralMatrix&)*this).tDelete(); return sum;
680 }
681 
683 {
684  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
685  LogAndSign sum = gm->LogDeterminant(); return sum;
686 }
687 
689 {
690  REPORT
691  Tracer tr("LogDeterminant");
692  if (nrows != ncols) Throw(NotSquareException(*this));
693  CroutMatrix C(*this); return C.LogDeterminant();
694 }
695 
697 {
698  REPORT
699  if (sing) return 0.0;
700  int i = nrows; int dd = i+1; LogAndSign sum; Real* s = store;
701  if (i) for(;;)
702  {
703  sum *= *s;
704  if (!(--i)) break;
705  s += dd;
706  }
707  if (!d) sum.ChangeSign(); return sum;
708 
709 }
710 
712 {
713  REPORT
714  Tracer tr("Determinant");
715  REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate();
716  LogAndSign ld = gm->LogDeterminant();
717  return ld.Value();
718 }
719 
720 
721 
722 
723 
725 {
726  gm = ((BaseMatrix&) bm ).Evaluate()->MakeSolver();
727  if (gm==&bm) { REPORT gm = gm->Image(); }
728  // want a copy if *gm is actually bm
729  else { REPORT gm->Protect(); }
730 }
731 
732 
733 #ifdef use_namespace
734 }
735 #endif
736 
ossim_uint32 x
double Real
Definition: include.h:57
Real Trace() const
Definition: newmat8.cpp:592
virtual Real MaximumAbsoluteValue() const
Definition: newmat8.cpp:454
Real MaximumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:352
void ludcmp()
Definition: newmat8.cpp:27
Real Trace() const
Definition: newmat8.cpp:602
Real Trace() const
Definition: newmat8.cpp:556
Real sign(Real x, Real y)
Definition: newmatrm.h:108
Real Trace() const
Definition: newmat8.cpp:536
virtual Real Sum() const
Definition: newmat8.cpp:448
Real Value() const
Definition: newmat8.cpp:633
virtual Real Minimum1(int &i) const
Definition: newmat8.cpp:514
Real Maximum(const BaseMatrix &B)
Definition: newmat.h:1766
Real SumSquare() const
Definition: newmat8.cpp:384
Real SumSquare() const
Definition: newmat8.cpp:426
Real Minimum2(int &i, int &j) const
Definition: newmat8.cpp:376
Real SumAbsoluteValue() const
Definition: newmat8.cpp:397
Real MinimumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:243
Real square(Real x)
Definition: newmat8.cpp:150
void operator*=(Real)
Definition: newmat8.cpp:617
virtual Real Minimum() const
Definition: newmat8.cpp:508
Real MaximumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:223
Real Determinant() const
Definition: newmat8.cpp:711
virtual Real MaximumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:460
void PowEq(int k)
Definition: newmat8.cpp:624
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
Real Minimum1(int &i) const
Definition: newmat8.cpp:282
LogAndSign()
Definition: newmat.h:46
#define A(r, c)
Real Maximum2(int &i, int &j) const
Definition: newmat8.cpp:322
Real MaximumAbsoluteValue() const
Definition: newmat8.cpp:214
Real SumAbsoluteValue() const
Definition: newmat8.cpp:410
#define REPORT
Definition: newmat8.cpp:21
virtual Real MinimumAbsoluteValue() const
Definition: newmat8.cpp:472
Real Trace() const
Definition: newmat8.cpp:548
virtual Real MaximumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:466
LinearEquationSolver(const BaseMatrix &bm)
Definition: newmat8.cpp:724
Real MinimumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:307
os2<< "> n<< " > nendobj n
Real Minimum() const
Definition: newmat8.cpp:273
void lubksb(Real *, int=0)
Definition: newmat8.cpp:98
Real Maximum1(Real r, int &i)
Definition: newmat2.cpp:602
Real DotProduct(const Matrix &A, const Matrix &B)
Definition: newmat8.cpp:526
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:688
virtual Real Maximum1(int &i) const
Definition: newmat8.cpp:496
Real SumSquare() const
Definition: newmat8.cpp:152
virtual Real MinimumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:478
Real Trace() const
Definition: newmat8.cpp:574
Real NormFrobenius() const
Definition: newmat8.cpp:439
Definition: newmat.h:543
virtual LogAndSign LogDeterminant() const
Definition: newmat8.cpp:682
Real * store
Definition: newmat.h:393
virtual Real Maximum() const
Definition: newmat8.cpp:490
Real MaximumAbsoluteValue1(Real r, int &i)
Definition: newmat2.cpp:582
Real MaximumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:292
Real Trace() const
Definition: newmat8.cpp:582
virtual Real Maximum2(int &i, int &j) const
Definition: newmat8.cpp:502
virtual Real SumSquare() const
Definition: newmat8.cpp:433
virtual GeneralMatrix * MakeSolver()
Definition: newmat7.cpp:24
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
Real Sum() const
Definition: newmat8.cpp:413
Real MinimumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:360
virtual Real MinimumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:484
virtual Real Minimum2(int &i, int &j) const
Definition: newmat8.cpp:520
Real Maximum1(int &i) const
Definition: newmat8.cpp:263
Real MinimumAbsoluteValue() const
Definition: newmat8.cpp:234
Real Trace() const
Definition: newmat8.cpp:565
virtual Real SumAbsoluteValue() const
Definition: newmat8.cpp:442
Real Sum() const
Definition: newmat8.cpp:168
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:696
void ChangeSign()
Definition: newmat.h:50
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:674
Real Maximum2(int &i, int &j) const
Definition: newmat8.cpp:368
void Protect()
Definition: newmat.h:437
Real MinimumAbsoluteValue1(Real r, int &i)
Definition: newmat2.cpp:592
int storage
Definition: newmat.h:392
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:657
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:649
Real Minimum2(int &i, int &j) const
Definition: newmat8.cpp:337
virtual Real Trace() const
Definition: newmat8.cpp:609
Real Maximum() const
Definition: newmat8.cpp:254
Real SumAbsoluteValue() const
Definition: newmat8.cpp:160
void Next()
Definition: newmatrc.h:149
Real SumSquare(const BaseMatrix &B)
Definition: newmat.h:1755
Real Trace(const BaseMatrix &B)
Definition: newmat.h:1757
Real Minimum1(Real r, int &i)
Definition: newmat2.cpp:612
LogAndSign LogDeterminant() const
Definition: newmat8.cpp:666