8 #include "AliMatrixSq.h"
17 //___________________________________________________________
18 void AliMatrixSq::MultiplyByVec(Double_t *vecIn,Double_t *vecOut) const
20 // fill vecOut by matrix*vecIn
21 // vector should be of the same size as the matrix
22 for (int i=GetSize();i--;) {
24 for (int j=GetSize();j--;) vecOut[i] += vecIn[j]*(*this)(i,j);
29 //___________________________________________________________
30 void AliMatrixSq::PrintCOO() const
32 // print matrix in COO sparse format
34 // get number of non-zero elements
37 for (int ir=0;ir<sz;ir++) for (int ic=0;ic<sz;ic++) if (Query(ir,ic)!=0) nnz++;
39 printf("%d %d %d\n",sz,sz,nnz);
41 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);