main/sc/source/core/tool/interpr5.cxx
/* Calculates Z = R * B
 * R is given in matrix A and vector VecR as obtained from the QR
 * decompostion in lcl_CalculateQRdecomposition. B and Z are column vectors
 * given as matrix with at least index 0 to K-1; elements on index>=K are
 * not used.
 */
Calculates Z = R * B
R is given in matrix A and vector VecR as obtained from the QR
decompostion in lcl_CalculateQRdecomposition. B and Z are column vectors
given as matrix with at least index 0 to K-1; elements on index>=K are
not used.
Calculates Z = R * B R is given in matrix A and vector VecR as obtained from the QR decompostion in lcl_CalculateQRdecomposition . B and Z are column vectors given as matrix with at least index 0 to K - 1 ; elements on index > = K are not used .
void lcl_ApplyUpperRightTriangle(ScMatrixRef pMatA,
                        ::std::vector< double>& pVecR, ScMatrixRef pMatB,
                        ScMatrixRef pMatZ, SCSIZE nK, bool bIsTransposed)
{
    double fSum;
    for (SCSIZE row = 0; row < nK; row++)
    {
        fSum = pVecR[row] * pMatB->GetDouble(row);
        for (SCSIZE col = row+1; col < nK; col++)
            if (bIsTransposed)
                fSum += pMatA->GetDouble(row,col) * pMatB->GetDouble(col);
            else
                fSum += pMatA->GetDouble(col,row) * pMatB->GetDouble(col);
        pMatZ->PutDouble( fSum, row);
    }
}
void lcl_ApplyUpperRightTriangle ( ScMatrixRef pMatA , :: std :: vector < double > & pVecR , ScMatrixRef pMatB , ScMatrixRef pMatZ , SCSIZE nK , bool bIsTransposed ) { double fSum ; for ( SCSIZE row = 0 ; row < nK ; row ++ ) { fSum = pVecR [ row ] * pMatB -> GetDouble ( row ) ; for ( SCSIZE col = row + 1 ; col < nK ; col ++ ) if ( bIsTransposed ) fSum += pMatA -> GetDouble ( row , col ) * pMatB -> GetDouble ( col ) ; else fSum += pMatA -> GetDouble ( col , row ) * pMatB -> GetDouble ( col ) ; pMatZ -> PutDouble ( fSum , row ) ; } }
Calculates Z = R * B
 R is given in matrix A and vector VecR as obtained from the QR
 decompostion in lcl_CalculateQRdecomposition.
Calculates Z = R * B R is given in matrix A and vector VecR as obtained from the QR decompostion in lcl_CalculateQRdecomposition .
// ScMatrix matrices are zero based, index access (column,row)