OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Member Functions | List of all members
SymmetricMatrix Class Reference

#include <newmat.h>

Inheritance diagram for SymmetricMatrix:
GeneralMatrix BaseMatrix

Public Member Functions

 SymmetricMatrix ()
 
 ~SymmetricMatrix ()
 
 SymmetricMatrix (ArrayLengthSpecifier)
 
 SymmetricMatrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const SymmetricMatrix &m)
 
Real & operator() (int, int)
 
Real & element (int, int)
 
Real operator() (int, int) const
 
Real element (int, int) const
 
MatrixType Type () const
 
 SymmetricMatrix (const SymmetricMatrix &gm)
 
Real SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
Real Trace () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void RestoreCol (MatrixRowCol &)
 
void RestoreCol (MatrixColX &)
 
GeneralMatrixTranspose (TransposedMatrix *, MatrixType)
 
void ReSize (int)
 
void ReSize (const GeneralMatrix &A)
 
void operator+= (const SymmetricMatrix &M)
 
void operator-= (const SymmetricMatrix &M)
 
void operator+= (Real f)
 
void operator-= (Real f)
 
- Public Member Functions inherited from GeneralMatrix
GeneralMatrixEvaluate (MatrixType mt=MatrixTypeUnSp)
 
int Nrows () const
 
int Ncols () const
 
int Storage () const
 
RealStore () const
 
virtual ~GeneralMatrix ()
 
void tDelete ()
 
bool reuse ()
 
void Protect ()
 
int Tag () const
 
bool IsZero () const
 
void Release ()
 
void Release (int t)
 
void ReleaseAndDelete ()
 
void operator<< (const Real *)
 
void operator<< (const int *)
 
void operator<< (const BaseMatrix &X)
 
void Inject (const GeneralMatrix &)
 
void operator+= (const BaseMatrix &)
 
void operator-= (const BaseMatrix &)
 
void operator*= (const BaseMatrix &)
 
void operator|= (const BaseMatrix &)
 
void operator &= (const BaseMatrix &)
 
void operator+= (Real)
 
void operator-= (Real r)
 
void operator*= (Real)
 
void operator/= (Real r)
 
virtual GeneralMatrixMakeSolver ()
 
virtual void Solver (MatrixColX &, const MatrixColX &)
 
virtual void RestoreRow (MatrixRowCol &)
 
virtual void NextRow (MatrixRowCol &)
 
virtual void NextCol (MatrixRowCol &)
 
virtual void NextCol (MatrixColX &)
 
Real MaximumAbsoluteValue1 (int &i) const
 
Real MinimumAbsoluteValue1 (int &i) const
 
Real Maximum1 (int &i) const
 
Real Minimum1 (int &i) const
 
Real MaximumAbsoluteValue () const
 
Real MaximumAbsoluteValue2 (int &i, int &j) const
 
Real MinimumAbsoluteValue () const
 
Real MinimumAbsoluteValue2 (int &i, int &j) const
 
Real Maximum () const
 
Real Maximum2 (int &i, int &j) const
 
Real Minimum () const
 
Real Minimum2 (int &i, int &j) const
 
LogAndSign LogDeterminant () const
 
virtual bool IsEqual (const GeneralMatrix &) const
 
void CheckStore () const
 
virtual void SetParameters (const GeneralMatrix *)
 
 operator ReturnMatrix () const
 
ReturnMatrix ForReturn () const
 
virtual bool SameStorageType (const GeneralMatrix &A) const
 
virtual void ReSizeForAdd (const GeneralMatrix &A, const GeneralMatrix &B)
 
virtual void ReSizeForSP (const GeneralMatrix &A, const GeneralMatrix &B)
 
MatrixInput operator<< (Real)
 
MatrixInput operator<< (int f)
 
void CleanUp ()
 
- Public Member Functions inherited from BaseMatrix
AddedMatrix operator+ (const BaseMatrix &) const
 
MultipliedMatrix operator* (const BaseMatrix &) const
 
SubtractedMatrix operator- (const BaseMatrix &) const
 
ConcatenatedMatrix operator| (const BaseMatrix &) const
 
StackedMatrix operator & (const BaseMatrix &) const
 
ShiftedMatrix operator+ (Real) const
 
ScaledMatrix operator* (Real) const
 
