| ocmath_frequency_count  DescriptionFunction to calculate frequency count Syntax
int ocmath_frequency_count( double * pSource, UINT nSourceSize, FreqCountOptions * fcoOptions, double * pBinCenters, UINT nBinCenterSize, double * pAbsoluteCounts, UINT nAbsoluteCountSize, double * pCumulativeCounts = NULL, UINT nCumulativeCountSize = 0, int nOption = FC_STEPSIZE, double * pBin = NULL, UINT nBinSize = 0 )
 Parameters
    pSource[input] pointer to an array containing input datanSourceSize[input] size of an array containing input datafcoOptions[input] pointer to the sturcture that containing FromMin, ToMax, StepSize, IncludeLTMin, IncludeGEMax. Please see stats_types.h for more detail.pBinCenters[output] pointer to an array containing all Bin CentersnBinCenterSize[input] size of an array containing all Bin CenterspAbsoluteCounts[output] pinter to all absolute counts in each intervalnAbsoluteCountSize[input] size of Absolute CountpCumulativeCounts[output] pointer to Cumulative Counts for each intervalnCumulativeCountSize[input] size of Cumulative Counts for each intervalnOption[input] Define for the Boundary type of frequency countsFC_STEPSIZE(default) uses step size to determine binsFC_NUMINTERVALS uses number of intervals to determine binspBin[input] pointer to an array containing all input BinnBinSize[input] size of an array containing all input Bin ReturnReturns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure. ExamplesEX1 
void ocmath_frequency_count_ex1()
{
    UINT nSourceSize = 5;   //Set the DataSize to 5        
    vector vSource;
    vSource.Data(1, nSourceSize, 1);            
    
    FreqCountOptions fcoOptions;    
    fcoOptions.FromMin = 0;
    fcoOptions.ToMax = 7;
    fcoOptions.StepSize = 7;
    fcoOptions.IncludeLTMin = 0;
    fcoOptions.IncludeGEMax = 0;
    
    vector    vBinCenters, vAbsoluteCounts, vCumulativeCounts, vBinCentersChk, vAbsoluteCountsChk, vCumulativeCountsChk;
    UINT nBinCenterSize = fcoOptions.StepSize;
    vBinCenters.SetSize(nBinCenterSize);
    
    UINT nAbsoluteCountSize = fcoOptions.StepSize;
    vAbsoluteCounts.SetSize(nAbsoluteCountSize);
    
    UINT nCumulativeCountSize = fcoOptions.StepSize;
    vCumulativeCounts.SetSize(nCumulativeCountSize);
    
    int nRet;   
    int nOption = FC_NUMINTERVALS;
    nRet = ocmath_frequency_count(vSource, nSourceSize, &fcoOptions, vBinCenters, nBinCenterSize, vAbsoluteCounts, nAbsoluteCountSize, vCumulativeCounts, nCumulativeCountSize, nOption);
}
RemarkSee Alsoheader to Includedorigin.h Reference |