From f4d3ad691e7bd0b1058159c65f4637f3866bf953 Mon Sep 17 00:00:00 2001 From: jiri Date: Tue, 19 Sep 2006 16:09:26 +0000 Subject: [PATCH] *** empty log message *** --- matexp.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/matexp.h b/matexp.h index e42d50d..871b6c4 100644 --- a/matexp.h +++ b/matexp.h @@ -251,8 +251,9 @@ return r; //and probably not efficient either template -void exptimesdestructive(const M &mat, V &result, V &rhs, bool transpose=false, const double scale=1., int maxpower= -1, int maxtaylor= -1) //uses just matrix vector multiplication +void exptimesdestructive(const M &mat, V &result, V &rhs, bool transpose=false, const double scale=1., int maxpower= -1, int maxtaylor= -1, bool mat_is_0=false) //uses just matrix vector multiplication { +if(mat_is_0) {result=rhs; return;} if(mat.nrows()!=mat.ncols()||(unsigned int) mat.nrows() != (unsigned int)rhs.size()) laerror("inappropriate sizes in exptimes"); int power; @@ -280,10 +281,10 @@ return; template -const V exptimes(const M &mat, V rhs, bool transpose=false, const double scale=1., int maxpower= -1, int maxtaylor= -1 ) +const V exptimes(const M &mat, V rhs, bool transpose=false, const double scale=1., int maxpower= -1, int maxtaylor= -1, bool mat_is_0=false ) { V result; -exptimesdestructive(mat,result,rhs,transpose,scale,maxpower,maxtaylor); +exptimesdestructive(mat,result,rhs,transpose,scale,maxpower,maxtaylor,mat_is_0); return result; }