ScaledMatrix operator/ (Real) const
 
ShiftedMatrix operator- (Real) const
 
TransposedMatrix t () const
 
NegatedMatrix operator- () const
 
ReversedMatrix Reverse () const
 
InvertedMatrix i () const
 
RowedMatrix AsRow () const
 
ColedMatrix AsColumn () const
 
DiagedMatrix AsDiagonal () const
 
MatedMatrix AsMatrix (int, int) const
 
GetSubMatrix SubMatrix (int, int, int, int) const
 
GetSubMatrix SymSubMatrix (int, int) const
 
GetSubMatrix Row (int) const
 
GetSubMatrix Rows (int, int) const
 
GetSubMatrix Column (int) const
 
GetSubMatrix Columns (int, int) const
 
Real AsScalar () const
 
Real Determinant () const
 
Real NormFrobenius () const
 
Real Norm1 () const
 
Real NormInfinity () const
 
virtual MatrixBandWidth BandWidth () const
 
void IEQND () const
 

Private Member Functions

GeneralMatrixImage () const
 

Additional Inherited Members

- Protected Member Functions inherited from GeneralMatrix
 GeneralMatrix ()
 
 GeneralMatrix (ArrayLengthSpecifier)
 
void Add (GeneralMatrix *, Real)
 
void Add (Real)
 
void NegAdd (GeneralMatrix *, Real)
 
void NegAdd (Real)
 
void Multiply (GeneralMatrix *, Real)
 
void Multiply (Real)
 
void Negate (GeneralMatrix *)
 
void Negate ()
 
void ReverseElements ()
 
void ReverseElements (GeneralMatrix *)
 
void operator= (Real)
 
Real * GetStore ()
 
GeneralMatrixBorrowStore (GeneralMatrix *, MatrixType)
 
void GetMatrix (const GeneralMatrix *)
 
void Eq (const BaseMatrix &, MatrixType)
 
void Eq (const GeneralMatrix &)
 
void Eq (const BaseMatrix &, MatrixType, bool)
 
void Eq2 (const BaseMatrix &, MatrixType)
 
int search (const BaseMatrix *) const
 
void CheckConversion (const BaseMatrix &)
 
void ReSize (int, int, int)
 
virtual short SimpleAddOK (const GeneralMatrix *)
 
virtual void MiniCleanUp ()
 
void PlusEqual (const GeneralMatrix &gm)
 
void MinusEqual (const GeneralMatrix &gm)
 
void PlusEqual (Real f)
 
void MinusEqual (Real f)
 
- Protected Attributes inherited from GeneralMatrix
int tag
 
int nrows
 
int ncols
 
int storage
 
Realstore
 

Detailed Description

Definition at line 650 of file newmat.h.

Constructor & Destructor Documentation

◆ SymmetricMatrix() [1/4]

SymmetricMatrix::SymmetricMatrix ( )
inline

Definition at line 654 of file newmat.h.

Referenced by Image().

654 :GeneralMatrix() {}

◆ ~SymmetricMatrix()

SymmetricMatrix::~SymmetricMatrix ( )
inline

Definition at line 655 of file newmat.h.

655 {}

◆ SymmetricMatrix() [2/4]

SymmetricMatrix::SymmetricMatrix ( ArrayLengthSpecifier  n)

Definition at line 55 of file newmat4.cpp.

56  : GeneralMatrix(tristore(n.Value()))
57 { REPORT nrows=n.Value(); ncols=n.Value(); }
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n

◆ SymmetricMatrix() [3/4]

SymmetricMatrix::SymmetricMatrix ( const BaseMatrix M)

Definition at line 121 of file newmat4.cpp.

References GeneralMatrix::Evaluate(), GeneralMatrix::GetMatrix(), REPORT, and MatrixType::Sm.

122 {
123  REPORT // CheckConversion(M);
124  // MatrixConversionCheck mcc;
126  GetMatrix(gmx);
127 }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat4.cpp:19
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

◆ SymmetricMatrix() [4/4]

SymmetricMatrix::SymmetricMatrix ( const SymmetricMatrix gm)
inline

Definition at line 670 of file newmat.h.

670 :GeneralMatrix(gm) { GetMatrix(&gm); }
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

Member Function Documentation

◆ element() [1/2]

