General Purpose Geodetic Library
SgUtMatrix Class Reference

#include <SgUtMatrix.h>

Inheritance diagram for SgUtMatrix:
SgMatrix SgSymMatrix

Public Member Functions

 SgUtMatrix ()
 
 SgUtMatrix (unsigned int N, bool IsNeedClear=true)
 
 SgUtMatrix (const SgUtMatrix &R)
 
 ~SgUtMatrix ()
 
unsigned int n () const
 
double & operator() (unsigned int i, unsigned int j)
 
double getElement (unsigned int i, unsigned int j) const
 
void setElement (unsigned int i, unsigned int j, double d)
 
void clear ()
 
SgMatrix T () const
 
SgUtMatrixoperator= (const SgUtMatrix &R)
 
SgUtMatrixoperator= (double d)
 
SgUtMatrixoperator+= (const SgUtMatrix &R)
 
SgUtMatrixoperator-= (const SgUtMatrix &R)
 
SgUtMatrixoperator*= (double d)
 
SgUtMatrixoperator/= (double d)
 
double **& base ()
 
const double *const * base_c () const
 
- Public Member Functions inherited from SgMatrix
 SgMatrix ()
 
 SgMatrix (unsigned int NRow, unsigned int NCol, bool IsNeedClear=true)
 
 SgMatrix (const SgMatrix &M)
 
 ~SgMatrix ()
 
unsigned int nRow () const
 
unsigned int nCol () const
 
double & operator() (unsigned int i, unsigned int j)
 
double getElement (unsigned int i, unsigned int j) const
 
void setElement (unsigned int i, unsigned int j, double d)
 
void clear ()
 
SgMatrix T () const
 
SgMatrixoperator= (const SgMatrix &M)
 
SgMatrixoperator= (double d)
 
SgMatrixoperator+= (const SgMatrix &M)
 
SgMatrixoperator-= (const SgMatrix &M)
 
SgMatrixoperator*= (double d)
 
SgMatrixoperator/= (double d)
 
bool operator== (const SgMatrix &M) const
 
bool operator!= (const SgMatrix &M) const
 
double **& base ()
 
const double *const * base_c () const
 

Friends

SgUtMatrix operator- (const SgUtMatrix &R)
 
SgUtMatrix operator/ (const SgUtMatrix &R, double d)
 
SgUtMatrix operator* (const SgUtMatrix &R, double d)
 
SgUtMatrix operator* (double d, const SgUtMatrix &R)
 
SgUtMatrix operator+ (const SgUtMatrix &R1, const SgUtMatrix &R2)
 
SgUtMatrix operator- (const SgUtMatrix &R1, const SgUtMatrix &R2)
 
SgVector operator* (const SgUtMatrix &R, const SgVector &V)
 
SgMatrix calcProduct_mat_x_mat (const SgUtMatrix &R1, const SgMatrix &M2)
 
SgUtMatrix operator~ (const SgUtMatrix &R)
 

Additional Inherited Members

- Protected Attributes inherited from SgMatrix
unsigned int NRow_
 An number of rows in a matrix. More...
 
unsigned int NCol_
 An number of columns in a matrix. More...
 
double ** B_
 A pointer on a pointer of a first element of the matrix. More...
 
double dTmp_
 Local temporary variable. More...
 

Detailed Description

An upper triangular matrix. SRIF uses it. ====================================================================================================

Definition at line 43 of file SgUtMatrix.h.

Constructor & Destructor Documentation

◆ SgUtMatrix() [1/3]

SgUtMatrix::SgUtMatrix ( )
inline

A constructor. Creates an empty vector (for I/O purposes or later assignments).

Definition at line 225 of file SgUtMatrix.h.

◆ SgUtMatrix() [2/3]

SgUtMatrix::SgUtMatrix ( unsigned int  N,
bool  IsNeedClear = true 
)
inline

A constructor. Creates a copy of an object.

Parameters
N– number of elements in a row or column.
IsNeedClear– if set to TRUE fills the array with zeros, if set to "false" skips this procedure and the state of a matrix depends on compiler realization.

