SAGA API
v9.6
|
#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_Matrix & | operator= (double Scalar) |
CSG_Matrix & | operator= (const CSG_Matrix &Matrix) |
CSG_Matrix & | operator+= (double Scalar) |
CSG_Matrix & | operator+= (const CSG_Matrix &Matrix) |
CSG_Matrix & | operator-= (double Scalar) |
CSG_Matrix & | operator-= (const CSG_Matrix &Matrix) |
CSG_Matrix & | operator*= (double Scalar) |
CSG_Matrix & | operator*= (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 |
Definition at line 477 of file mat_tools.h.
CSG_Matrix::CSG_Matrix | ( | void | ) |
Definition at line 823 of file mat_matrix.cpp.
|
virtual |
Definition at line 918 of file mat_matrix.cpp.
References Destroy().
CSG_Matrix::CSG_Matrix | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 829 of file mat_matrix.cpp.
References Create().
Definition at line 842 of file mat_matrix.cpp.
References Create().
Definition at line 892 of file mat_matrix.cpp.
References Create().
bool CSG_Matrix::Add | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1467 of file mat_matrix.cpp.
bool CSG_Matrix::Add | ( | double | Scalar | ) |
Definition at line 1448 of file mat_matrix.cpp.
Referenced by operator+(), operator+=(), operator-(), and operator-=().
bool CSG_Matrix::Add_Col | ( | const CSG_Vector & | Data | ) |
Definition at line 1089 of file mat_matrix.cpp.
References Add_Col(), Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Col().
bool CSG_Matrix::Add_Col | ( | const double * | Data = NULL | ) |
Definition at line 1077 of file mat_matrix.cpp.
References Add_Cols(), and Set_Col().
bool CSG_Matrix::Add_Cols | ( | sLong | nCols | ) |
Definition at line 990 of file mat_matrix.cpp.
References Create().
Referenced by CSG_Regression_Multiple::_Get_Step_In(), Add_Col(), and Set_Cols().
bool CSG_Matrix::Add_Row | ( | const CSG_Vector & | Data | ) |
Definition at line 1112 of file mat_matrix.cpp.
References Add_Row(), Create(), CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and Set_Row().
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(), CSG_Regression_Weighted::Add_Sample(), from_String(), CSG_Regression_Multiple::Get_CrossValidation(), and Ins_Row().
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().
bool CSG_Matrix::Assign | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1442 of file mat_matrix.cpp.
References Create().
bool CSG_Matrix::Assign | ( | double | Scalar | ) |
Definition at line 1423 of file mat_matrix.cpp.
Referenced by operator=().
bool CSG_Matrix::Create | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 836 of file mat_matrix.cpp.
Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Initialize(), Add_Col(), Add_Cols(), Add_Row(), CSG_Regression_Weighted::Add_Sample(), Assign(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Thin_Plate_Spline::Create(), Create(), CSG_Matrix(), Del_Col(), Del_Cols(), Del_Row(), CSG_Cluster_Analysis::Execute(), CSG_Trend_Polynom::Get_Trend(), Ins_Col(), Ins_Row(), Multiply(), Set_Col(), Set_Row(), Set_Transpose(), and Set_Zero().
Definition at line 899 of file mat_matrix.cpp.
References Create().
Definition at line 849 of file mat_matrix.cpp.
References Destroy(), and SG_Malloc().
bool CSG_Matrix::Del_Col | ( | sLong | Col | ) |
Definition at line 1251 of file mat_matrix.cpp.
References Create(), and Destroy().
Referenced by CSG_Regression_Multiple::_Get_Step_In(), and CSG_Regression_Multiple::_Get_Step_Out().
bool CSG_Matrix::Del_Cols | ( | sLong | nCols | ) |
Deletes the last nCols columns.
Definition at line 1037 of file mat_matrix.cpp.
References Create().
Referenced by Set_Cols().
bool CSG_Matrix::Del_Row | ( | sLong | Row | ) |
Definition at line 1285 of file mat_matrix.cpp.
References Create(), and Destroy().
Referenced by CSG_Regression_Multiple::Get_CrossValidation().
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().
bool CSG_Matrix::Destroy | ( | void | ) |
Definition at line 923 of file mat_matrix.cpp.
References SG_Free().
Referenced by Create(), Del_Col(), Del_Row(), CSG_Cluster_Analysis::Destroy(), CSG_Regression_Multiple::Destroy(), CSG_Regression_Weighted::Destroy(), CSG_KDTree::Destroy(), from_String(), and ~CSG_Matrix().
bool CSG_Matrix::from_String | ( | const CSG_String & | String | ) |
Definition at line 1372 of file mat_matrix.cpp.
References Add_Row(), CSG_Vector::Add_Row(), CSG_String::AfterFirst(), CSG_String::asDouble(), Destroy(), CSG_String_Tokenizer::Get_Next_Token(), Get_NRows(), and CSG_String_Tokenizer::Has_More_Tokens().
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(), and CSG_Regression_Multiple::_Initialize().
|
inline |
Definition at line 526 of file mat_tools.h.
Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), Get_Determinant(), CSG_KDTree_2D::Get_Nearest_Value(), CSG_KDTree_3D::Get_Nearest_Value(), Set_Inverse(), and SG_Matrix_Solve().
double CSG_Matrix::Get_Determinant | ( | void | ) | const |
Definition at line 1806 of file mat_matrix.cpp.
References CSG_Array::Get_Array(), Get_Data(), Get_NX(), is_Square(), and SG_Matrix_LU_Decomposition().
Referenced by CSG_Classifier_Supervised::Add_Class().
CSG_Matrix CSG_Matrix::Get_Inverse | ( | bool | bSilent = true , |
int | nSubSquare = 0 |
||
) | const |
Definition at line 1845 of file mat_matrix.cpp.
References Set_Inverse().
Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Classifier_Supervised::Add_Class().
|
inline |
Definition at line 522 of file mat_tools.h.
Referenced by CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Add_Sample(), CSG_Regression_Weighted::Calculate(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), CSG_Regression_Multiple::Get_CrossValidation(), and CSG_Regression_Multiple::Set_Data().
|
inline |
Definition at line 523 of file mat_tools.h.
Referenced by CSG_Regression_Multiple::_Set_Step_Info(), CSG_Classifier_Supervised::Add_Class(), CSG_Regression_Weighted::Add_Sample(), CSG_Regression_Weighted::Calculate(), CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), from_String(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Regression_Multiple::Get_Residual(), and CSG_Regression_Multiple::Get_Residuals().
|
inline |
Definition at line 520 of file mat_tools.h.
Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Initialize(), Get_Determinant(), CSG_Regression_Multiple::Set_Data(), SG_Get_Correlation_Matrix(), SG_Matrix_Solve(), and SG_Matrix_Tridiagonal_QL().
|
inline |
Definition at line 521 of file mat_tools.h.
Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Get_Step_Out(), CSG_Regression_Multiple::_Initialize(), CSG_Regression_Multiple::_Set_Step_Info(), CSG_Regression_Multiple::Set_Data(), SG_Get_Correlation_Matrix(), SG_Matrix_Solve(), and SG_Matrix_Tridiagonal_QL().
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().
CSG_Matrix CSG_Matrix::Get_Transpose | ( | void | ) | const |
Definition at line 1829 of file mat_matrix.cpp.
Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_TIN_Triangle::Get_Value().
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().
bool CSG_Matrix::Ins_Col | ( | sLong | Col, |
const double * | Data = NULL |
||
) |
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().
bool CSG_Matrix::Ins_Row | ( | sLong | Row, |
const double * | Data = NULL |
||
) |
bool CSG_Matrix::is_Equal | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1404 of file mat_matrix.cpp.
Referenced by operator==().
|
inline |
Definition at line 536 of file mat_tools.h.
Referenced by Get_Determinant(), and Set_Inverse().
CSG_Matrix CSG_Matrix::Multiply | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1545 of file mat_matrix.cpp.
References Create().
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().
bool CSG_Matrix::Multiply | ( | double | Scalar | ) |
Definition at line 1505 of file mat_matrix.cpp.
Referenced by CSG_Vector::Multiply(), operator*(), and operator*=().
|
inline |
Definition at line 525 of file mat_tools.h.
Definition at line 528 of file mat_tools.h.
CSG_Matrix CSG_Matrix::operator* | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1694 of file mat_matrix.cpp.
References Multiply().
CSG_Vector CSG_Matrix::operator* | ( | const CSG_Vector & | Vector | ) | const |
Definition at line 1689 of file mat_matrix.cpp.
References Multiply().
CSG_Matrix CSG_Matrix::operator* | ( | double | Scalar | ) | const |
Definition at line 1680 of file mat_matrix.cpp.
References Multiply().
CSG_Matrix & CSG_Matrix::operator*= | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1634 of file mat_matrix.cpp.
References Multiply().
CSG_Matrix & CSG_Matrix::operator*= | ( | double | Scalar | ) |
Definition at line 1627 of file mat_matrix.cpp.
References Multiply().
CSG_Matrix CSG_Matrix::operator+ | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1651 of file mat_matrix.cpp.
References Add().
CSG_Matrix CSG_Matrix::operator+ | ( | double | Scalar | ) | const |
Definition at line 1642 of file mat_matrix.cpp.
References Add().
CSG_Matrix & CSG_Matrix::operator+= | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1604 of file mat_matrix.cpp.
References Add().
CSG_Matrix & CSG_Matrix::operator+= | ( | double | Scalar | ) |
Definition at line 1597 of file mat_matrix.cpp.
References Add().
CSG_Matrix CSG_Matrix::operator- | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1670 of file mat_matrix.cpp.
References Subtract().
CSG_Matrix CSG_Matrix::operator- | ( | double | Scalar | ) | const |
Definition at line 1661 of file mat_matrix.cpp.
References Add().
CSG_Matrix & CSG_Matrix::operator-= | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1619 of file mat_matrix.cpp.
References Subtract().
CSG_Matrix & CSG_Matrix::operator-= | ( | double | Scalar | ) |
Definition at line 1612 of file mat_matrix.cpp.
References Add().
CSG_Matrix & CSG_Matrix::operator= | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1589 of file mat_matrix.cpp.
References Assign().
CSG_Matrix & CSG_Matrix::operator= | ( | double | Scalar | ) |
Definition at line 1582 of file mat_matrix.cpp.
References Assign().
bool CSG_Matrix::operator== | ( | const CSG_Matrix & | Matrix | ) | const |
Definition at line 1576 of file mat_matrix.cpp.
References is_Equal().
|
inline |
Definition at line 531 of file mat_tools.h.
|
inline |
Definition at line 530 of file mat_tools.h.
|
inline |
Definition at line 529 of file mat_tools.h.
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().
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().
bool CSG_Matrix::Set_Col | ( | sLong | Col, |
const double * | Data | ||
) |
Definition at line 1194 of file mat_matrix.cpp.
Referenced by CSG_Regression_Multiple::_Get_Step_In(), CSG_Regression_Multiple::_Initialize(), Add_Col(), and Set_Col().
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().
bool CSG_Matrix::Set_Identity | ( | void | ) |
Definition at line 1716 of file mat_matrix.cpp.
bool CSG_Matrix::Set_Inverse | ( | bool | bSilent = true , |
int | nSubSquare = 0 |
||
) |
Definition at line 1756 of file mat_matrix.cpp.
References CSG_Array::Get_Array(), CSG_Vector::Get_Data(), Get_Data(), is_Square(), CSG_Vector::Set_Zero(), SG_Matrix_LU_Decomposition(), SG_Matrix_LU_Solve(), and SG_UI_Process_Set_Progress().
Referenced by Get_Inverse().
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().
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().
bool CSG_Matrix::Set_Row | ( | sLong | Row, |
const double * | Data | ||
) |
Definition at line 1224 of file mat_matrix.cpp.
bool CSG_Matrix::Set_Rows | ( | sLong | nRows | ) |
Definition at line 974 of file mat_matrix.cpp.
References Add_Rows(), and Del_Rows().
Referenced by CSG_KDTree_2D::Create(), CSG_KDTree_3D::Create(), and Set_Size().
Definition at line 952 of file mat_matrix.cpp.
References Set_Cols(), and Set_Rows().
bool CSG_Matrix::Set_Transpose | ( | void | ) |
Definition at line 1735 of file mat_matrix.cpp.
References Create().
bool CSG_Matrix::Set_Zero | ( | void | ) |
Definition at line 1710 of file mat_matrix.cpp.
References Create().
bool CSG_Matrix::Subtract | ( | const CSG_Matrix & | Matrix | ) |
Definition at line 1486 of file mat_matrix.cpp.
Referenced by operator-(), and operator-=().
CSG_String CSG_Matrix::to_String | ( | int | Width = -1 , |
int | Precision = -1 , |
||
bool | bScientific = false , |
||
const SG_Char * | Separator = NULL |
||
) | const |
Definition at line 1350 of file mat_matrix.cpp.
References CSG_String::Format(), SG_Get_Digit_Count(), SG_Get_Double_asString(), and SG_T.