General Purpose Geodetic Library
Sg3dMatrix Class Reference

#include <Sg3dMatrix.h>

Inheritance diagram for Sg3dMatrix:
Sg3dMatrixR Sg3dMatrixR2dot Sg3dMatrixRdot

Public Member Functions

 Sg3dMatrix ()
 
 Sg3dMatrix (const Sg3dMatrix &)
 
 Sg3dMatrix (const Sg3dVector &col0, const Sg3dVector &col1, const Sg3dVector &col2)
 
 Sg3dMatrix (double a00, double a01, double a02, double a10, double a11, double a12, double a20, double a21, double a22)
 
 ~Sg3dMatrix ()
 
double & operator() (DIRECTION i, DIRECTION j)
 
double at (DIRECTION i, DIRECTION j) const
 
double module () const
 
void unify ()
 
Sg3dMatrix T () const
 
Sg3dMatrixoperator= (const Sg3dMatrix &)
 
Sg3dMatrixoperator+= (const Sg3dMatrix &)
 
Sg3dMatrixoperator-= (const Sg3dMatrix &)
 
Sg3dMatrixoperator*= (double)
 
Sg3dMatrixoperator/= (double)
 

Protected Attributes

double mat [3][3]
 The 3x3 array that is storing elements of a matrix. More...
 

Friends

Sg3dMatrix operator+ (const Sg3dMatrix &, const Sg3dMatrix &)
 
Sg3dMatrix operator- (const Sg3dMatrix &, const Sg3dMatrix &)
 
Sg3dMatrix operator/ (const Sg3dMatrix &, double)
 
Sg3dMatrix operator* (const Sg3dMatrix &, double)
 
Sg3dMatrix operator* (double, const Sg3dMatrix &)
 
Sg3dMatrix operator- (const Sg3dMatrix &)
 
Sg3dVector operator* (const Sg3dMatrix &, const Sg3dVector &)
 
Sg3dMatrix operator* (const Sg3dMatrix &, const Sg3dMatrix &)
 
Sg3dMatrix operator~ (const Sg3dMatrix &)
 
std::ostream & operator<< (std::ostream &s, const Sg3dMatrix &M)
 

Detailed Description

A three-dimentional matrix. Should be useful for various geometrical calculations.

Definition at line 44 of file Sg3dMatrix.h.

Constructor & Destructor Documentation

◆ Sg3dMatrix() [1/4]

Sg3dMatrix::Sg3dMatrix ( )
inline

A constructor. Creates a default copy of the object, fills it with zeros.

Definition at line 183 of file Sg3dMatrix.h.

References mat.

Referenced by T().

◆ Sg3dMatrix() [2/4]

Sg3dMatrix::Sg3dMatrix ( const Sg3dMatrix M)
inline

A constructor. Creates a copy of the object from given reference.

Definition at line 206 of file Sg3dMatrix.h.

References mat.

◆ Sg3dMatrix() [3/4]

Sg3dMatrix::Sg3dMatrix ( const Sg3dVector col0,
const Sg3dVector col1,
const Sg3dVector col2 
)
inline

A constructor. Creates a matrix with columns equal to col0, col1 and col2.

Definition at line 190 of file Sg3dMatrix.h.

References Sg3dVector::at(), mat, X_AXIS, Y_AXIS, and Z_AXIS.

◆ Sg3dMatrix() [4/4]

Sg3dMatrix::Sg3dMatrix ( double  a00,
double  a01,
double  a02,
double  a10,
double  a11,
double  a12,
double  a20,
double  a21,
double  a22 
)
inline

A constructor. Creates a matrix with given elements (first row, second row, third row) of doubles.

Definition at line 197 of file Sg3dMatrix.h.

References mat.

◆ ~Sg3dMatrix()

Sg3dMatrix::~Sg3dMatrix ( )
inline

A destructor. Destroys the object.

Definition at line 78 of file Sg3dMatrix.h.

Member Function Documentation

◆ at()

double Sg3dMatrix::at ( DIRECTION  i,
DIRECTION  j 
) const
inline

Returns a value of (i,j)-th element. Here i is index of a row, j – column; the valid ranges are [0,1,2]. The function does not change the object.

Definition at line 93 of file Sg3dMatrix.h.

References mat.

Referenced by SgAgvDriver::fillBslnVars(), SgVlbiSession::putDataIntoVgosDb(), and SgSolutionReporter::reportEstimationBlock_Output4Spoolfile().

◆ module()

double Sg3dMatrix::module ( ) const
inline

