ocmath_row_quantiles
Description
get input matrix's each row's min, max, 1st Quartile, median and 3rd Quartile and put result to relative pointer if the pointer not NULL.
Syntax
OCMATH_API int ocmath_row_quantiles(UINT nRows, UINT nCols, const double* pMat, double* pMin = NULL, double* pMax = NULL, double* pQ1 = NULL, double* pMedian = NULL, double* pQ3 = NULL, int nInterpolate = INTERPOLATE_WEIGHT_AVER_RIGHT)
Parameters
- nRows
- [input] row number of input matrix.
- nCols
- [input] column number of input matrix.
- pMat
- [input] pointer to input matrix which will be get quantiles.
- pMin
- [output] if not NULL, pointer to each row's min value, its size should be nRows. Its default value is NULL.
- pMax
- [output] if not NULL, pointer to each row's max value, its size should be nRows. Its default value is NULL.
- pQ1
- [output] if not NULL, pointer to each row's 1st Quartile, its size should be nRows. Its default value is NULL.
- pMedian
- [output] if not NULL, pointer to each row's miedian value, its size should be nRows. Its default value is NULL.
- pQ3
- [output] if not NULL, pointer to each row's 3rd Quartile, its size should be nRows. Its default value is NULL.
Return
return OE_NOERROR on success, else return minus error code.
Examples
EX1
void ocmath_row_quantiles_ex1()
{
vector vtemp = {1, 2, 3, 4, 5, 6};
int nRows = 2;
int nCols = 3;
vector vMin(nRows);
vector vMax(nRows);
vector vQ1(nRows);
ocmath_row_quantiles(nRows, nCols, vtemp, vMin, vMax, vQ1);
}
// At the end of example: vMin = {1, 4}, vMax = {3, 6}, vQ1 = {1, 4}.
Remark
See Also
ocmath_row_desc_stats
header to Include
origin.h
Reference
nag_5pt_summary_stats(g01alc), Nag Manual
|