General Purpose Geodetic Library
SgMatrix Class Reference

#include <SgMatrix.h>

Inheritance diagram for SgMatrix:
SgUtMatrix SgSymMatrix

Public Member Functions

 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
 

Protected Attributes

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

Friends

SgMatrix operator- (const SgMatrix &M)
 
SgMatrix operator/ (const SgMatrix &M, double d)
 
SgMatrix operator* (const SgMatrix &M, double d)
 
SgMatrix operator* (double d, const SgMatrix &M)
 
SgMatrix operator+ (const SgMatrix &M1, const SgMatrix &M2)
 
SgMatrix operator- (const SgMatrix &M1, const SgMatrix &M2)
 
SgVector operator* (const SgMatrix &M, const SgVector &V)
 
SgMatrix calcProduct_mat_x_mat (const SgMatrix &M1, const SgMatrix &M2)
 
SgMatrix calcProduct_mat_x_mat (const SgUtMatrix &U1, const SgMatrix &M2)
 
SgMatrix calcProduct_mat_x_mat (const SgMatrix &M1, const SgSymMatrix &P2)
 
SgMatrix calcProduct_matT_x_mat (const SgMatrix &M1, const SgMatrix &M2)
 
SgMatrix calcProduct_mat_x_matT (const SgMatrix &M1, const SgMatrix &M2)
 
SgVector calcProduct_matT_x_vec (const SgMatrix &M, const SgVector &V)
 

Detailed Description

A matrix. Should be useful for various matrix calculations.

Definition at line 58 of file SgMatrix.h.

Constructor & Destructor Documentation

◆ SgMatrix() [1/3]

SgMatrix::SgMatrix ( )
inline

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

Definition at line 279 of file SgMatrix.h.

References B_, dTmp_, NCol_, and NRow_.

◆ SgMatrix() [2/3]

SgMatrix::SgMatrix ( unsigned int  NRow,
unsigned int  NCol,
bool  IsNeedClear = true 
)
inline

A constructor. Creates a copy of an object.

Parameters
NRow– number of rows.
NCol– number of columns.
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 289 of file SgMatrix.h.

References B_, dTmp_, NCol_, and NRow_.

◆ SgMatrix() [3/3]

SgMatrix::SgMatrix ( const SgMatrix M)
inline

A constructor. Creates a copy of an object.

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

Definition at line 316 of file SgMatrix.h.

References B_, dTmp_, NCol_, and NRow_.

◆ ~SgMatrix()

SgMatrix::~SgMatrix ( )
inline

A destructor. Frees allocated memory.

Definition at line 332 of file SgMatrix.h.

References B_, NCol_, and NRow_.

Member Function Documentation

◆ base()

double** & SgMatrix::base ( )
inline

◆ base_c()

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

Definition at line 249 of file SgMatrix.h.

References B_.

Referenced by SgEstimator::calcQForm().

◆ clear()

void SgMatrix::clear ( )
inline

Fills all elements with zero.

Definition at line 425 of file SgMatrix.h.

References B_, NCol_, and NRow_.

Referenced by SgVlbiSession::getDataFromVgosDb(), SgEstimator::propagateStochasticParameters(), and SgEstimator::propagateStochasticParameters_th().

◆ getElement()

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

Returns a value of (i,j)-th element.

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

Definition at line 385 of file SgMatrix.h.

References B_, NCol_, and NRow_.