Definition at line 234 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::dTmp_, SgMatrix::NCol_, and SgMatrix::NRow_.

◆ SgUtMatrix() [3/3]

SgUtMatrix::SgUtMatrix ( const SgUtMatrix R)
inline

A constructor. Creates a copy of an object.

Parameters
M– upper-triangular matrix that will be copied into the new object.

Definition at line 252 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::dTmp_, SgMatrix::NCol_, and SgMatrix::NRow_.

◆ ~SgUtMatrix()

SgUtMatrix::~SgUtMatrix ( )
inline

A destructor. Frees allocated memory.

Definition at line 269 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::dTmp_, SgMatrix::NCol_, and SgMatrix::NRow_.

Member Function Documentation

◆ base()

double** & SgUtMatrix::base ( )
inline

◆ base_c()

const double* const* SgUtMatrix::base_c ( ) const
inline

Definition at line 204 of file SgUtMatrix.h.

References SgMatrix::B_.

Referenced by SgEstimator::calcQForm().

◆ clear()

void SgUtMatrix::clear ( )
inline

Fills all elements with zero.

Definition at line 364 of file SgUtMatrix.h.

References SgMatrix::B_, and SgMatrix::NCol_.

◆ getElement()

double SgUtMatrix::getElement ( unsigned int  i,
unsigned int  j 
) const
inline

Returns a value of (i,j)-th element. The matrix does not change.

Parameters
i– an index; valid ranges are: [0,N-1].
j– an index; valid ranges are: [0,N-1].

Definition at line 318 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::NCol_, and SgMatrix::NRow_.

Referenced by SgEstimator::calcConditionNumber(), SgEstimator::calcQForm(), SgEstimator::calculateRRT(), SgEstimator::dataUpdate(), SgEstimator::insertNewParameters(), operator<<(), SgEstimator::propagateStochasticParameters(), SgEstimator::saveProcessedParameters(), SgEstimator::solveEquation(), and solveEquation().

◆ n()

unsigned int SgUtMatrix::n ( ) const
inline

Returns number of rows/columns in the matrix.

Definition at line 290 of file SgUtMatrix.h.

References SgMatrix::NRow_.

Referenced by SgEstimator::calcConditionNumber(), SgSolutionReporter::calculateConditionNumber(), and updateSolutionAtParameterList().

◆ operator()()

double & SgUtMatrix::operator() ( unsigned int  i,
unsigned int  j 
)
inline

Returns a reference at (i,j)-th element of the matrix, so R(i,j)=x is working.

Parameters
i– an index; valid ranges are: [0,N-1].
j– an index; valid ranges are: [i,N-1].

Definition at line 298 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::dTmp_, SgMatrix::NCol_, and SgMatrix::NRow_.

◆ operator*=()

SgUtMatrix & SgUtMatrix::operator*= ( double  d)
inline

Multiplies the UT matrix by a scalar.

Parameters
d– a scale.

Definition at line 448 of file SgUtMatrix.h.

References SgMatrix::B_, and SgMatrix::NCol_.

Referenced by SgSymMatrix::operator*=().

◆ operator+=()

SgUtMatrix & SgUtMatrix::operator+= ( const SgUtMatrix R)
inline

Increments the UT matrix by the another one.

Parameters
R– a matrix to add.

Definition at line 400 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::NCol_, and SgMatrix::NRow_.

Referenced by SgSymMatrix::operator+=().

◆ operator-=()

SgUtMatrix & SgUtMatrix::operator-= ( const SgUtMatrix R)
inline

Decrements the UT matrix by the another one.

Parameters
R– a matrix to substract.

Definition at line 424 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::NCol_, and SgMatrix::NRow_.

Referenced by SgSymMatrix::operator-=().

◆ operator/=()

SgUtMatrix & SgUtMatrix::operator/= ( double  d)
inline

Divides the UT matrix by a scalar.

Parameters
d– a divider.

Definition at line 461 of file SgUtMatrix.h.

References SgMatrix::B_, and SgMatrix::NCol_.

Referenced by SgSymMatrix::operator/=().

◆ operator=() [1/2]

