SAGA API
v9.6
|
#include "geo_tools.h"
Go to the source code of this file.
Classes | |
class | CSG_Index |
class | CSG_Index::CSG_Index_Compare |
class | CSG_PriorityQueue |
class | CSG_PriorityQueue::CSG_PriorityQueueItem |
class | CSG_Vector |
class | CSG_Matrix |
class | CSG_Grid_Radius |
class | CSG_Random |
class | CSG_Simple_Statistics |
class | CSG_Unique_Value_Statistics |
class | CSG_Unique_Number_Statistics |
class | CSG_Unique_String_Statistics |
class | CSG_Category_Statistics |
class | CSG_Histogram |
class | CSG_Natural_Breaks |
class | CSG_Cluster_Analysis |
class | CSG_Classifier_Supervised |
class | CSG_Spline |
class | CSG_Thin_Plate_Spline |
class | CSG_Test_Distribution |
class | CSG_Regression |
class | CSG_Regression_Multiple |
class | CSG_Regression_Weighted |
class | CSG_Formula |
struct | CSG_Formula::SSG_Function |
class | CSG_Trend |
class | CSG_Trend_Polynom |
Macros | |
#define | M_PI 3.141592653589793 |
#define | M_PI_045 (M_PI / 4.) |
#define | M_PI_090 (M_PI / 2.) |
#define | M_PI_135 (M_PI * 3. / 4.) |
#define | M_PI_180 (M_PI) |
#define | M_PI_225 (M_PI * 5. / 4.) |
#define | M_PI_270 (M_PI * 3. / 2.) |
#define | M_PI_315 (M_PI * 7. / 4.) |
#define | M_PI_360 (M_PI * 2.) |
#define | M_RAD_TO_DEG (180. / M_PI) |
#define | M_DEG_TO_RAD (M_PI / 180.) |
#define | M_EULER 2.718281828459045 |
#define | N_MEGABYTE_BYTES 0x100000 |
#define | M_FLT_EPSILON 1.192092896e-07F |
#define | M_DBL_EPSILON 2.2204460492503131e-016 |
#define | M_ALMOST_ZERO (1.e-03) |
#define | M_TINY (1.e-20) |
#define | M_SQR(x) ((x) * (x)) |
#define | M_SQRT(x) sqrt((double)(x)) |
#define | M_GET_LENGTH(x, y) sqrt((double)((x)*(x) + (y)*(y))) |
#define | M_GET_MIN(a, b) (((a) < (b)) ? (a) : (b)) |
#define | M_GET_MAX(a, b) (((a) > (b)) ? (a) : (b)) |
#define | M_SET_MINMAX(min, max, x) if( min > x ) { min = x; } else if( max < x ) { max = x; } |
#define | M_SET_SIGN(x, sign) ((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x)) |
#define | M_HAS_DECIMALS(x) (x - floor(x) > 0.) |
#define | SG_ROUND_TO_BYTE(x) ((BYTE )(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_CHAR(x) ((char )(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_WORD(x) ((WORD )(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_SHORT(x) ((short)(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_DWORD(x) ((DWORD)(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_INT(x) ((int )(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_LONG(x) ((long )(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_ULONG(x) ((uLong)(x < 0. ? x - 0.5 : x + 0.5)) |
#define | SG_ROUND_TO_SLONG(x) ((sLong)(x < 0. ? x - 0.5 : x + 0.5)) |
Typedefs | |
typedef int(* | TSG_PFNC_Compare) (const sLong a, const sLong b) |
typedef double(* | TSG_Formula_Function_0) (void) |
typedef double(* | TSG_Formula_Function_1) (double) |
typedef double(* | TSG_Formula_Function_2) (double, double) |
typedef double(* | TSG_Formula_Function_3) (double, double, double) |
Functions | |
SAGA_API_DLL_EXPORT double | SG_Get_Square (double Value) |
SAGA_API_DLL_EXPORT double | SG_Get_Rounded (double Value, int Decimals=0) |
SAGA_API_DLL_EXPORT double | SG_Get_Rounded_To_SignificantFigures (double Value, int Decimals) |
SAGA_API_DLL_EXPORT int | SG_Get_Digit_Count (int Number) |
SAGA_API_DLL_EXPORT CSG_String | SG_Get_Double_asString (double Number, int Width=-1, int Precision=-1, bool bScientific=false) |
SAGA_API_DLL_EXPORT int | SG_Compare_Int (const void *a, const void *b) |
SAGA_API_DLL_EXPORT int | SG_Compare_Double (const void *a, const void *b) |
SAGA_API_DLL_EXPORT int | SG_Compare_Char_Ptr (const void *a, const void *b) |
SAGA_API_DLL_EXPORT double | SG_Degree_To_Decimal (double Deg, double Min, double Sec) |
SAGA_API_DLL_EXPORT void | SG_Decimal_To_Degree (double Value, double &Deg, double &Min, double &Sec) |
SAGA_API_DLL_EXPORT CSG_Vector | operator* (double Scalar, const CSG_Vector &Vector) |
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (double &x, double &y, double Angle) |
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (double Vector[2], double Angle) |
SAGA_API_DLL_EXPORT bool | SG_VectorR2_Rotate (CSG_Vector &Vector, double Angle) |
SAGA_API_DLL_EXPORT bool | SG_VectorR3_Rotate (double Vector[3], size_t Axis, double Angle) |
SAGA_API_DLL_EXPORT bool | SG_VectorR3_Rotate (CSG_Vector &Vector, size_t Axis, double Angle) |
SAGA_API_DLL_EXPORT CSG_Matrix | operator* (double Scalar, const CSG_Matrix &Matrix) |
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Matrix_Get_Rotation (double R, bool bDegree=false) |
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Matrix_Get_Rotation (double Rx, double Ry, double Rz, bool bDegree=false) |
SAGA_API_DLL_EXPORT bool | SG_Matrix_LU_Decomposition (int n, int *Permutation, double **Matrix, bool bSilent=true, int *nRowChanges=NULL) |
SAGA_API_DLL_EXPORT bool | SG_Matrix_LU_Solve (int n, const int *Permutation, const double **Matrix, double *Vector, bool bSilent=true) |
SAGA_API_DLL_EXPORT bool | SG_Matrix_Solve (CSG_Matrix &Matrix, CSG_Vector &Vector, bool bSilent=true) |
SAGA_API_DLL_EXPORT bool | SG_Matrix_Eigen_Reduction (const CSG_Matrix &Matrix, CSG_Matrix &Eigen_Vectors, CSG_Vector &Eigen_Values, bool bSilent=true) |
SAGA_API_DLL_EXPORT CSG_Matrix | SG_Get_Correlation_Matrix (const CSG_Matrix &Values, bool bCovariances=false) |
SAGA_API_DLL_EXPORT double | SG_Regression_Get_Adjusted_R2 (double R2, int nSamples, int nPredictors, TSG_Regression_Correction Correction=REGRESSION_CORR_Wherry_1) |
A set of basic mathematical, numerical, statistical tools.
Definition in file mat_tools.h.
#define M_ALMOST_ZERO (1.e-03) |
Definition at line 131 of file mat_tools.h.
#define M_DBL_EPSILON 2.2204460492503131e-016 |
Definition at line 127 of file mat_tools.h.
#define M_DEG_TO_RAD (M_PI / 180.) |
Definition at line 109 of file mat_tools.h.
#define M_EULER 2.718281828459045 |
Definition at line 112 of file mat_tools.h.
#define M_FLT_EPSILON 1.192092896e-07F |
Definition at line 121 of file mat_tools.h.
#define M_GET_LENGTH | ( | x, | |
y | |||
) | sqrt((double)((x)*(x) + (y)*(y))) |
Definition at line 139 of file mat_tools.h.
#define M_GET_MAX | ( | a, | |
b | |||
) | (((a) > (b)) ? (a) : (b)) |
Definition at line 142 of file mat_tools.h.
#define M_GET_MIN | ( | a, | |
b | |||
) | (((a) < (b)) ? (a) : (b)) |
Definition at line 141 of file mat_tools.h.
#define M_HAS_DECIMALS | ( | x | ) | (x - floor(x) > 0.) |
Definition at line 147 of file mat_tools.h.
#define M_PI 3.141592653589793 |
Definition at line 96 of file mat_tools.h.
#define M_PI_045 (M_PI / 4.) |
Definition at line 99 of file mat_tools.h.
#define M_PI_090 (M_PI / 2.) |
Definition at line 100 of file mat_tools.h.
#define M_PI_135 (M_PI * 3. / 4.) |
Definition at line 101 of file mat_tools.h.
#define M_PI_180 (M_PI) |
Definition at line 102 of file mat_tools.h.
#define M_PI_225 (M_PI * 5. / 4.) |
Definition at line 103 of file mat_tools.h.
#define M_PI_270 (M_PI * 3. / 2.) |
Definition at line 104 of file mat_tools.h.
#define M_PI_315 (M_PI * 7. / 4.) |
Definition at line 105 of file mat_tools.h.
#define M_PI_360 (M_PI * 2.) |
Definition at line 106 of file mat_tools.h.
#define M_RAD_TO_DEG (180. / M_PI) |
Definition at line 108 of file mat_tools.h.
#define M_SET_MINMAX | ( | min, | |
max, | |||
x | |||
) | if( min > x ) { min = x; } else if( max < x ) { max = x; } |
Definition at line 143 of file mat_tools.h.
#define M_SET_SIGN | ( | x, | |
sign | |||
) | ((sign) < 0 ? (x < 0 ? x : -x) : (x > 0 ? x : -x)) |
Definition at line 145 of file mat_tools.h.
#define M_SQR | ( | x | ) | ((x) * (x)) |
Definition at line 137 of file mat_tools.h.
#define M_SQRT | ( | x | ) | sqrt((double)(x)) |
Definition at line 138 of file mat_tools.h.
#define M_TINY (1.e-20) |
Definition at line 132 of file mat_tools.h.
#define N_MEGABYTE_BYTES 0x100000 |
Definition at line 115 of file mat_tools.h.
#define SG_ROUND_TO_BYTE | ( | x | ) | ((BYTE )(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 150 of file mat_tools.h.
#define SG_ROUND_TO_CHAR | ( | x | ) | ((char )(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 151 of file mat_tools.h.
#define SG_ROUND_TO_DWORD | ( | x | ) | ((DWORD)(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 154 of file mat_tools.h.
#define SG_ROUND_TO_INT | ( | x | ) | ((int )(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 155 of file mat_tools.h.
#define SG_ROUND_TO_LONG | ( | x | ) | ((long )(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 156 of file mat_tools.h.
#define SG_ROUND_TO_SHORT | ( | x | ) | ((short)(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 153 of file mat_tools.h.
#define SG_ROUND_TO_SLONG | ( | x | ) | ((sLong)(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 158 of file mat_tools.h.
#define SG_ROUND_TO_ULONG | ( | x | ) | ((uLong)(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 157 of file mat_tools.h.
#define SG_ROUND_TO_WORD | ( | x | ) | ((WORD )(x < 0. ? x - 0.5 : x + 0.5)) |
Definition at line 152 of file mat_tools.h.
typedef double(* TSG_Formula_Function_0) (void) |
Definition at line 1858 of file mat_tools.h.
typedef double(* TSG_Formula_Function_1) (double) |
Definition at line 1859 of file mat_tools.h.
typedef double(* TSG_Formula_Function_2) (double, double) |
Definition at line 1860 of file mat_tools.h.
typedef double(* TSG_Formula_Function_3) (double, double, double) |
Definition at line 1861 of file mat_tools.h.
Definition at line 196 of file mat_tools.h.
Definition at line 1207 of file mat_tools.h.
Enumerator | |
---|---|
SG_CLUSTERANALYSIS_Minimum_Distance | |
SG_CLUSTERANALYSIS_Hill_Climbing | |
SG_CLUSTERANALYSIS_Combined |
Definition at line 1141 of file mat_tools.h.
Enumerator | |
---|---|
MLR_VAR_ID | |
MLR_VAR_NAME | |
MLR_VAR_RCOEFF | |
MLR_VAR_R | |
MLR_VAR_R2 | |
MLR_VAR_R2_ADJ | |
MLR_VAR_SE | |
MLR_VAR_T | |
MLR_VAR_SIG | |
MLR_VAR_P |
Definition at line 1677 of file mat_tools.h.
enum ESG_Trend_String |
Enumerator | |
---|---|
SG_TREND_STRING_Formula | |
SG_TREND_STRING_Function | |
SG_TREND_STRING_Formula_Parameters | |
SG_TREND_STRING_Complete | |
SG_TREND_STRING_Compact |
Definition at line 1965 of file mat_tools.h.
Enumerator | |
---|---|
REGRESSION_CORR_None | |
REGRESSION_CORR_Smith | |
REGRESSION_CORR_Wherry_1 | |
REGRESSION_CORR_Wherry_2 | |
REGRESSION_CORR_Olkin_Pratt | |
REGRESSION_CORR_Pratt | |
REGRESSION_CORR_Claudy_3 |
Definition at line 1566 of file mat_tools.h.
enum TSG_Regression_Type |
Enumerator | |
---|---|
REGRESSION_Linear | |
REGRESSION_Rez_X | |
REGRESSION_Rez_Y | |
REGRESSION_Pow | |
REGRESSION_Exp | |
REGRESSION_Log |
Definition at line 1587 of file mat_tools.h.
Enumerator | |
---|---|
TESTDIST_TYPE_Left | |
TESTDIST_TYPE_Right | |
TESTDIST_TYPE_Middle | |
TESTDIST_TYPE_TwoTail |
Definition at line 1508 of file mat_tools.h.
SAGA_API_DLL_EXPORT CSG_Matrix operator* | ( | double | Scalar, |
const CSG_Matrix & | Matrix | ||
) |
Definition at line 1699 of file mat_matrix.cpp.
SAGA_API_DLL_EXPORT CSG_Vector operator* | ( | double | Scalar, |
const CSG_Vector & | Vector | ||
) |
Definition at line 579 of file mat_matrix.cpp.
SAGA_API_DLL_EXPORT int SG_Compare_Char_Ptr | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 211 of file mat_tools.cpp.
SAGA_API_DLL_EXPORT int SG_Compare_Double | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 199 of file mat_tools.cpp.
Referenced by CSG_Simple_Statistics::Get_Gini(), CSG_Simple_Statistics::Get_Quantile(), and CSG_Vector::Sort().
SAGA_API_DLL_EXPORT int SG_Compare_Int | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 187 of file mat_tools.cpp.
SAGA_API_DLL_EXPORT void SG_Decimal_To_Degree | ( | double | Value, |
double & | Deg, | ||
double & | Min, | ||
double & | Sec | ||
) |
Definition at line 233 of file mat_tools.cpp.
SAGA_API_DLL_EXPORT double SG_Degree_To_Decimal | ( | double | Deg, |
double | Min, | ||
double | Sec | ||
) |
Definition at line 224 of file mat_tools.cpp.
SAGA_API_DLL_EXPORT CSG_Matrix SG_Get_Correlation_Matrix | ( | const CSG_Matrix & | Values, |
bool | bCovariances = false |
||
) |
Definition at line 3473 of file mat_tools.cpp.
References C, CSG_Simple_Statistics::Get_Mean(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), and CSG_Simple_Statistics::Get_StdDev().
Referenced by CSG_Regression_Multiple::_Get_Regression().
SAGA_API_DLL_EXPORT int SG_Get_Digit_Count | ( | int | Number | ) |
Definition at line 144 of file mat_tools.cpp.
Referenced by CSG_Matrix::to_String().
SAGA_API_DLL_EXPORT CSG_String SG_Get_Double_asString | ( | double | Number, |
int | Width = -1 , |
||
int | Precision = -1 , |
||
bool | bScientific = false |
||
) |
Definition at line 159 of file mat_tools.cpp.
References CSG_String::Format().
Referenced by CSG_Vector::to_String(), and CSG_Matrix::to_String().
SAGA_API_DLL_EXPORT double SG_Get_Rounded | ( | double | Value, |
int | Decimals = 0 |
||
) |
Definition at line 83 of file mat_tools.cpp.
Referenced by CSG_Grid_System::Create().
SAGA_API_DLL_EXPORT double SG_Get_Rounded_To_SignificantFigures | ( | double | Value, |
int | Decimals | ||
) |
Definition at line 107 of file mat_tools.cpp.
Referenced by CSG_Parameters_Point_Search::On_Parameter_Changed(), CSG_Parameters_Grid_Target::Set_User_Defined(), and CSG_Parameters_Grid_Target::Set_User_Defined_ZLevels().
SAGA_API_DLL_EXPORT double SG_Get_Square | ( | double | Value | ) |
Definition at line 70 of file mat_tools.cpp.
Referenced by CSG_Regression_Multiple::_Get_Regression(), CSG_Regression_Weighted::Calculate(), CSG_Regression_Multiple::Get_CrossValidation(), CSG_Trend::Get_Trend(), CSG_Trend_Polynom::Get_Trend(), and SG_Get_Distance_Polar().
SAGA_API_DLL_EXPORT bool SG_Matrix_Eigen_Reduction | ( | const CSG_Matrix & | Matrix, |
CSG_Matrix & | Eigen_Vectors, | ||
CSG_Vector & | Eigen_Values, | ||
bool | bSilent = true |
||
) |
Definition at line 1933 of file mat_matrix.cpp.
References SG_Matrix_Triangular_Decomposition(), and SG_Matrix_Tridiagonal_QL().
SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation | ( | double | R, |
bool | bDegree | ||
) |
Returns a rotation matrix applicable to 2d vectors for given rotation angle (R).
Definition at line 1866 of file mat_matrix.cpp.
References M_DEG_TO_RAD.
SAGA_API_DLL_EXPORT CSG_Matrix SG_Matrix_Get_Rotation | ( | double | Rx, |
double | Ry, | ||
double | Rz, | ||
bool | bDegree | ||
) |
Returns a rotation matrix applicable to 3d vectors for rotations about the x-, y-, and z-axis (Rx, Ry, Rz).
Definition at line 1885 of file mat_matrix.cpp.
References M_DEG_TO_RAD.
SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Decomposition | ( | int | n, |
int * | Permutation, | ||
double ** | Matrix, | ||
bool | bSilent = true , |
||
int * | nRowChanges = NULL |
||
) |
Definition at line 1948 of file mat_matrix.cpp.
References M_FLT_EPSILON, SG_UI_Process_Get_Okay(), and SG_UI_Process_Set_Progress().
Referenced by CSG_Matrix::Get_Determinant(), CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().
SAGA_API_DLL_EXPORT bool SG_Matrix_LU_Solve | ( | int | n, |
const int * | Permutation, | ||
const double ** | Matrix, | ||
double * | Vector, | ||
bool | bSilent = true |
||
) |
Definition at line 2053 of file mat_matrix.cpp.
References SG_UI_Process_Set_Progress().
Referenced by CSG_Matrix::Set_Inverse(), and SG_Matrix_Solve().
SAGA_API_DLL_EXPORT bool SG_Matrix_Solve | ( | CSG_Matrix & | Matrix, |
CSG_Vector & | Vector, | ||
bool | bSilent = true |
||
) |
Definition at line 1910 of file mat_matrix.cpp.
References CSG_Array::Get_Array(), CSG_Vector::Get_Data(), CSG_Matrix::Get_Data(), CSG_Vector::Get_N(), CSG_Matrix::Get_NX(), CSG_Matrix::Get_NY(), SG_Matrix_LU_Decomposition(), and SG_Matrix_LU_Solve().
Referenced by CSG_Thin_Plate_Spline::Create().
SAGA_API_DLL_EXPORT double SG_Regression_Get_Adjusted_R2 | ( | double | R2, |
int | nSamples, | ||
int | nPredictors, | ||
TSG_Regression_Correction | Correction = REGRESSION_CORR_Wherry_1 |
||
) |
Definition at line 63 of file mat_regression.cpp.
References REGRESSION_CORR_Claudy_3, REGRESSION_CORR_None, REGRESSION_CORR_Olkin_Pratt, REGRESSION_CORR_Pratt, REGRESSION_CORR_Smith, REGRESSION_CORR_Wherry_1, and REGRESSION_CORR_Wherry_2.
Referenced by CSG_Regression_Multiple::_Get_Regression(), and CSG_Regression::Calculate().
SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | CSG_Vector & | Vector, |
double | Angle | ||
) |
Definition at line 770 of file mat_matrix.cpp.
References CSG_Vector::Get_Size(), and SG_VectorR2_Rotate().
SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | double & | x, |
double & | y, | ||
double | Angle | ||
) |
Definition at line 750 of file mat_matrix.cpp.
Referenced by SG_VectorR2_Rotate().
SAGA_API_DLL_EXPORT bool SG_VectorR2_Rotate | ( | double | Vector[2], |
double | Angle | ||
) |
Definition at line 764 of file mat_matrix.cpp.
References SG_VectorR2_Rotate().
SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate | ( | CSG_Vector & | Vector, |
size_t | Axis, | ||
double | Angle | ||
) |
Definition at line 810 of file mat_matrix.cpp.
References CSG_Vector::Get_Data(), CSG_Vector::Get_Size(), and SG_VectorR3_Rotate().
SAGA_API_DLL_EXPORT bool SG_VectorR3_Rotate | ( | double | Vector[3], |
size_t | Axis, | ||
double | Angle | ||
) |
Definition at line 776 of file mat_matrix.cpp.
Referenced by SG_VectorR3_Rotate().