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

#include <newmat.h>

Inheritance diagram for GenericMatrix:
BaseMatrix

Public Member Functions

 GenericMatrix ()
 
 GenericMatrix (const BaseMatrix &bm)
 
 GenericMatrix (const GenericMatrix &bm)
 
void operator= (const GenericMatrix &)
 
void operator= (const BaseMatrix &)
 
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)
 
 ~GenericMatrix ()
 
void CleanUp ()
 
void Release ()
 
GeneralMatrixEvaluate (MatrixType=MatrixTypeUnSp)
 
MatrixBandWidth BandWidth () const
 
- 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
 
virtual LogAndSign LogDeterminant () const
 
Real Determinant () const
 
virtual Real SumSquare () const
 
Real NormFrobenius () const
 
virtual Real SumAbsoluteValue () const
 
virtual Real Sum () const
 
virtual Real MaximumAbsoluteValue () const
 
virtual Real MaximumAbsoluteValue1 (int &i) const
 
virtual Real MaximumAbsoluteValue2 (int &i, int &j) const
 
virtual Real MinimumAbsoluteValue () const
 
virtual Real MinimumAbsoluteValue1 (int &i) const
 
virtual Real MinimumAbsoluteValue2 (int &i, int &j) const
 
virtual Real Maximum () const
 
virtual Real Maximum1 (int &i) const
 
virtual Real Maximum2 (int &i, int &j) const
 
virtual Real Minimum () const
 
virtual Real Minimum1 (int &i) const
 
virtual Real Minimum2 (int &i, int &j) const
 
virtual Real Trace () const
 
Real Norm1 () const
 
Real NormInfinity () const
 
void IEQND () const
 

Private Member Functions

int search (const BaseMatrix *bm) const
 

Private Attributes

GeneralMatrixgm
 

Friends

class BaseMatrix
 

Additional Inherited Members

Detailed Description

Definition at line 1183 of file newmat.h.

Constructor & Destructor Documentation

◆ GenericMatrix() [1/3]

GenericMatrix::GenericMatrix ( )
inline

Definition at line 1189 of file newmat.h.

1189 : gm(0) {}
GeneralMatrix * gm
Definition: newmat.h:1185

◆ GenericMatrix() [2/3]

GenericMatrix::GenericMatrix ( const BaseMatrix bm)
inline

Definition at line 1190 of file newmat.h.

References GeneralMatrix::Evaluate(), and GeneralMatrix::Image().

1191  { gm = ((BaseMatrix&)bm).Evaluate(); gm = gm->Image(); }
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838

◆ GenericMatrix() [3/3]

GenericMatrix::GenericMatrix ( const GenericMatrix bm)
inline

Definition at line 1192 of file newmat.h.

References gm, and GeneralMatrix::Image().

1192  : BaseMatrix(bm)
1193  { gm = bm.gm->Image(); }
GeneralMatrix * gm
Definition: newmat.h:1185
friend class BaseMatrix
Definition: newmat.h:1187
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838

◆ ~GenericMatrix()

GenericMatrix::~GenericMatrix ( )
inline

Definition at line 1205 of file newmat.h.

1205 { delete gm; }
GeneralMatrix * gm
Definition: newmat.h:1185

Member Function Documentation

◆ BandWidth()

MatrixBandWidth GenericMatrix::BandWidth ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 444 of file newmat4.cpp.

References BaseMatrix::BandWidth(), gm, and REPORT.

445  { REPORT return gm->BandWidth(); }
GeneralMatrix * gm
Definition: newmat.h:1185
virtual MatrixBandWidth BandWidth() const
Definition: newmat4.cpp:431
#define REPORT
Definition: newmat4.cpp:19

◆ CleanUp()

void GenericMatrix::CleanUp ( )
inlinevirtual

Reimplemented from BaseMatrix.

Definition at line 1206 of file newmat.h.

1206 { delete gm; gm = 0; }
GeneralMatrix * gm
Definition: newmat.h:1185

◆ Evaluate()