Returns a determinant of a matrix.

Definition at line 253 of file Sg3dMatrix.h.

References mat.

Referenced by unify().

◆ operator()()

double& Sg3dMatrix::operator() ( DIRECTION  i,
DIRECTION  j 
)
inline

Returns a reference on (i,j)-th element. Here i is index of a row, j – column; the valid ranges are [0,1,2]. The return value can be "left hand side", i.e., one could write A(i,j) = b.

Definition at line 88 of file Sg3dMatrix.h.

References mat.

◆ operator*=()

Sg3dMatrix & Sg3dMatrix::operator*= ( double  v)
inline

Multiplies a matrix with a double.

Definition at line 237 of file Sg3dMatrix.h.

References mat.

◆ operator+=()

Sg3dMatrix & Sg3dMatrix::operator+= ( const Sg3dMatrix M)
inline

Increase a matrix with a value of a given matrix, i.e., user can write M+=A.

Definition at line 221 of file Sg3dMatrix.h.

References mat.

◆ operator-=()

Sg3dMatrix & Sg3dMatrix::operator-= ( const Sg3dMatrix M)
inline

Decrease a matrix with a value of a given matrix, i.e., user can write M-=A.

Definition at line 229 of file Sg3dMatrix.h.

References mat.

◆ operator/=()

Sg3dMatrix & Sg3dMatrix::operator/= ( double  v)
inline

Divides a matrix on a double.

Definition at line 245 of file Sg3dMatrix.h.

References mat.

Referenced by unify().

◆ operator=()

Sg3dMatrix & Sg3dMatrix::operator= ( const Sg3dMatrix M)
inline

Makes an assignment.

Definition at line 213 of file Sg3dMatrix.h.

References mat.

◆ T()

Sg3dMatrix Sg3dMatrix::T ( ) const
inline

Returns a transposed matrix (the original matrix does not change).

Definition at line 261 of file Sg3dMatrix.h.

References Sg3dMatrix(), and mat.

◆ unify()

void Sg3dMatrix::unify ( )
inline

Unifies a matrix, i.e., |M|==1.

Definition at line 104 of file Sg3dMatrix.h.

References module(), and operator/=().

Friends And Related Function Documentation

◆ operator* [1/4]

Sg3dMatrix operator* ( const Sg3dMatrix M1,
const Sg3dMatrix M2 
)
friend

Returns a product of two matrices.

Definition at line 58 of file Sg3dMatrix.cpp.

◆ operator* [2/4]

Sg3dVector operator* ( const Sg3dMatrix M,
const Sg3dVector V 
)
friend

Returns a product of a matrix and a vector.

Definition at line 350 of file Sg3dMatrix.h.

◆ operator* [3/4]

Sg3dMatrix operator* ( const Sg3dMatrix M1,
double  v2 
)
friend

Returns a product of a matrix and a scalar.

Definition at line 344 of file Sg3dMatrix.h.

◆ operator* [4/4]

Sg3dMatrix operator* ( double  v1,
const Sg3dMatrix M2 
)
friend

Returns a product of a scalar and a matrix.

Definition at line 335 of file Sg3dMatrix.h.

◆ operator+

Sg3dMatrix operator+ ( const Sg3dMatrix M1,
const Sg3dMatrix M2 
)
friend

Returns a sum of two matrices.

Definition at line 292 of file Sg3dMatrix.h.

◆ operator- [1/2]

Sg3dMatrix operator- ( const Sg3dMatrix M1)
friend

Returns a matrix with inverted sign.

Definition at line 276 of file Sg3dMatrix.h.

◆ operator- [2/2]

Sg3dMatrix operator- ( const Sg3dMatrix M1,
const Sg3dMatrix M2 
)
friend

Returns a difference of two matrices.

Definition at line 309 of file Sg3dMatrix.h.

◆ operator/

Sg3dMatrix operator/ ( const Sg3dMatrix M1,
double  v2 
)
friend

Returns a matrix divided by scalar.

Definition at line 326 of file Sg3dMatrix.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  s,
const Sg3dMatrix M 
)
friend

Makes an output to std::ostream, standard text formatted output.

Definition at line 358 of file Sg3dMatrix.h.

◆ operator~

Sg3dMatrix operator~ ( const Sg3dMatrix M1)
friend

Returns inverted matrix: A*~A=~A*A=1 (the original matrix does not change).

Definition at line 83 of file Sg3dMatrix.cpp.

Member Data Documentation

◆ mat


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