Referenced by SgVlbiSession::allocPxyInterpolValues(), calcLhv(), SgPlotArea::calcLimits(), SgVlbiObservable::calcPhaseCalDelay(), SgEstimator::calcQForm(), SgSolutionReporter::calculateConditionNumber(), NsSessionEditDialog::changeNumOfAmbigSpacing4MarkedPoints(), NsSessionEditDialog::changeNumOfSubAmbig4MarkedPoints(), SgEstimator::dataUpdate(), SgPlotArea::drawData(), SgAgvDriver::fillBslnVars(), SgAgvDriver::fillSessVars(), SgPlotBranch::getDataAttr(), SgVlbiSession::getDataFromVgosDb(), operator<<(), SgPlotArea::output4Files(), SgVlbiSession::prepare4ErpInterpolation(), SgVlbiSession::processKombFile(), SgEstimator::propagateStochasticParameters(), SgVlbiSession::putDataIntoVgosDb(), SgPlot::queryData(), SgPlotArea::queryPoint(), SgCubicSpline::solveSpline(), SgCubicSpline::spline(), SgVgosDb::storeAntennaApriories(), SgVgosDb::storeCalcEop(), SgVgosDb::storeCalcInfo(), SgVgosDb::storeClockApriories(), SgVgosDb::storeEccentricities(), SgVgosDb::storeErpApriori(), SgVgosDb::storeObsCalFeedCorr(), SgVgosDb::storeObsCalIonGroup(), SgVgosDb::storeObsCalUnphase(), SgVgosDb::storeObsChannelInfo(), SgVgosDb::storeObsCorrelatorInfo(), SgVgosDb::storeObsEffFreqs(), SgVgosDb::storeObsGroupDelays(), SgVgosDb::storeObsPartBend(), SgVgosDb::storeObsPartEOP(), SgVgosDb::storeObsPartGamma(), SgVgosDb::storeObsPartNut2KXY(), SgVgosDb::storeObsPartParallax(), SgVgosDb::storeObsPartPoleTides(), SgVgosDb::storeObsPartRaDec(), SgVgosDb::storeObsPartXYZ(), SgVgosDb::storeObsPhase(), SgVgosDb::storeObsRates(), SgVgosDb::storeObsSingleBandDelays(), SgVgosDb::storeObsStd1Contribution(), SgVgosDb::storeObsStd2Contribution(), SgVgosDb::storeObsUVFperAsec(), SgVgosDb::storeScanEphemeris(), SgVgosDb::storeScanNutationEqx(), SgVgosDb::storeScanNutationEqxWahr(), SgVgosDb::storeScanNutationNro(), SgVgosDb::storeScanTrf2crf(), SgVgosDb::storeSolveWeights(), SgVgosDb::storeSourcesApriories(), SgVgosDb::storeStationAzEl(), SgVgosDb::storeStationCalAxisOffset(), SgVgosDb::storeStationCalCable(), SgVgosDb::storeStationCalOceanLoad(), SgVgosDb::storeStationCalSlantPathTropDry(), SgVgosDb::storeStationCalSlantPathTropWet(), SgVgosDb::storeStationOceanLdDisp(), SgVgosDb::storeStationPartAxisOffset(), SgVgosDb::storeStationPartHorizonGrad(), SgVgosDb::storeStationPartZenithDelayDry(), SgVgosDb::storeStationPartZenithDelayWet(), SgVgosDb::storeStationsApriories(), SgVgosDb::storeStationTsys(), SgEstimator::submittSolution2GlobalStore(), and NsTestDialog::testPlot().

◆ nCol()

◆ nRow()

unsigned int SgMatrix::nRow ( ) const
inline

Returns number of rows in the matrix.

Definition at line 352 of file SgMatrix.h.

References NRow_.

