SAGA API v9.10
Loading...
Searching...
No Matches
CSG_Matrix Class Reference

#include <mat_tools.h>

Public Member Functions

 CSG_Matrix (void)
virtual ~CSG_Matrix (void)
 CSG_Matrix (const CSG_Matrix &Matrix)
bool Create (const CSG_Matrix &Matrix)
 CSG_Matrix (sLong nCols, sLong nRows, const double *Data=NULL)
bool Create (sLong nCols, sLong nRows, const double *Data=NULL)
 CSG_Matrix (sLong nCols, sLong nRows, const double **Data)
bool Create (sLong nCols, sLong nRows, const double **Data)
bool Destroy (void)
bool Set_Size (sLong nRows, sLong nCols)
bool Set_Cols (sLong nCols)
bool Set_Rows (sLong nRows)
bool Add_Cols (sLong nCols)
bool Add_Rows (sLong nRows)
bool Del_Cols (sLong nCols)
bool Del_Rows (sLong nRows)
bool Add_Col (const double *Data=NULL)
bool Add_Col (const CSG_Vector &Data)
bool Add_Row (const double *Data=NULL)
bool Add_Row (const CSG_Vector &Data)
bool Ins_Col (sLong Col, const double *Data=NULL)
bool Ins_Col (sLong Col, const CSG_Vector &Data)
bool Ins_Row (sLong Row, const double *Data=NULL)
bool Ins_Row (sLong Row, const CSG_Vector &Data)
bool Set_Col (sLong Col, const double *Data)
bool Set_Col (sLong Col, const CSG_Vector &Data)
bool Set_Col (const CSG_Vector &Data)
bool Set_Row (sLong Row, const double *Data)
bool Set_Row (sLong Row, const CSG_Vector &Data)
bool Set_Row (const CSG_Vector &Data)
bool Del_Col (sLong Col)
bool Del_Row (sLong Row)
CSG_Vector Get_Col (sLong Col) const
CSG_Vector Get_Row (sLong Row) const
int Get_NX (void) const
int Get_NY (void) const
sLong Get_NCols (void) const
sLong Get_NRows (void) const
 operator const double ** (void) const
double ** Get_Data (void) const
double operator() (sLong Row, sLong Col) const
double * operator[] (sLong Row) const
double * operator[] (size_t Row) const
double * operator[] (int Row) const
CSG_String to_String (int Width=-1, int Precision=-1, bool bScientific=false, const SG_Char *Separator=NULL) const
bool from_String (const CSG_String &String)
bool is_Square (void) const
bool is_Equal (const CSG_Matrix &Matrix) const
bool Assign (double Scalar)
bool Assign (const CSG_Matrix &Matrix)
bool Add (double Scalar)
bool Add (const CSG_Matrix &Matrix)
bool Subtract (const CSG_Matrix &Matrix)
bool Multiply (double Scalar)
CSG_Vector Multiply (const CSG_Vector &Vector) const
CSG_Matrix Multiply (const CSG_Matrix &Matrix) const
bool operator== (const CSG_Matrix &Matrix) const
CSG_Matrixoperator= (double Scalar)
CSG_Matrixoperator= (const CSG_Matrix &Matrix)
CSG_Matrixoperator+= (double Scalar)
CSG_Matrixoperator+= (const CSG_Matrix &Matrix)
CSG_Matrixoperator-= (double Scalar)
CSG_Matrixoperator-= (const CSG_Matrix &Matrix)
CSG_Matrixoperator*= (double Scalar)
CSG_Matrixoperator*= (const CSG_Matrix &Matrix)
CSG_Matrix operator+ (double Scalar) const
CSG_Matrix operator+ (const CSG_Matrix &Matrix) const
CSG_Matrix operator- (double Scalar) const
CSG_Matrix operator- (const CSG_Matrix &Matrix) const
CSG_Matrix operator* (double Scalar) const
CSG_Vector operator* (const CSG_Vector &Vector) const
CSG_Matrix operator* (const CSG_Matrix &Matrix) const
bool Set_Zero (void)
bool Set_Identity (void)
bool Set_Transpose (void)
bool Set_Inverse (bool bSilent=true, int nSubSquare=0)
double Get_Determinant (void) const
CSG_Matrix Get_Transpose (void) const
CSG_Matrix Get_Inverse (bool bSilent=true, int nSubSquare=0) const

Detailed Description

Definition at line 479 of file mat_tools.h.

Constructor & Destructor Documentation

◆ CSG_Matrix() [1/4]

◆ ~CSG_Matrix()

CSG_Matrix::~CSG_Matrix ( void )
virtual

Definition at line 918 of file mat_matrix.cpp.

