General Purpose Geodetic Library
SgSymMatrix Class Reference

#include <SgSymMatrix.h>

Inheritance diagram for SgSymMatrix:
SgUtMatrix SgMatrix

Public Member Functions

 SgSymMatrix ()
 
 SgSymMatrix (unsigned int N, bool IsNeedClear=true)
 
 SgSymMatrix (const SgSymMatrix &P)
 
 ~SgSymMatrix ()
 
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)
 
double **& base ()
 
const double *const * base_c () const
 
SgSymMatrixoperator= (const SgSymMatrix &P)
 
SgSymMatrixoperator+= (const SgSymMatrix &P)
 
SgSymMatrixoperator-= (const SgSymMatrix &P)
 
SgSymMatrixoperator= (double d)
 
SgSymMatrixoperator*= (double d)
 
SgSymMatrixoperator/= (double d)
 
SgSymMatrix T () const
 
- Public Member Functions inherited from SgUtMatrix
 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

SgSymMatrix operator- (const SgSymMatrix &P)
 
SgSymMatrix operator/ (const SgSymMatrix &P, double d)
 
SgSymMatrix operator* (const SgSymMatrix &P, double d)
 
SgSymMatrix operator* (double d, const SgSymMatrix &P)
 
SgSymMatrix operator+ (const SgSymMatrix &P1, const SgSymMatrix &P2)
 
SgSymMatrix operator- (const SgSymMatrix &P1, const SgSymMatrix &P2)
 
SgVector operator* (const SgSymMatrix &P, const SgVector &V)
 
SgMatrix calcProduct_mat_x_mat (const SgMatrix &M1, const SgSymMatrix &P2)
 
SgSymMatrix operator~ (const SgSymMatrix &P)
 

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

A symmetrical matrix. SRIF uses it.

Definition at line 43 of file SgSymMatrix.h.

Constructor & Destructor Documentation

◆ SgSymMatrix() [1/3]

SgSymMatrix::SgSymMatrix ( )
inline

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

Definition at line 218 of file SgSymMatrix.h.

Referenced by T().

◆ SgSymMatrix() [2/3]

SgSymMatrix::SgSymMatrix ( 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 227 of file SgSymMatrix.h.

◆ SgSymMatrix() [3/3]

SgSymMatrix::SgSymMatrix ( const SgSymMatrix P)
inline

A constructor. Creates a copy of an object.

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

Definition at line 236 of file SgSymMatrix.h.

◆ ~SgSymMatrix()

SgSymMatrix::~SgSymMatrix ( )
inline

A destructor. Frees allocated memory.

Definition at line 245 of file SgSymMatrix.h.

Member Function Documentation

◆ base()

double** & SgSymMatrix::base ( )
inline

Definition at line 98 of file SgSymMatrix.h.

References SgMatrix::B_.

Referenced by SgEstimator::calcQForm().

◆ base_c()

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

Definition at line 100 of file SgSymMatrix.h.

References SgMatrix::B_.

Referenced by SgEstimator::calcQForm().

◆ getElement()

◆ operator()()

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

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

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

Definition at line 257 of file SgSymMatrix.h.

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

◆ operator*=()

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

Multiplies the matrix by a scalar.

Parameters
d– a scale.

Definition at line 345 of file SgSymMatrix.h.

References SgUtMatrix::operator*=().

◆ operator+=()

SgSymMatrix & SgSymMatrix::operator+= ( const SgSymMatrix P)
inline

Increments the matrix by the another one.

Parameters
P– a matrix to add.

Definition at line 321 of file SgSymMatrix.h.

References SgUtMatrix::operator+=().

◆ operator-=()

SgSymMatrix & SgSymMatrix::operator-= ( const SgSymMatrix P)
inline

Decrements the matrix by the another one.

Parameters
P– a matrix to substract.

Definition at line 329 of file SgSymMatrix.h.

References SgUtMatrix::operator-=().

◆ operator/=()

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

Divides the matrix by a scalar.

Parameters
d– a divider.

Definition at line 353 of file SgSymMatrix.h.

References SgUtMatrix::operator/=().

◆ operator=() [1/2]

SgSymMatrix & SgSymMatrix::operator= ( const SgSymMatrix P)
inline

Assign a matrix to another one.

Parameters
P– a matrix to copy.

Definition at line 313 of file SgSymMatrix.h.

References SgUtMatrix::operator=().

◆ operator=() [2/2]

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

Fills the matrix with a double.

Parameters
d– a value to fill the matrix.

Definition at line 337 of file SgSymMatrix.h.

References SgUtMatrix::operator=().

◆ setElement()

void SgSymMatrix::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: [0,N-1];
d– a new value for i-th element.

Definition at line 291 of file SgSymMatrix.h.

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

Referenced by SgEstimator::collectDependentInfArray(), and SgEstimator::submittSolution2GlobalStore().

◆ T()

SgSymMatrix SgSymMatrix::T ( ) const
inline

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

Definition at line 361 of file SgSymMatrix.h.

References SgSymMatrix().

Friends And Related Function Documentation

◆ calcProduct_mat_x_mat

SgMatrix calcProduct_mat_x_mat ( const SgMatrix M1,
const SgSymMatrix P2 
)
friend

Definition at line 73 of file SgSymMatrix.cpp.

◆ operator* [1/3]

SgVector operator* ( const SgSymMatrix P,
const SgVector V 
)
friend

Makes a product of a matrix and a vector.

Parameters
R– a matrix;
V– a vector.

Definition at line 48 of file SgSymMatrix.cpp.

◆ operator* [2/3]

SgSymMatrix operator* ( const SgSymMatrix P,
double  d 
)
friend

Returns a matrix multiplied by a scalar.

Parameters
P– a matrix;
d– a scale.

Definition at line 373 of file SgSymMatrix.h.

◆ operator* [3/3]

SgSymMatrix operator* ( double  d,
const SgSymMatrix P 
)
friend

Returns a natrix multiplied by a scalar.

Parameters
d– a scale.
P– a matrix;

Definition at line 381 of file SgSymMatrix.h.

◆ operator+

SgSymMatrix operator+ ( const SgSymMatrix P1,
const SgSymMatrix P2 
)
friend

Returns a sum of two matrices.

Parameters
P1is a first term,
P2is a second term in the sum.

Definition at line 405 of file SgSymMatrix.h.

◆ operator- [1/2]

SgSymMatrix operator- ( const SgSymMatrix P)
friend

Returns a matrix with an inverted sign.

Parameters
P– an original matrix.

Definition at line 397 of file SgSymMatrix.h.

◆ operator- [2/2]

SgSymMatrix operator- ( const SgSymMatrix P1,
const SgSymMatrix P2 
)
friend

Returns a difference of two matrices.

Parameters
P1is a first term,
P2is a second term in the sum.

Definition at line 413 of file SgSymMatrix.h.

◆ operator/

SgSymMatrix operator/ ( const SgSymMatrix P,
double  d 
)
friend

Returns a matrix divided by a scalar.

Parameters
P– a matrix;
d– a divider;

Definition at line 389 of file SgSymMatrix.h.

◆ operator~

SgSymMatrix operator~ ( const SgSymMatrix P)
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 421 of file SgSymMatrix.h.


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