Check potential loss of precision during product of a matrix by a vector See the supplementary information for a discussion of loss of precision. Returns the product of the matrix by the vector (mat * vec). A warning is issued if numerical problems are encountered (see GenCheckSumNumPb for more details). No check is performed if the global variable noCheckSum is defined and equal to true. Parameters: - mat: matrix [B x A] - vec: column vector [A x 1] - sVar: string describing the variable that is being calculated - sCaller: string describing the function in which the calculation is performed Returns: mat * vec This file is part of the SPlaC v1.0 package (copyright 2008) Check the README file for further information
0001 sumret=mat*vec; % [B x 1] 0002 0003 global noCheckSum; 0004 if (isempty(noCheckSum) || ~noCheckSum) 0005 nNbRow=size(mat,1); 0006 summax=max(abs(mat.*repmat(transpose(vec),nNbRow,1)),[],2); 0007 GenCheckSumNumPb(sumret,summax,sVar,sCaller); 0008 end