References Destroy().

◆ CSG_Matrix() [2/4]

CSG_Matrix::CSG_Matrix ( const CSG_Matrix & Matrix)

Definition at line 829 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

◆ CSG_Matrix() [3/4]

CSG_Matrix::CSG_Matrix ( sLong nCols,
sLong nRows,
const double * Data = NULL )

Definition at line 842 of file mat_matrix.cpp.

References Create().

◆ CSG_Matrix() [4/4]

CSG_Matrix::CSG_Matrix ( sLong nCols,
sLong nRows,
const double ** Data )

Definition at line 892 of file mat_matrix.cpp.

References Create().

Member Function Documentation

◆ Add() [1/2]

bool CSG_Matrix::Add ( const CSG_Matrix & Matrix)

Definition at line 1467 of file mat_matrix.cpp.

References CSG_Matrix().

◆ Add() [2/2]

bool CSG_Matrix::Add ( double Scalar)

Definition at line 1448 of file mat_matrix.cpp.

Referenced by operator+(), operator+(), operator+=(), operator+=(), operator-(), and operator-=().

◆ Add_Col() [1/2]

bool CSG_Matrix::Add_Col ( const CSG_Vector & Data)

◆ Add_Col() [2/2]

bool CSG_Matrix::Add_Col ( const double * Data = NULL)

Definition at line 1077 of file mat_matrix.cpp.

References Add_Cols(), and Set_Col().

Referenced by Add_Col(), and Ins_Col().

◆ Add_Cols()

bool CSG_Matrix::Add_Cols ( sLong nCols)

Definition at line 990 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

Referenced by CSG_Regression_Multiple::_Get_Step_In(), Add_Col(), and Set_Cols().

◆ Add_Row() [1/2]

bool CSG_Matrix::Add_Row ( const CSG_Vector & Data)

◆ Add_Row() [2/2]

bool CSG_Matrix::Add_Row ( const double * Data = NULL)

Definition at line 1100 of file mat_matrix.cpp.

References Add_Rows(), and Set_Row().

Referenced by Add_Row(), from_String(), CSG_Regression_Multiple::Get_CrossValidation(), and Ins_Row().

◆ Add_Rows()

bool CSG_Matrix::Add_Rows ( sLong nRows)

Definition at line 1011 of file mat_matrix.cpp.

References SG_Realloc().

Referenced by Add_Row(), and Set_Rows().

◆ Assign() [1/2]

bool CSG_Matrix::Assign ( const CSG_Matrix & Matrix)

Definition at line 1442 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

◆ Assign() [2/2]

bool CSG_Matrix::Assign ( double Scalar)

Definition at line 1423 of file mat_matrix.cpp.

Referenced by operator=(), and operator=().

◆ Create() [1/3]

◆ Create() [2/3]

bool CSG_Matrix::Create ( sLong nCols,
sLong nRows,
const double ** Data )

Definition at line 899 of file mat_matrix.cpp.

References Create().

◆ Create() [3/3]

bool CSG_Matrix::Create ( sLong nCols,
sLong nRows,
const double * Data = NULL )

Definition at line 849 of file mat_matrix.cpp.

References Destroy(), and SG_Malloc().

◆ Del_Col()

bool CSG_Matrix::Del_Col ( sLong Col)

◆ Del_Cols()

bool CSG_Matrix::Del_Cols ( sLong nCols)

Deletes the last nCols columns.

Definition at line 1037 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

Referenced by Set_Cols().

◆ Del_Row()

bool CSG_Matrix::Del_Row ( sLong Row)

Definition at line 1285 of file mat_matrix.cpp.

References Create(), CSG_Matrix(), and Destroy().

Referenced by CSG_Regression_Multiple::Get_CrossValidation().

◆ Del_Rows()

bool CSG_Matrix::Del_Rows ( sLong nRows)

Deletes the last nRows rows.

Definition at line 1061 of file mat_matrix.cpp.

References SG_Realloc().

Referenced by Set_Rows().

◆ Destroy()

bool CSG_Matrix::Destroy ( void )

Definition at line 923 of file mat_matrix.cpp.

References SG_Free().

Referenced by Create(), Del_Col(), Del_Row(), from_String(), and ~CSG_Matrix().

◆ from_String()

◆ Get_Col()

CSG_Vector CSG_Matrix::Get_Col ( sLong Col) const

Definition at line 1314 of file mat_matrix.cpp.

References CSG_Vector::Create().

Referenced by CSG_Regression_Multiple::_Get_Step_In().

◆ Get_Data()

double ** CSG_Matrix::Get_Data ( void ) const
inline

◆ Get_Determinant()

double CSG_Matrix::Get_Determinant ( void ) const

