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