diff --git a/mat.cc b/mat.cc index 1c6fb2f..c94c3de 100644 --- a/mat.cc +++ b/mat.cc @@ -45,7 +45,7 @@ return r; //direct product template -const NRMat NRMat::otimes(const NRMat &rhs) const +const NRMat NRMat::otimes(const NRMat &rhs, bool reversecolumns) const { if(nn==0 && mm == 0) return *this; if(rhs.nn==0 && rhs.mm== 0) return rhs; @@ -54,12 +54,24 @@ NRMat r((T)0,nn*rhs.nn,mm*rhs.mm); int i,j,k,l; +if(reversecolumns) +{ +for(i=0;i &rhs); //multiply by a diagonal matrix from L void diagmultr(const NRVec &rhs); //multiply by a diagonal matrix from R const NRSMat transposedtimes() const; //A^T . A