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

#include <newmat.h>

Inheritance diagram for Matrix:
GeneralMatrix BaseMatrix ColumnVector nricMatrix RowVector SquareMatrix

Public Member Functions

 Matrix ()
 
 ~Matrix ()
 
 Matrix (int, int)
 
 Matrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const Matrix &m)
 
MatrixType Type () const
 
Real & operator() (int, int)
 
Real & element (int, int)
 
Real operator() (int, int) const
 
Real element (int, int) const
 
 Matrix (const Matrix &gm)
 
GeneralMatrixMakeSolver ()
 
Real Trace () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void RestoreCol (MatrixRowCol &)
 
void RestoreCol (MatrixColX &)
 
void NextRow (MatrixRowCol &)
 
void NextCol (MatrixRowCol &)
 
void NextCol (MatrixColX &)
 
virtual void ReSize (int, int)
 
void ReSize (const GeneralMatrix &A)
 
Real MaximumAbsoluteValue2 (int &i, int &j) const
 
Real MinimumAbsoluteValue2 (int &i, int &j) const
 
Real Maximum2 (int &i, int &j) const
 
Real Minimum2 (int &i, int &j) const
 
void operator+= (const Matrix &M)
 
void operator-= (const Matrix &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 void Solver (MatrixColX &, const MatrixColX &)
 
virtual void RestoreRow (MatrixRowCol &)
 
Real SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
Real MaximumAbsoluteValue1 (int &i) const
 
Real MinimumAbsoluteValue1 (int &i) const
 
Real Maximum1 (int &i) const
 
Real Minimum1 (int &i) const
 
Real MaximumAbsoluteValue () const
 
Real MinimumAbsoluteValue () const
 
Real Maximum () const
 
Real Minimum () 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
 

Friends

OSSIM_DLL Real DotProduct (const Matrix &A, const Matrix &B)
 

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
 
virtual GeneralMatrixTranspose (TransposedMatrix *, MatrixType)
 
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 543 of file newmat.h.

Constructor & Destructor Documentation

◆ Matrix() [1/4]

Matrix::Matrix ( )
inline

Definition at line 547 of file newmat.h.

Referenced by Image().

547 :GeneralMatrix() {}

◆ ~Matrix()

Matrix::~Matrix ( )
inline

Definition at line 548 of file newmat.h.

548 {}

◆ Matrix() [2/4]

Matrix::Matrix ( int  m,
int  n 
)

Definition at line 48 of file newmat4.cpp.

References n, GeneralMatrix::ncols, GeneralMatrix::nrows, and REPORT.

48  : GeneralMatrix(m*n)
49 { REPORT nrows=m; ncols=n; }
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n

◆ Matrix() [3/4]

Matrix::Matrix ( const BaseMatrix M)

Definition at line 70 of file newmat4.cpp.

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

71 {
72  REPORT // CheckConversion(M);
73  // MatrixConversionCheck mcc;
75  GetMatrix(gmx);
76 }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat4.cpp:19
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

◆ Matrix() [4/4]

Matrix::Matrix ( const Matrix gm)
inline

Definition at line 563 of file newmat.h.

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

Member Function Documentation

◆ element() [1/2]

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

Definition at line 659 of file newmat6.cpp.

References n, and REPORT.

Referenced by QRZT().

660 {
661  REPORT
662  if (m<0 || m>= nrows || n<0 || n>= ncols)
663  Throw(IndexException(m,n,*this,true));
664  return store[m*ncols+n];
665 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ element() [2/2]

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

Definition at line 667 of file newmat6.cpp.

References n, and REPORT.

668 {
669  REPORT
670  if (m<0 || m>= nrows || n<0 || n>= ncols)
671  Throw(IndexException(m,n,*this,true));
672  return store[m*ncols+n];
673 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ GetCol() [1/2]

void Matrix::GetCol ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Reimplemented in RowVector.

Definition at line 118 of file newmat3.cpp.

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

119 {
120  REPORT
121  mrc.skip=0; mrc.storage=mrc.length=nrows;
122  if ( ncols==1 && !(mrc.cw*StoreHere) ) // ColumnVector
123  { REPORT mrc.data=store; }
124  else
125  {
126  Real* ColCopy;
127  if ( !(mrc.cw*(HaveStore+StoreHere)) )
128  {
129  REPORT
130  ColCopy = new Real [nrows]; MatrixErrorNoSpace(ColCopy);
131  MONITOR_REAL_NEW("Make (MatGetCol)",nrows,ColCopy)
132  mrc.data = ColCopy; mrc.cw += HaveStore;
133  }
134  else { REPORT ColCopy = mrc.data; }
135  if (+(mrc.cw*LoadOnEntry))
136  {
137  REPORT
138  Real* Mstore = store+mrc.rowcol; int i=nrows;
139  //while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols; }
140  if (i) for (;;)
141  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols; }
142  }
143  }
144 }
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 Matrix::GetCol ( MatrixColX mrc)
virtual

Implements GeneralMatrix.

Reimplemented in RowVector.

Definition at line 146 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, MatrixRowCol::length, LoadOnEntry, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, and MatrixRowCol::storage.

147 {
148  REPORT
149  mrc.skip=0; mrc.storage=nrows; mrc.length=nrows;
150  if (+(mrc.cw*LoadOnEntry))
151  {
152  REPORT Real* ColCopy = mrc.data;
153  Real* Mstore = store+mrc.rowcol; int i=nrows;
154  //while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols; }
155  if (i) for (;;)
156  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols; }
157  }
158 }
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
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 Matrix::GetRow ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 111 of file newmat3.cpp.

References MatrixRowCol::data, MatrixRowCol::length, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, and MatrixRowCol::storage.

112 {
113  REPORT
114  mrc.skip=0; mrc.storage=mrc.length=ncols; mrc.data=store+mrc.rowcol*ncols;
115 }
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ Image()

GeneralMatrix * Matrix::Image ( ) const
privatevirtual

Reimplemented from GeneralMatrix.

Reimplemented in ColumnVector, RowVector, nricMatrix, and SquareMatrix.

Definition at line 740 of file newmat4.cpp.

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

741 {
742  REPORT
743  GeneralMatrix* gm = new Matrix(*this); MatrixErrorNoSpace(gm);
744  return gm;
745 }
Matrix()
Definition: newmat.h:547
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ MakeSolver()

GeneralMatrix * Matrix::MakeSolver ( )
virtual

Reimplemented from GeneralMatrix.

Definition at line 31 of file newmat7.cpp.

References MatrixErrorNoSpace(), and REPORT.

32 {
33  REPORT
34  GeneralMatrix* gm = new CroutMatrix(*this);
35  MatrixErrorNoSpace(gm); gm->ReleaseAndDelete(); return gm;
36 }
#define REPORT
Definition: newmat7.cpp:18
friend class CroutMatrix
Definition: newmat.h:507
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292

◆ Maximum2()

Real Matrix::Maximum2 ( int &  i,
int &  j 
) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 368 of file newmat8.cpp.

References GeneralMatrix::Maximum1(), and REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
int Ncols() const
Definition: newmat.h:431
#define REPORT
Definition: newmat8.cpp:21
Real Maximum1(int &i) const
Definition: newmat8.cpp:263

◆ MaximumAbsoluteValue2()

Real Matrix::MaximumAbsoluteValue2 ( int &  i,
int &  j 
) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 352 of file newmat8.cpp.

References GeneralMatrix::MaximumAbsoluteValue1(), and REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real MaximumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:223
int Ncols() const
Definition: newmat.h:431
#define REPORT
Definition: newmat8.cpp:21

◆ Minimum2()

Real Matrix::Minimum2 ( int &  i,
int &  j 
) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 376 of file newmat8.cpp.

References GeneralMatrix::Minimum1(), and REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
int Ncols() const
Definition: newmat.h:431
Real Minimum1(int &i) const
Definition: newmat8.cpp:282
#define REPORT
Definition: newmat8.cpp:21

◆ MinimumAbsoluteValue2()

Real Matrix::MinimumAbsoluteValue2 ( int &  i,
int &  j 
) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 360 of file newmat8.cpp.

References GeneralMatrix::MinimumAbsoluteValue1(), and REPORT.

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 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real MinimumAbsoluteValue1(int &i) const
Definition: newmat8.cpp:243
int Ncols() const
Definition: newmat.h:431
#define REPORT
Definition: newmat8.cpp:21

◆ NextCol() [1/2]

void Matrix::NextCol ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Reimplemented in RowVector.

Definition at line 186 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, LoadOnEntry, REPORT, MatrixRowCol::rowcol, and StoreOnExit.

187 {
188  REPORT // 632
189  if (+(mrc.cw*StoreOnExit)) { REPORT RestoreCol(mrc); }
190  mrc.rowcol++;
191  if (mrc.rowcol<ncols)
192  {
193  if (+(mrc.cw*LoadOnEntry))
194  {
195  REPORT
196  Real* ColCopy = mrc.data;
197  Real* Mstore = store+mrc.rowcol; int i=nrows;
198  //while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols; }
199  if (i) for (;;)
200  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols; }
201  }
202  }
203  else { REPORT mrc.cw -= StoreOnExit; }
204 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void RestoreCol(MatrixRowCol &)
Definition: newmat3.cpp:160
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ NextCol() [2/2]

void Matrix::NextCol ( MatrixColX mrc)
virtual

Reimplemented from GeneralMatrix.

Reimplemented in RowVector.

Definition at line 206 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, LoadOnEntry, REPORT, MatrixRowCol::rowcol, and StoreOnExit.

207 {
208  REPORT
209  if (+(mrc.cw*StoreOnExit)) { REPORT RestoreCol(mrc); }
210  mrc.rowcol++;
211  if (mrc.rowcol<ncols)
212  {
213  if (+(mrc.cw*LoadOnEntry))
214  {
215  REPORT
216  Real* ColCopy = mrc.data;
217  Real* Mstore = store+mrc.rowcol; int i=nrows;
218  // while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols; }
219  if (i) for (;;)
220  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols; }
221  }
222  }
223  else { REPORT mrc.cw -= StoreOnExit; }
224 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void RestoreCol(MatrixRowCol &)
Definition: newmat3.cpp:160
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ NextRow()

void Matrix::NextRow ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 184 of file newmat3.cpp.

References MatrixRowCol::IncrMat(), and REPORT.

184 { REPORT mrc.IncrMat(); } // 1808
void IncrMat()
Definition: newmatrc.h:45
#define REPORT
Definition: newmat3.cpp:20

◆ operator()() [1/2]

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

Definition at line 30 of file newmat6.cpp.

References n, and REPORT.

31 {
32  REPORT
33  if (m<=0 || m>nrows || n<=0 || n>ncols)
34  Throw(IndexException(m,n,*this));
35  return store[(m-1)*ncols+n-1];
36 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator()() [2/2]

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

Definition at line 142 of file newmat6.cpp.

References n, and REPORT.

143 {
144  REPORT
145  if (m<=0 || m>nrows || n<=0 || n>ncols)
146  Throw(IndexException(m,n,*this));
147  return store[(m-1)*ncols+n-1];
148 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator+=() [1/2]

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

Definition at line 581 of file newmat.h.

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

◆ operator+=() [2/2]

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

Definition at line 583 of file newmat.h.

References GeneralMatrix::Add().

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

◆ operator-=() [1/2]

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

Definition at line 582 of file newmat.h.

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

◆ operator-=() [2/2]

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

Definition at line 584 of file newmat.h.

References GeneralMatrix::Add().

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

◆ operator=() [1/3]

void Matrix::operator= ( const BaseMatrix X)

Definition at line 345 of file newmat6.cpp.

References REPORT, and MatrixType::Rt.

Referenced by nricMatrix::operator=().

346 {
347  REPORT //CheckConversion(X);
348  // MatrixConversionCheck mcc;
349  Eq(X,MatrixType::Rt);
350 }
#define REPORT
Definition: newmat6.cpp:19
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ operator=() [2/3]

void Matrix::operator= ( Real  f)
inline

Definition at line 552 of file newmat.h.

References GeneralMatrix::operator=().

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

◆ operator=() [3/3]

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

Definition at line 553 of file newmat.h.

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

◆ ReSize() [1/2]

void Matrix::ReSize ( int  nr,
int  nc 
)
virtual

Reimplemented in ColumnVector, RowVector, nricMatrix, and SquareMatrix.

Definition at line 233 of file newmat4.cpp.

References REPORT, and GeneralMatrix::ReSize().

Referenced by QRZ(), QRZT(), ReSize(), nricMatrix::ReSize(), and SVD().

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

◆ ReSize() [2/2]

void Matrix::ReSize ( const GeneralMatrix A)
virtual

Reimplemented from GeneralMatrix.

Reimplemented in ColumnVector, RowVector, nricMatrix, and SquareMatrix.

Definition at line 283 of file newmat4.cpp.

References A, REPORT, and ReSize().

284 { REPORT ReSize(A.Nrows(), A.Ncols()); }
#define A(r, c)
virtual void ReSize(int, int)
Definition: newmat4.cpp:233
#define REPORT
Definition: newmat4.cpp:19

◆ RestoreCol() [1/2]

void Matrix::RestoreCol ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Reimplemented in RowVector.

Definition at line 160 of file newmat3.cpp.

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

161 {
162  // always check StoreOnExit before calling RestoreCol
163  REPORT // 429
164  if (+(mrc.cw*HaveStore))
165  {
166  REPORT // 426
167  Real* Mstore = store+mrc.rowcol; int i=nrows;
168  Real* Cstore = mrc.data;
169  // while (i--) { *Mstore = *Cstore++; Mstore+=ncols; }
170  if (i) for (;;)
171  { *Mstore = *Cstore++; if (!(--i)) break; Mstore+=ncols; }
172  }
173 }
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
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ RestoreCol() [2/2]

void Matrix::RestoreCol ( MatrixColX mrc)
virtual

Reimplemented from GeneralMatrix.

Reimplemented in RowVector.

Definition at line 175 of file newmat3.cpp.

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

176 {
177  REPORT
178  Real* Mstore = store+mrc.rowcol; int i=nrows; Real* Cstore = mrc.data;
179  // while (i--) { *Mstore = *Cstore++; Mstore+=ncols; }
180  if (i) for (;;)
181  { *Mstore = *Cstore++; if (!(--i)) break; Mstore+=ncols; }
182 }
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

◆ Trace()

Real Matrix::Trace ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 536 of file newmat8.cpp.

References REPORT.

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 }
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

◆ Type()

MatrixType Matrix::Type ( ) const
virtual

Implements GeneralMatrix.

Reimplemented in ColumnVector, RowVector, and SquareMatrix.

Definition at line 413 of file newmat4.cpp.

References MatrixType::Rt.

413 { return MatrixType::Rt; }

Friends And Related Function Documentation

◆ DotProduct

OSSIM_DLL Real DotProduct ( const Matrix A,
const Matrix B 
)
friend

Definition at line 526 of file newmat8.cpp.

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 }
double Real
Definition: include.h:57
#define A(r, c)
#define REPORT
Definition: newmat8.cpp:21
os2<< "> n<< " > nendobj n
Real * store
Definition: newmat.h:393
int storage
Definition: newmat.h:392

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