main/sc/source/core/tool/interpr5.cxx
// Calculates means of the rows of matrix X. X is a RxC matrix;
// ResMat is a Rx1 matrix (=column).
Calculates means of the rows of matrix X. X is a RxC matrix;
ResMat is a Rx1 matrix (=column).
Calculates means of the rows of matrix X . X is a RxC matrix ; ResMat is a Rx1 matrix ( = column ) .
void lcl_CalculateRowMeans(ScMatrixRef pX, ScMatrixRef pResMat,
                             SCSIZE nC, SCSIZE nR)
{
    double fSum = 0.0;
    for (SCSIZE k=0; k < nR; k++)
    {
        fSum =0.0;
        for (SCSIZE i=0; i < nC; i++)
            fSum += pX->GetDouble(i,k);   
        pResMat ->PutDouble( fSum/static_cast<double>(nC),k);
    }
}
void lcl_CalculateRowMeans ( ScMatrixRef pX , ScMatrixRef pResMat , SCSIZE nC , SCSIZE nR ) { double fSum = 0.0 ; for ( SCSIZE k = 0 ; k < nR ; k ++ ) { fSum = 0.0 ; for ( SCSIZE i = 0 ; i < nC ; i ++ ) fSum += pX -> GetDouble ( i , k ) ; pResMat -> PutDouble ( fSum / static_cast < double > ( nC ) , k ) ; } }
Calculates means of the rows of matrix X. X is a RxC matrix;
ResMat is a Rx1 matrix (=column).
Calculates means of the rows of matrix X . X is a RxC matrix ; ResMat is a Rx1 matrix ( = column ) .
// GetDouble(Column,Row)