SgUtMatrix & SgUtMatrix::operator= ( const SgUtMatrix R)

Assign a matrix to the another one.

Parameters
R– a matrix to copy.

Definition at line 39 of file SgUtMatrix.cpp.

References SgMatrix::B_, SgMatrix::NCol_, and SgMatrix::NRow_.

Referenced by SgSymMatrix::operator=().

◆ operator=() [2/2]

SgUtMatrix & SgUtMatrix::operator= ( double  d)
inline

Fills the UT matrix with a double.

Parameters
d– a value to fill the matrix.

Definition at line 387 of file SgUtMatrix.h.

References SgMatrix::B_, and SgMatrix::NCol_.

◆ setElement()

void SgUtMatrix::setElement ( unsigned int  i,
unsigned int  j,
double  d 
)
inline

Changes the (i,j)-th element.

Parameters
i– an index; valid ranges are: [0,N-1];
j– an index; valid ranges are: [i,N-1];
d– a new value for (i,j)-th element.

Definition at line 338 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::NCol_, and SgMatrix::NRow_.

Referenced by SgEstimator::dataUpdate(), SgEstimator::insertNewParameters(), SgEstimator::prepare2Run(), SgEstimator::propagateStochasticParameters(), and SgEstimator::saveProcessedParameters().

◆ T()

SgMatrix SgUtMatrix::T ( ) const
inline

Returns transposed matrix (the original matrix doesn't change).

Definition at line 374 of file SgUtMatrix.h.

References SgMatrix::B_, SgMatrix::nCol(), SgMatrix::NCol_, SgMatrix::nRow(), SgMatrix::NRow_, and SgMatrix::setElement().

Friends And Related Function Documentation

◆ calcProduct_mat_x_mat

SgMatrix calcProduct_mat_x_mat ( const SgUtMatrix R1,
const SgMatrix M2 
)
friend

Definition at line 124 of file SgUtMatrix.cpp.

◆ operator* [1/3]

SgVector operator* ( const SgUtMatrix R,
const SgVector V 
)
friend

Makes a product of a matrix and a vector.

Parameters
R– a matrix;
V– a vector.

Definition at line 69 of file SgUtMatrix.cpp.

◆ operator* [2/3]

SgUtMatrix operator* ( const SgUtMatrix R,
double  d 
)
friend

Returns a matrix multiplied by a scalar.

Parameters
R– a matrix;
d– a scale.

Definition at line 495 of file SgUtMatrix.h.

◆ operator* [3/3]

SgUtMatrix operator* ( double  d,
const SgUtMatrix R 
)
friend

Returns a natrix multiplied by a scalar.

Parameters
d– a scale.
R– a matrix;

Definition at line 503 of file SgUtMatrix.h.

◆ operator+

SgUtMatrix operator+ ( const SgUtMatrix R1,
const SgUtMatrix R2 
)
friend

Returns a sum of two UT matrices.

Parameters
R1is a first term,
R2is a second term in the sum.

Definition at line 511 of file SgUtMatrix.h.

◆ operator- [1/2]

SgUtMatrix operator- ( const SgUtMatrix R)
friend

Returns a matrix with an inverted sign.

Parameters
R– an original matrix.

Definition at line 479 of file SgUtMatrix.h.

◆ operator- [2/2]

SgUtMatrix operator- ( const SgUtMatrix R1,
const SgUtMatrix R2 
)
friend

Returns a difference of two matrices.

Parameters
R1is a first term,
R2is a second term in the sum.

Definition at line 519 of file SgUtMatrix.h.

◆ operator/

SgUtMatrix operator/ ( const SgUtMatrix R,
double  d 
)
friend

Returns a matrix divided by a scalar.

Parameters
R– a matrix;
d– a divider;

Definition at line 487 of file SgUtMatrix.h.

◆ operator~

SgUtMatrix operator~ ( const SgUtMatrix R)
friend

Returns inversed matrix. This is time consumed operation, shouldn't use in ordinary operations. R*~R == ~R*R == E (original matrix doesn't change)..

Definition at line 90 of file SgUtMatrix.cpp.


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