1 /**********************************************************************************************/
2 /* Abstract class for matrix used for millepede2 operation. */
3 /* Author: ruben.shahoyan@cern.ch */
5 /**********************************************************************************************/
13 #include "AliMatrixSq.h"
22 //___________________________________________________________
23 void AliMatrixSq::MultiplyByVec(const Double_t *vecIn,Double_t *vecOut) const
25 // fill vecOut by matrix*vecIn
26 // vector should be of the same size as the matrix
27 for (int i=GetSize();i--;) {
29 for (int j=GetSize();j--;) vecOut[i] += vecIn[j]*(*this)(i,j);
34 //___________________________________________________________
35 void AliMatrixSq::PrintCOO() const
37 // print matrix in COO sparse format
39 // get number of non-zero elements
42 for (int ir=0;ir<sz;ir++) for (int ic=0;ic<sz;ic++) if (Query(ir,ic)!=0) nnz++;
44 printf("%d %d %d\n",sz,sz,nnz);
46 for (int ir=0;ir<sz;ir++) for (int ic=0;ic<sz;ic++) if ((vl=Query(ir,ic))!=0) printf("%d %d %f\n",ir,ic,vl);