From 03bed24414d5b5068eff1aff106598f9c43c48b1 Mon Sep 17 00:00:00 2001 From: jiri Date: Wed, 12 Oct 2005 11:14:55 +0000 Subject: [PATCH] *** empty log message *** --- mat.h | 9 ++------- strassen.cc | 3 ++- t.cc | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mat.h b/mat.h index 88a798d..eae57dc 100644 --- a/mat.h +++ b/mat.h @@ -86,11 +86,6 @@ public: const NRMat submatrix(const int fromrow, const int torow, const int fromcol, const int tocol) const; //there is also independent less efficient routine for generally indexed submatrix void gemm(const T &beta, const NRMat &a, const char transa, const NRMat &b, const char transb, const T &alpha);//this = alpha*op( A )*op( B ) + beta*this -/* - void strassen(const T beta, const NRMat &a, const char transa, const NRMat &b, - const char transb, const T alpha);//this := alpha*op( A )*op( B ) + beta*this - void s_cutoff(const int,const int,const int,const int) const; -*/ void fprintf(FILE *f, const char *format, const int modulo) const; void fscanf(FILE *f, const char *format); const double norm(const T scalar=(T)0) const; @@ -105,11 +100,11 @@ public: void gemm(const T &beta, const SparseMat &a, const char transa, const NRMat &b, const char transb, const T &alpha);//this = alpha*op( A )*op( B ) + beta*this inline void simplify() {}; //just for compatibility with sparse ones bool issymmetric() const {return 0;}; - +#ifndef NO_STRASSEN //Strassen's multiplication (better than n^3, analogous syntax to gemm) void strassen(const T beta, const NRMat &a, const char transa, const NRMat &b, const char transb, const T alpha);//this := alpha*op( A )*op( B ) + beta*this void s_cutoff(const int,const int,const int,const int) const; - +#endif }; //due to mutual includes this has to be after full class declaration diff --git a/strassen.cc b/strassen.cc index caa6044..d33aa59 100644 --- a/strassen.cc +++ b/strassen.cc @@ -1,6 +1,7 @@ #include "mat.h" +#ifndef NO_STRASSEN /*Strassen algorithm*/ // called routine is fortran-compatible extern "C" void fmm(const char c_transa,const char c_transb,const int m,const int n,const int k,const double alpha, @@ -23,4 +24,4 @@ copyonwrite(); //swap transpositions and order of matrices fmm(transb,transa,mm,nn,k,alpha,b,b.mm, a, a.mm, beta,*this, mm,NULL,0); } - +#endif diff --git a/t.cc b/t.cc index 464cce4..f1d2217 100644 --- a/t.cc +++ b/t.cc @@ -194,12 +194,14 @@ cout <<" big1*big2 "< atest, btest,ctest; { int cc,c1,c2,c3; cin >>cc>>c1>>c2>>c3; + atest.s_cutoff(cc,c1,c2,c3); } cin>>atest; @@ -237,6 +239,7 @@ for (int c=64; c<=512;c+=64) cout <<"cutoff "<