diff --git a/Numeric/fullMatrix.cpp b/Numeric/fullMatrix.cpp index 6261e39e41c0fae46ccd2bf497b7bb66ab493f13..205417ca977930158d3d032eda4fedabd6a3e159 100644 --- a/Numeric/fullMatrix.cpp +++ b/Numeric/fullMatrix.cpp @@ -352,7 +352,7 @@ void fullMatrix<double>::registerBindings(binding *b) cm->setArgNames("A","B","alpha","beta",NULL); cm->setDescription("this = beta*this + alpha * (A.B)"); cm = cb->addMethod("print", &fullMatrix<double>::print); - cm->setArgNames("name",NULL); + cm->setArgNames("name","format",NULL); cm->setDescription("print the matrix"); cm = cb->addMethod("invertInPlace", &fullMatrix<double>::invertInPlace); cm->setDescription("invert the matrix and return the determinant"); diff --git a/Numeric/fullMatrix.h b/Numeric/fullMatrix.h index 6a29640b46b3b33ad3ac53e751974d94e773ad5d..6bad73638e8fba8771b96f0086d27cb8f0d26231 100644 --- a/Numeric/fullMatrix.h +++ b/Numeric/fullMatrix.h @@ -490,7 +490,7 @@ class fullMatrix #endif ; - void print(const std::string name = "", const char *format = "%12.5E ") const + void print(const std::string name = "", const std::string format = "%12.5E ") const { printf("Printing matrix %s:\n", name.c_str()); int ni = size1(); @@ -498,7 +498,7 @@ class fullMatrix for(int I = 0; I < ni; I++){ printf(" "); for(int J = 0; J < nj; J++){ - printf(format, (*this)(I, J)); + printf(format.c_str(), (*this)(I, J)); } printf("\n"); } diff --git a/Solver/linearSystemFull.h b/Solver/linearSystemFull.h index 641f0b02a76975aa81dae7d2a0aa512fd39137b1..01deac224ff1205a4087b4933b886a6b993a7c63 100644 --- a/Solver/linearSystemFull.h +++ b/Solver/linearSystemFull.h @@ -68,7 +68,7 @@ class linearSystemFull : public linearSystem<scalar> { } virtual void zeroRightHandSide() { - for(int i = 0; i < _b->size(); i++) (*_b)(i) = 0.; + _b->setAll(0.); } virtual double normInfRightHandSide() const{ double nor = 0.;