Referenced by SgVlbiSession::allocPxyInterpolValues(), SgVlbiSession::allocUt1InterpolValues(), SgPlotArea::calcLimits(), SgEstimator::calcQForm(), SgEstimator::calculateRRT(), SgAgvDriver::fillSessVars(), SgVlbiSession::getDataFromVgosDb(), SgAgvDriver::initEssentialVars(), operator<<(), SgModelsInfo::prepareUt1InterpData(), SgModelsInfo::prepareWobInterpData(), VcCalc2SessionIfc::put4_ut1Epoch(), VcCalc2SessionIfc::put4_wobEpoch(), SgVlbiSession::putDataIntoVgosDb(), SgSolutionReporter::reportPall(), SgEstimator::solveEquation(), solveEquation(), SgVgosDb::storeAntennaApriories(), SgVgosDb::storeCalcEop(), SgVgosDb::storeCalcInfo(), SgVgosDb::storeClockApriories(), SgVgosDb::storeErpApriori(), SgVgosDb::storeObsCalFeedCorr(), SgVgosDb::storeObsCalUnphase(), SgVgosDb::storeObsEffFreqs(), SgVgosDb::storeObsGroupDelays(), SgVgosDb::storeObsPartBend(), SgVgosDb::storeObsPartEOP(), SgVgosDb::storeObsPartGamma(), SgVgosDb::storeObsPartNut2KXY(), SgVgosDb::storeObsPartParallax(), SgVgosDb::storeObsPartPoleTides(), SgVgosDb::storeObsPartRaDec(), SgVgosDb::storeObsPartXYZ(), SgVgosDb::storeObsPhase(), SgVgosDb::storeObsPhaseCalInfo(), SgVgosDb::storeObsRates(), SgVgosDb::storeObsSingleBandDelays(), SgVgosDb::storeObsStd1Contribution(), SgVgosDb::storeObsStd2Contribution(), SgVgosDb::storeObsUVFperAsec(), SgVgosDb::storeScanEphemeris(), SgVgosDb::storeScanNutationEqx(), SgVgosDb::storeScanNutationEqxWahr(), SgVgosDb::storeScanNutationNro(), SgVgosDb::storeScanTrf2crf(), SgVgosDb::storeSourcesApriories(), SgVgosDb::storeStationAzEl(), SgVgosDb::storeStationCalAxisOffset(), SgVgosDb::storeStationCalCable(), SgVgosDb::storeStationCalOceanLoad(), SgVgosDb::storeStationCalSlantPathTropDry(), SgVgosDb::storeStationCalSlantPathTropWet(), SgVgosDb::storeStationOceanLdDisp(), SgVgosDb::storeStationPartAxisOffset(), SgVgosDb::storeStationPartHorizonGrad(), SgVgosDb::storeStationPartZenithDelayDry(), SgVgosDb::storeStationPartZenithDelayWet(), SgVgosDb::storeStationsApriories(), SgVgosDb::storeStationTsys(), SgUtMatrix::T(), and NsTestDialog::testPlot().

◆ operator!=()

bool SgMatrix::operator!= ( const SgMatrix M) const
inline

Comperes the matrix with another one, returns TRUE if the matrices are different.

Parameters
M– a matrix for comparing.

Definition at line 530 of file SgMatrix.h.

◆ operator()()

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

Returns a reference at (i,j)-th element of the matrix.

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

Definition at line 368 of file SgMatrix.h.

References B_, dTmp_, NCol_, and NRow_.

◆ operator*=()

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

Multiplies the matrix by a scalar.

Parameters
d– a scale.

Definition at line 474 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ operator+=()

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

Increments the matrix by another one.

Parameters
M– a matrix to add.

Definition at line 448 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ operator-=()

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

Decrements the matrix by another one.

Parameters
M– a matrix to substract.

Definition at line 461 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ operator/=()

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

Divides the matrix by a scalar.

Parameters
d– a divider.

Definition at line 487 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ operator=() [1/2]

SgMatrix & SgMatrix::operator= ( const SgMatrix M)

Assign the matrix to the another one.

Parameters
M– a matrix to copy.

Definition at line 39 of file SgMatrix.cpp.

References B_, NCol_, and NRow_.

◆ operator=() [2/2]

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

Fills the matrix with a double.

Parameters
d– a value to fill the matrix.

Definition at line 435 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ operator==()

bool SgMatrix::operator== ( const SgMatrix M) const
inline

Compares the matrix with another one, returns TRUE if the matrices are equal.

Parameters
M– a matrix for comparing.

Definition at line 514 of file SgMatrix.h.

References B_, NCol_, and NRow_.

◆ setElement()

void SgMatrix::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,j)-th element.

Definition at line 402 of file SgMatrix.h.

References B_, NCol_, and NRow_.