GeneralMatrix * GenericMatrix::Evaluate ( MatrixType  mt = MatrixTypeUnSp)
virtual

Implements BaseMatrix.

Definition at line 91 of file newmat5.cpp.

References REPORT.

92  { REPORT return gm->Evaluate(mt); }
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat5.cpp:20

◆ operator &=()

void GenericMatrix::operator&= ( const BaseMatrix )

◆ operator*=() [1/2]

void GenericMatrix::operator*= ( const BaseMatrix X)

Definition at line 585 of file newmat6.cpp.

References GeneralMatrix::Evaluate(), MultipliedMatrix::Evaluate(), GeneralMatrix::Image(), GeneralMatrix::Protect(), GeneralMatrix::Release(), and REPORT.

586 {
587  REPORT
588  Tracer tr("GenericMatrix::operator*=");
589  if (!gm) Throw(ProgramException("GenericMatrix is null"));
590  gm->Protect(); // so it cannot get deleted during Evaluate
591  GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate();
592  MultipliedMatrix am(gm,gmx);
593  if (gmx==gm) gm->Release(2); else gm->Release();
594  GeneralMatrix* gmy = am.Evaluate();
595  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
596  else { REPORT }
597  gm->Protect();
598 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator*=() [2/2]

void GenericMatrix::operator*= ( Real  r)

Definition at line 643 of file newmat6.cpp.

References ScaledMatrix::Evaluate(), GeneralMatrix::Image(), and REPORT.

644 {
645  REPORT
646  Tracer tr("GenericMatrix::operator*= (Real)");
647  if (!gm) Throw(ProgramException("GenericMatrix is null"));
648  ScaledMatrix am(gm,r);
649  gm->Release();
650  GeneralMatrix* gmy = am.Evaluate();
651  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
652  else { REPORT }
653  gm->Protect();
654 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator+=() [1/2]

void GenericMatrix::operator+= ( const BaseMatrix X)

Definition at line 555 of file newmat6.cpp.

References GeneralMatrix::Evaluate(), AddedMatrix::Evaluate(), GeneralMatrix::Image(), GeneralMatrix::Protect(), GeneralMatrix::Release(), and REPORT.

556 {
557  REPORT
558  Tracer tr("GenericMatrix::operator+=");
559  if (!gm) Throw(ProgramException("GenericMatrix is null"));
560  gm->Protect(); // so it cannot get deleted during Evaluate
561  GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate();
562  AddedMatrix am(gm,gmx);
563  if (gmx==gm) gm->Release(2); else gm->Release();
564  GeneralMatrix* gmy = am.Evaluate();
565  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
566  else { REPORT }
567  gm->Protect();
568 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator+=() [2/2]

void GenericMatrix::operator+= ( Real  r)

Definition at line 630 of file newmat6.cpp.

References ShiftedMatrix::Evaluate(), GeneralMatrix::Image(), and REPORT.

631 {
632  REPORT
633  Tracer tr("GenericMatrix::operator+= (Real)");
634  if (!gm) Throw(ProgramException("GenericMatrix is null"));
635  ShiftedMatrix am(gm,r);
636  gm->Release();
637  GeneralMatrix* gmy = am.Evaluate();
638  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
639  else { REPORT }
640  gm->Protect();
641 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator-=() [1/2]

void GenericMatrix::operator-= ( const BaseMatrix X)

Definition at line 570 of file newmat6.cpp.

References GeneralMatrix::Evaluate(), SubtractedMatrix::Evaluate(), GeneralMatrix::Image(), GeneralMatrix::Protect(), GeneralMatrix::Release(), and REPORT.

571 {
572  REPORT
573  Tracer tr("GenericMatrix::operator-=");
574  if (!gm) Throw(ProgramException("GenericMatrix is null"));
575  gm->Protect(); // so it cannot get deleted during Evaluate
576  GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate();
577  SubtractedMatrix am(gm,gmx);
578  if (gmx==gm) gm->Release(2); else gm->Release();
579  GeneralMatrix* gmy = am.Evaluate();
580  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
581  else { REPORT }
582  gm->Protect();
583 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator-=() [2/2]

void GenericMatrix::operator-= ( Real  r)
inline

Definition at line 1202 of file newmat.h.

1202 { operator+=(-r); }
void operator+=(const BaseMatrix &)
Definition: newmat6.cpp:555

◆ operator/=()

void GenericMatrix::operator/= ( Real  r)
inline

Definition at line 1204 of file newmat.h.

1204 { operator*=(1.0/r); }
void operator*=(const BaseMatrix &)
Definition: newmat6.cpp:585

◆ operator=() [1/2]

void GenericMatrix::operator= ( const GenericMatrix bmx)

Definition at line 438 of file newmat6.cpp.

References gm, GeneralMatrix::Image(), and REPORT.

439 {
440  if (&bmx != this) { REPORT if (gm) delete gm; gm = bmx.gm->Image();}
441  else { REPORT }
442  gm->Protect();
443 }
GeneralMatrix * gm
Definition: newmat.h:1185
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator=() [2/2]

void GenericMatrix::operator= ( const BaseMatrix bmx)

Definition at line 445 of file newmat6.cpp.

References GeneralMatrix::Evaluate(), GeneralMatrix::Image(), REPORT, and BaseMatrix::search().

446 {
447  if (gm)
448  {
449  int counter=bmx.search(gm);
450  if (counter==0) { REPORT delete gm; gm=0; }
451  else { REPORT gm->Release(counter); }
452  }
453  else { REPORT }
454  GeneralMatrix* gmx = ((BaseMatrix&)bmx).Evaluate();
455  if (gmx != gm) { REPORT if (gm) delete gm; gm = gmx->Image(); }
456  else { REPORT }
457  gm->Protect();
458 }
void Release()
Definition: newmat.h:440
virtual int search(const BaseMatrix *) const =0
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ operator|=()

void GenericMatrix::operator|= ( const BaseMatrix X)

Definition at line 600 of file newmat6.cpp.

References GeneralMatrix::Evaluate(), ConcatenatedMatrix::Evaluate(), GeneralMatrix::Image(), GeneralMatrix::Protect(), GeneralMatrix::Release(), and REPORT.

601 {
602  REPORT
603  Tracer tr("GenericMatrix::operator|=");
604  if (!gm) Throw(ProgramException("GenericMatrix is null"));
605  gm->Protect(); // so it cannot get deleted during Evaluate
606  GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate();
607  ConcatenatedMatrix am(gm,gmx);
608  if (gmx==gm) gm->Release(2); else gm->Release();
609  GeneralMatrix* gmy = am.Evaluate();
610  if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); }
611  else { REPORT }
612  gm->Protect();
613 }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat6.cpp:19
virtual GeneralMatrix * Image() const
Definition: newmat4.cpp:838
void Protect()
Definition: newmat.h:437

◆ Release()

void GenericMatrix::Release ( )
inline

Definition at line 1207 of file newmat.h.

References GeneralMatrix::Release().

1207 { gm->Release(); }
void Release()
Definition: newmat.h:440
GeneralMatrix * gm
Definition: newmat.h:1185

◆ search()

int GenericMatrix::search ( const BaseMatrix bm) const
privatevirtual

Implements BaseMatrix.

Definition at line 398 of file newmat4.cpp.

References gm, REPORT, and GeneralMatrix::search().

399 { REPORT return gm->search(s); }
GeneralMatrix * gm
Definition: newmat.h:1185
int search(const BaseMatrix *) const
Definition: newmat4.cpp:395
#define REPORT
Definition: newmat4.cpp:19

Friends And Related Function Documentation

◆ BaseMatrix

friend class BaseMatrix
friend

Definition at line 1187 of file newmat.h.

Member Data Documentation

◆ gm

GeneralMatrix* GenericMatrix::gm
private

Definition at line 1185 of file newmat.h.

Referenced by BandWidth(), GenericMatrix(), operator=(), and search().


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