◆ Get_Inverse()

CSG_Matrix CSG_Matrix::Get_Inverse ( bool bSilent = true,
int nSubSquare = 0 ) const

◆ Get_NCols()

sLong CSG_Matrix::Get_NCols ( void ) const
inline

◆ Get_NRows()

◆ Get_NX()

◆ Get_NY()

◆ Get_Row()

CSG_Vector CSG_Matrix::Get_Row ( sLong Row) const

Definition at line 1332 of file mat_matrix.cpp.

References CSG_Vector::Create().

Referenced by CSG_Regression_Weighted::Calculate().

◆ Get_Transpose()

CSG_Matrix CSG_Matrix::Get_Transpose ( void ) const

◆ Ins_Col() [1/2]

bool CSG_Matrix::Ins_Col ( sLong Col,
const CSG_Vector & Data )

Definition at line 1155 of file mat_matrix.cpp.

References Add_Col(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Ins_Col().

◆ Ins_Col() [2/2]

bool CSG_Matrix::Ins_Col ( sLong Col,
const double * Data = NULL )

Definition at line 1123 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

Referenced by Ins_Col().

◆ Ins_Row() [1/2]

bool CSG_Matrix::Ins_Row ( sLong Row,
const CSG_Vector & Data )

Definition at line 1188 of file mat_matrix.cpp.

References Add_Row(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Ins_Row().

◆ Ins_Row() [2/2]

bool CSG_Matrix::Ins_Row ( sLong Row,
const double * Data = NULL )

Definition at line 1161 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

Referenced by Ins_Row().

◆ is_Equal()

bool CSG_Matrix::is_Equal ( const CSG_Matrix & Matrix) const

Definition at line 1404 of file mat_matrix.cpp.

References CSG_Matrix().

Referenced by operator==().

◆ is_Square()

bool CSG_Matrix::is_Square ( void ) const
inline

Definition at line 538 of file mat_tools.h.

Referenced by Get_Determinant(), CSG_Classifier_Supervised::Load(), and Set_Inverse().

◆ Multiply() [1/3]

CSG_Matrix CSG_Matrix::Multiply ( const CSG_Matrix & Matrix) const

Definition at line 1545 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

◆ Multiply() [2/3]

CSG_Vector CSG_Matrix::Multiply ( const CSG_Vector & Vector) const

Definition at line 1523 of file mat_matrix.cpp.

References CSG_Vector::Create(), and CSG_Vector::Get_Size().

◆ Multiply() [3/3]

bool CSG_Matrix::Multiply ( double Scalar)

◆ operator const double **()

CSG_Matrix::operator const double ** ( void ) const
inline

Definition at line 527 of file mat_tools.h.

◆ operator()()

double CSG_Matrix::operator() ( sLong Row,
sLong Col ) const
inline

Definition at line 530 of file mat_tools.h.

◆ operator*() [1/3]

CSG_Matrix CSG_Matrix::operator* ( const CSG_Matrix & Matrix) const

Definition at line 1694 of file mat_matrix.cpp.

References CSG_Matrix(), and Multiply().

◆ operator*() [2/3]

CSG_Vector CSG_Matrix::operator* ( const CSG_Vector & Vector) const

Definition at line 1689 of file mat_matrix.cpp.

References Multiply().

◆ operator*() [3/3]

CSG_Matrix CSG_Matrix::operator* ( double Scalar) const

Definition at line 1680 of file mat_matrix.cpp.

References CSG_Matrix(), and Multiply().

◆ operator*=() [1/2]

CSG_Matrix & CSG_Matrix::operator*= ( const CSG_Matrix & Matrix)

Definition at line 1634 of file mat_matrix.cpp.

References CSG_Matrix(), and Multiply().

◆ operator*=() [2/2]

CSG_Matrix & CSG_Matrix::operator*= ( double Scalar)

Definition at line 1627 of file mat_matrix.cpp.

References CSG_Matrix(), and Multiply().

◆ operator+() [1/2]

CSG_Matrix CSG_Matrix::operator+ ( const CSG_Matrix & Matrix) const

Definition at line 1651 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator+() [2/2]

CSG_Matrix CSG_Matrix::operator+ ( double Scalar) const

Definition at line 1642 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator+=() [1/2]

CSG_Matrix & CSG_Matrix::operator+= ( const CSG_Matrix & Matrix)

Definition at line 1604 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator+=() [2/2]

CSG_Matrix & CSG_Matrix::operator+= ( double Scalar)

Definition at line 1597 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator-() [1/2]

CSG_Matrix CSG_Matrix::operator- ( const CSG_Matrix & Matrix) const

Definition at line 1670 of file mat_matrix.cpp.

References CSG_Matrix(), and Subtract().

◆ operator-() [2/2]

CSG_Matrix CSG_Matrix::operator- ( double Scalar) const

Definition at line 1661 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator-=() [1/2]

CSG_Matrix & CSG_Matrix::operator-= ( const CSG_Matrix & Matrix)

Definition at line 1619 of file mat_matrix.cpp.

References CSG_Matrix(), and Subtract().

◆ operator-=() [2/2]

CSG_Matrix & CSG_Matrix::operator-= ( double Scalar)

Definition at line 1612 of file mat_matrix.cpp.

References Add(), and CSG_Matrix().

◆ operator=() [1/2]

CSG_Matrix & CSG_Matrix::operator= ( const CSG_Matrix & Matrix)

Definition at line 1589 of file mat_matrix.cpp.

References Assign(), and CSG_Matrix().

◆ operator=() [2/2]

CSG_Matrix & CSG_Matrix::operator= ( double Scalar)

Definition at line 1582 of file mat_matrix.cpp.

References Assign(), and CSG_Matrix().

◆ operator==()

bool CSG_Matrix::operator== ( const CSG_Matrix & Matrix) const

Definition at line 1576 of file mat_matrix.cpp.

References CSG_Matrix(), and is_Equal().

◆ operator[]() [1/3]

double * CSG_Matrix::operator[] ( int Row) const
inline

Definition at line 533 of file mat_tools.h.

◆ operator[]() [2/3]

double * CSG_Matrix::operator[] ( size_t Row) const
inline

Definition at line 532 of file mat_tools.h.

◆ operator[]() [3/3]

double * CSG_Matrix::operator[] ( sLong Row) const
inline

Definition at line 531 of file mat_tools.h.

◆ Set_Col() [1/3]

bool CSG_Matrix::Set_Col ( const CSG_Vector & Data)

Sets matrix size to one column with vector's data as row.

Definition at line 1218 of file mat_matrix.cpp.

References Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().

◆ Set_Col() [2/3]

bool CSG_Matrix::Set_Col ( sLong Col,
const CSG_Vector & Data )

Definition at line 1209 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().

◆ Set_Col() [3/3]

bool CSG_Matrix::Set_Col ( sLong Col,
const double * Data )

◆ Set_Cols()

bool CSG_Matrix::Set_Cols ( sLong nCols)

Definition at line 958 of file mat_matrix.cpp.

References Add_Cols(), and Del_Cols().

Referenced by Set_Size().

◆ Set_Identity()

bool CSG_Matrix::Set_Identity ( void )

Definition at line 1716 of file mat_matrix.cpp.

◆ Set_Inverse()

bool CSG_Matrix::Set_Inverse ( bool bSilent = true,
int nSubSquare = 0 )

◆ Set_Row() [1/3]

bool CSG_Matrix::Set_Row ( const CSG_Vector & Data)

Sets matrix size to one row with vector's data as column.

Definition at line 1245 of file mat_matrix.cpp.

References Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().

◆ Set_Row() [2/3]

bool CSG_Matrix::Set_Row ( sLong Row,
const CSG_Vector & Data )

Definition at line 1236 of file mat_matrix.cpp.

References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().

◆ Set_Row() [3/3]

bool CSG_Matrix::Set_Row ( sLong Row,
const double * Data )

Definition at line 1224 of file mat_matrix.cpp.

Referenced by Add_Row(), Add_Row(), Set_Row(), and Set_Row().

◆ Set_Rows()

bool CSG_Matrix::Set_Rows ( sLong nRows)

Definition at line 974 of file mat_matrix.cpp.

References Add_Rows(), and Del_Rows().

Referenced by Set_Size().

◆ Set_Size()

bool CSG_Matrix::Set_Size ( sLong nRows,
sLong nCols )

Definition at line 952 of file mat_matrix.cpp.

References Set_Cols(), and Set_Rows().

◆ Set_Transpose()

bool CSG_Matrix::Set_Transpose ( void )

Definition at line 1735 of file mat_matrix.cpp.

References Create(), and CSG_Matrix().

◆ Set_Zero()

bool CSG_Matrix::Set_Zero ( void )

Definition at line 1710 of file mat_matrix.cpp.

References Create().

◆ Subtract()

bool CSG_Matrix::Subtract ( const CSG_Matrix & Matrix)

Definition at line 1486 of file mat_matrix.cpp.

References CSG_Matrix().

Referenced by operator-(), and operator-=().

◆ to_String()

CSG_String CSG_Matrix::to_String ( int Width = -1,
int Precision = -1,
bool bScientific = false,
const SG_Char * Separator = NULL ) const

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