Referenced by SgPlotBranch::addDataAttr(), SgVlbiSession::allocPxyInterpolValues(), SgVlbiSession::allocUt1InterpolValues(), NsSessionEditDialog::calcIono(), calcLhv(), SgSolutionReporter::calculateConditionNumber(), NsSessionEditDialog::changeNumOfAmbigSpacing4MarkedPoints(), NsSessionEditDialog::changeNumOfSubAmbig4MarkedPoints(), SgPlotBranch::delDataAttr(), SgVlbiSession::getDataFromDbhImage(), SgVlbiSession::getDataFromVgosDb(), SgAgvDriver::initSession(), SgVgosDb::loadAntennaApriories(), SgVgosDb::loadCalcEop(), SgVgosDb::loadCalcInfo(), SgVgosDb::loadClockApriories(), SgVgosDb::loadEccentricities(), SgVgosDb::loadErpApriori(), SgVgosDb::loadObsCalFeedCorr(), SgVgosDb::loadObsCalHiFyErp(), SgVgosDb::loadObsCalHiFyLibration(), SgVgosDb::loadObsCalIonGroup(), SgVgosDb::loadObsCalUnphase(), SgVgosDb::loadObsCalWobble(), SgVgosDb::loadObsChannelInfoMk3(), SgVgosDb::loadObsChannelInfoMk4(), SgVgosDb::loadObsChannelInfoS2(), SgVgosDb::loadObsCorrelatorInfoCrl(), SgVgosDb::loadObsCorrelatorInfoMk4(), SgVgosDb::loadObsEffFreqs(), SgVgosDb::loadObsGroupDelays(), SgVgosDb::loadObsPartBend(), SgVgosDb::loadObsPartEOP(), SgVgosDb::loadObsPartGamma(), SgVgosDb::loadObsPartNut2KXY(), SgVgosDb::loadObsPartParallax(), SgVgosDb::loadObsPartPoleTides(), SgVgosDb::loadObsPartRaDec(), SgVgosDb::loadObsPartXYZ(), SgVgosDb::loadObsPhase(), SgVgosDb::loadObsPhaseCalInfoMk3(), SgVgosDb::loadObsPhaseCalInfoMk4(), SgVgosDb::loadObsPhaseCalInfoS2(), SgVgosDb::loadObsRates(), SgVgosDb::loadObsSingleBandDelays(), SgVgosDb::loadObsUserCorrections(), SgVgosDb::loadObsUVFperAsec(), SgVgosDb::loadScanEphemeris(), SgVgosDb::loadScanNutationEqx(), SgVgosDb::loadScanNutationEqxWahr(), SgVgosDb::loadScanNutationNro(), SgVgosDb::loadScanTrf2crf(), SgVgosDb::loadSolveWeights(), SgVgosDb::loadSourcesApriories(), SgVgosDb::loadStationAzEl(), SgVgosDb::loadStationCalOceanLoad(), SgVgosDb::loadStationOceanLdDisp(), SgVgosDb::loadStationPartAxisOffset(), SgVgosDb::loadStationPartHorizonGrad(), SgVgosDb::loadStationPartZenithDelayDry(), SgVgosDb::loadStationPartZenithDelayWet(), SgVgosDb::loadStationsApriories(), SgVgosDb::loadStationTsys(), SgVgosDb::loadStdObsCalibration(), SgVlbiSession::prepare4ErpInterpolation(), SgEstimator::processConstraint(), SgVlbiSession::processKombFile(), SgEstimator::processObs(), SgEstimator::propagateStochasticParameters(), SgEstimator::propagateStochasticParameters_th(), VcCalc2SessionIfc::put4_fWobXnYt(), VcCalc2SessionIfc::put4_ut1Epoch(), VcCalc2SessionIfc::put4_wobEpoch(), SgVlbiSession::putDataIntoVgosDb(), SgExternalEopFile::readC04File(), SgExternalEopFile::readErpFile(), SgExternalEopFile::readFinalsFile(), SgSolutionReporter::reportBaselineVariationsBlock_Output4Spoolfile(), SgEstimator::saveProcessedParameters(), SgPlotBranch::setDataAttr(), SgUtMatrix::T(), NsSessionEditDialog::tab4BandPlots(), NsSessionEditDialog::tab4SessionPlot(), NsSessionEditDialog::tab4StationsPlot(), NsTestDialog::testPlot(), NsTestFour1Dialog::testPlot(), NsSessionEditDialog::updateResiduals(), NsSessionEditDialog::updateSessionWideSolutions(), SgPlotBranch::xorDataAttr(), and NsSessionEditDialog::zeroIono().

◆ T()

SgMatrix SgMatrix::T ( ) const
inline

Returns transposed matrix (original matrix doesn't changed).

Definition at line 500 of file SgMatrix.h.

References B_, NCol_, and NRow_.

Friends And Related Function Documentation

◆ calcProduct_mat_x_mat [1/3]

SgMatrix calcProduct_mat_x_mat ( const SgMatrix M1,
const SgMatrix M2 
)
friend

Makes a product of two matrices.

Parameters
M1– a first term in the product;
M2– a second term in the product.

Definition at line 94 of file SgMatrix.cpp.

◆ calcProduct_mat_x_mat [2/3]

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

Definition at line 73 of file SgSymMatrix.cpp.

◆ calcProduct_mat_x_mat [3/3]

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

Definition at line 124 of file SgUtMatrix.cpp.

◆ calcProduct_mat_x_matT

SgMatrix calcProduct_mat_x_matT ( const SgMatrix M1,
const SgMatrix M2 
)
friend

Makes a product of a matrix and a transposed matrix, i.e., M1*M2^T.

Parameters
M1– a matrix, the first term in the product,
M2– a matrix that should be transposed.

Definition at line 165 of file SgMatrix.cpp.

◆ calcProduct_matT_x_mat

SgMatrix calcProduct_matT_x_mat ( const SgMatrix M1,
const SgMatrix M2 
)
friend

Makes a product of a transposed matrix and a matrix, i.e., M1^T*M2.

Parameters
M1– a matrix that should be transposed;
M2– a matrix, the second term in the product.

Definition at line 131 of file SgMatrix.cpp.

◆ calcProduct_matT_x_vec

SgVector calcProduct_matT_x_vec ( const SgMatrix M,
const SgVector V 
)
friend

Makes a product of a transposed matrix and a vector.

Parameters
M– a that should be transposed;
V– a vector.

Definition at line 192 of file SgMatrix.cpp.

◆ operator* [1/3]

SgVector operator* ( const SgMatrix M,
const SgVector V 
)
friend

Makes a product of a matrix and a vector.

Parameters
M– a matrix;
V– a vector.

Definition at line 73 of file SgMatrix.cpp.

◆ operator* [2/3]

SgMatrix operator* ( const SgMatrix M,
double  d 
)
friend

Returns a matrix multiplied by a scalar.

Parameters
M– a matrix;
d– a scale.

Definition at line 559 of file SgMatrix.h.

◆ operator* [3/3]

SgMatrix operator* ( double  d,
const SgMatrix M 
)
friend

Returns a natrix multiplied by a scalar.

Parameters
d– a scale.
M– a matrix;

Definition at line 567 of file SgMatrix.h.

◆ operator+

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

Returns a sum of two matrices.

Parameters
M1is a first term,
M2is a second term in the sum.

Definition at line 575 of file SgMatrix.h.

◆ operator- [1/2]

SgMatrix operator- ( const SgMatrix M)
friend

Returns a matrix with an inverted sign.

Parameters
M– an original matrix.

Definition at line 543 of file SgMatrix.h.

◆ operator- [2/2]

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

Returns a difference of two matrices.

Parameters
M1is a first term,
M2is a second term in the sum.

Definition at line 583 of file SgMatrix.h.

◆ operator/

SgMatrix operator/ ( const SgMatrix M,
double  d 
)
friend

Returns a matrix divided by a scalar.

Parameters
M– a matrix;
d– a divider;

Definition at line 551 of file SgMatrix.h.

Member Data Documentation

◆ B_

◆ dTmp_

double SgMatrix::dTmp_
protected

◆ NCol_

◆ NRow_


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