Real & SymmetricMatrix::element ( int  m,
int  n 
)

Definition at line 675 of file newmat6.cpp.

References n, and REPORT.

676 {
677  REPORT
678  if (m<0 || n<0 || m >= nrows || n>=ncols)
679  Throw(IndexException(m,n,*this,true));
680  if (m>=n) return store[tristore(m)+n];
681  else return store[tristore(n)+m];
682 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ element() [2/2]

Real SymmetricMatrix::element ( int  m,
int  n 
) const

Definition at line 684 of file newmat6.cpp.

References n, and REPORT.

685 {
686  REPORT
687  if (m<0 || n<0 || m >= nrows || n>=ncols)
688  Throw(IndexException(m,n,*this,true));
689  if (m>=n) return store[tristore(m)+n];
690  else return store[tristore(n)+m];
691 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ GetCol() [1/2]

void SymmetricMatrix::GetCol ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 430 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, HaveStore, MatrixRowCol::length, LoadOnEntry, MatrixErrorNoSpace(), MONITOR_REAL_NEW, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, StoreHere, and StoreOnExit.

431 {
432  // do not allow StoreHere
433  if (+(mrc.cw*StoreHere))
434  Throw(InternalException("SymmetricMatrix::GetCol(MatrixRowCol&)"));
435 
436  int col=mrc.rowcol; mrc.length=nrows;
437  REPORT
438  mrc.skip=0;
439  if (+(mrc.cw*DirectPart)) // actually get row ??
440  { REPORT mrc.storage=col+1; mrc.data=store+(col*(col+1))/2; }
441  else
442  {
443  // do not allow StoreOnExit and !DirectPart
444  if (+(mrc.cw*StoreOnExit))
445  Throw(InternalException("SymmetricMatrix::GetCol(MatrixRowCol&)"));
446 
447  mrc.storage=ncols; Real* ColCopy;
448  if ( +(mrc.cw*HaveStore)) { REPORT ColCopy = mrc.data; }
449  else
450  {
451  REPORT // not accessed
452  ColCopy = new Real [ncols]; MatrixErrorNoSpace(ColCopy);
453  MONITOR_REAL_NEW("Make (SymGetCol)",ncols,ColCopy)
454  mrc.cw += HaveStore; mrc.data = ColCopy;
455  }
456  if (+(mrc.cw*LoadOnEntry))
457  {
458  REPORT
459  Real* Mstore = store+(col*(col+1))/2; int i = col;
460  while (i--) *ColCopy++ = *Mstore++;
461  i = ncols-col;
462  // while (i--) { *ColCopy++ = *Mstore; Mstore += ++col; }
463  if (i) for (;;)
464  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore += ++col; }
465  }
466  }
467 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
LoadAndStoreFlag cw
Definition: newmatrc.h:44
#define MONITOR_REAL_NEW(Operation, Size, Pointer)
Definition: myexcept.h:317
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetCol() [2/2]

void SymmetricMatrix::GetCol ( MatrixColX mrc)
virtual

Implements GeneralMatrix.

Definition at line 469 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, MatrixRowCol::length, LoadOnEntry, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, MatrixColX::store, and StoreOnExit.

470 {
471  int col=mrc.rowcol; mrc.length=nrows;
472  if (+(mrc.cw*DirectPart))
473  {
474  REPORT
475  mrc.skip=col; int i=nrows-col; mrc.storage=i;
476  mrc.data = mrc.store+col;
477  if (+(mrc.cw*LoadOnEntry))
478  {
479  REPORT // not accessed
480  Real* ColCopy = mrc.data;
481  Real* Mstore = store+(col*(col+3))/2;
482  // while (i--) { *ColCopy++ = *Mstore; Mstore += ++col; }
483  if (i) for (;;)
484  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore += ++col; }
485  }
486  }
487  else
488  {
489  REPORT
490  // do not allow StoreOnExit and !DirectPart
491  if (+(mrc.cw*StoreOnExit))
492  Throw(InternalException("SymmetricMatrix::GetCol(MatrixColX&)"));
493 
494  mrc.skip=0; mrc.storage=ncols;
495  if (+(mrc.cw*LoadOnEntry))
496  {
497  REPORT
498  Real* ColCopy = mrc.data;
499  Real* Mstore = store+(col*(col+1))/2; int i = col;
500  while (i--) *ColCopy++ = *Mstore++;
501  i = ncols-col;
502  // while (i--) { *ColCopy++ = *Mstore; Mstore += ++col; }
503  if (i) for (;;)
504  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore += ++col; }
505  }
506  }
507 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmatrc.h:139
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetRow()

void SymmetricMatrix::GetRow ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 397 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, HaveStore, MatrixRowCol::length, LoadOnEntry, MatrixErrorNoSpace(), MONITOR_REAL_NEW, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, and StoreOnExit.

398 {
399  REPORT //571
400  mrc.skip=0; int row=mrc.rowcol; mrc.length=ncols;
401  if (+(mrc.cw*DirectPart))
402  { REPORT mrc.storage=row+1; mrc.data=store+(row*(row+1))/2; }
403  else
404  {
405  // do not allow StoreOnExit and !DirectPart
406  if (+(mrc.cw*StoreOnExit))
407  Throw(InternalException("SymmetricMatrix::GetRow(MatrixRowCol&)"));
408  mrc.storage=ncols; Real* RowCopy;
409  if (!(mrc.cw*HaveStore))
410  {
411  REPORT
412  RowCopy = new Real [ncols]; MatrixErrorNoSpace(RowCopy);
413  MONITOR_REAL_NEW("Make (SymGetRow)",ncols,RowCopy)
414  mrc.cw += HaveStore; mrc.data = RowCopy;
415  }
416  else { REPORT RowCopy = mrc.data; }
417  if (+(mrc.cw*LoadOnEntry))
418  {
419  REPORT // 544
420  Real* Mstore = store+(row*(row+1))/2; int i = row;
421  while (i--) *RowCopy++ = *Mstore++;
422  i = ncols-row;
423  // while (i--) { *RowCopy++ = *Mstore; Mstore += ++row; }
424  if (i) for (;;)
425  { *RowCopy++ = *Mstore; if (!(--i)) break; Mstore += ++row; }
426  }
427  }
428 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
LoadAndStoreFlag cw
Definition: newmatrc.h:44
#define MONITOR_REAL_NEW(Operation, Size, Pointer)
Definition: myexcept.h:317
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ Image()

GeneralMatrix * SymmetricMatrix::Image ( ) const
privatevirtual

Reimplemented from GeneralMatrix.

Definition at line 754 of file newmat4.cpp.

References MatrixErrorNoSpace(), REPORT, and SymmetricMatrix().

755 {
756  REPORT
757  GeneralMatrix* gm = new SymmetricMatrix(*this); MatrixErrorNoSpace(gm);
758  return gm;
759 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ operator()() [1/2]

Real & SymmetricMatrix::operator() ( int  m,
int  n 
)

Definition at line 38 of file newmat6.cpp.

References n, and REPORT.

39 {
40  REPORT
41  if (m<=0 || n<=0 || m>nrows || n>ncols)
42  Throw(IndexException(m,n,*this));
43  if (m>=n) return store[tristore(m-1)+n-1];
44  else return store[tristore(n-1)+m-1];
45 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator()() [2/2]

Real SymmetricMatrix::operator() ( int  m,
int  n 
) const

Definition at line 150 of file newmat6.cpp.

References n, and REPORT.

151 {
152  REPORT
153  if (m<=0 || n<=0 || m>nrows || n>ncols)
154  Throw(IndexException(m,n,*this));
155  if (m>=n) return store[tristore(m-1)+n-1];
156  else return store[tristore(n-1)+m-1];
157 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator+=() [1/2]

void SymmetricMatrix::operator+= ( const SymmetricMatrix M)
inline

Definition at line 683 of file newmat.h.

683 { PlusEqual(M); }
void PlusEqual(const GeneralMatrix &gm)
Definition: newmat7.cpp:148

◆ operator+=() [2/2]

void SymmetricMatrix::operator+= ( Real  f)
inline

Definition at line 685 of file newmat.h.

References GeneralMatrix::Add().

685 { GeneralMatrix::Add(f); }
void Add(GeneralMatrix *, Real)
Definition: newmat5.cpp:311

◆ operator-=() [1/2]

void SymmetricMatrix::operator-= ( const SymmetricMatrix M)
inline

Definition at line 684 of file newmat.h.

684 { MinusEqual(M); }
void MinusEqual(const GeneralMatrix &gm)
Definition: newmat7.cpp:178

◆ operator-=() [2/2]

void SymmetricMatrix::operator-= ( Real  f)
inline

Definition at line 686 of file newmat.h.

References GeneralMatrix::Add().

686 { GeneralMatrix::Add(-f); }
void Add(GeneralMatrix *, Real)
Definition: newmat5.cpp:311

◆ operator=() [1/3]

void SymmetricMatrix::operator= ( const BaseMatrix X)

Definition at line 387 of file newmat6.cpp.

References REPORT, and MatrixType::Sm.

388 {
389  REPORT // CheckConversion(X);
390  // MatrixConversionCheck mcc;
391  Eq(X,MatrixType::Sm);
392 }
#define REPORT
Definition: newmat6.cpp:19
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ operator=() [2/3]

void SymmetricMatrix::operator= ( Real  f)
inline

Definition at line 659 of file newmat.h.

References GeneralMatrix::operator=().

void operator=(Real)
Definition: newmat6.cpp:342

◆ operator=() [3/3]

void SymmetricMatrix::operator= ( const SymmetricMatrix m)
inline

Definition at line 660 of file newmat.h.

660 { Eq(m); }
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ ReSize() [1/2]

void SymmetricMatrix::ReSize ( int  nr)

Definition at line 247 of file newmat4.cpp.

References REPORT, and GeneralMatrix::ReSize().

Referenced by ReSize().

248 { REPORT GeneralMatrix::ReSize(nr,nr,tristore(nr)); }
#define REPORT
Definition: newmat4.cpp:19
void ReSize(int, int, int)
Definition: newmat4.cpp:216

◆ ReSize() [2/2]

void SymmetricMatrix::ReSize ( const GeneralMatrix A)
virtual

Reimplemented from GeneralMatrix.

Definition at line 307 of file newmat4.cpp.

References A, n, REPORT, and ReSize().

308 {
309  REPORT
310  int n = A.Nrows();
311  if (n != A.Ncols())
312  {
313  Tracer tr("SymmetricMatrix::ReSize(GM)");
314  Throw(NotSquareException(*this));
315  }
316  ReSize(n);
317 }
#define A(r, c)
void ReSize(int)
Definition: newmat4.cpp:247
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n

◆ RestoreCol() [1/2]

void SymmetricMatrix::RestoreCol ( MatrixRowCol )
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 678 of file newmat.h.

678 {}

◆ RestoreCol() [2/2]

void SymmetricMatrix::RestoreCol ( MatrixColX mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 511 of file newmat3.cpp.

References MatrixRowCol::data, REPORT, and MatrixRowCol::rowcol.

512 {
513  REPORT
514  // Really do restore column
515  int col=mrc.rowcol; Real* Cstore = mrc.data;
516  Real* Mstore = store+(col*(col+3))/2; int i = nrows-col;
517  // while (i--) { *Mstore = *Cstore++; Mstore+= ++col; }
518  if (i) for (;;)
519  { *Mstore = *Cstore++; if (!(--i)) break; Mstore+= ++col; }
520 
521 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ Sum()

Real SymmetricMatrix::Sum ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 413 of file newmat8.cpp.

References REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ SumAbsoluteValue()

Real SymmetricMatrix::SumAbsoluteValue ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 397 of file newmat8.cpp.

References REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ SumSquare()

Real SymmetricMatrix::SumSquare ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 384 of file newmat8.cpp.

References REPORT, and square().

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real square(Real x)
Definition: newmat8.cpp:150
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ Trace()

Real SymmetricMatrix::Trace ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 556 of file newmat8.cpp.

References REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ Transpose()

GeneralMatrix * SymmetricMatrix::Transpose ( TransposedMatrix ,
MatrixType  mt 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 53 of file newmat5.cpp.

References REPORT.

54 { REPORT return Evaluate(mt); }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat5.cpp:20

◆ Type()

MatrixType SymmetricMatrix::Type ( ) const
virtual

Implements GeneralMatrix.

Definition at line 415 of file newmat4.cpp.

References MatrixType::Sm.

415 { return MatrixType::Sm; }

The documentation for this class was generated from the following files: