diff --git a/mat.h b/mat.h index b750ba2..13b3fcc 100644 --- a/mat.h +++ b/mat.h @@ -57,7 +57,7 @@ public: const bool operator==(const NRMat &rhs) const {return !(*this != rhs);}; inline int getcount() const {return count?*count:0;} NRMat & operator=(const NRMat &rhs); //assignment - void clear() {LA_traits::clear((*this)[0],nn*mm);}; //zero out + void clear() {if(nn&&mm) LA_traits::clear((*this)[0],nn*mm);}; //zero out void randomize(const T &x); //fill with random numbers NRMat & operator=(const T &a); //assign a to diagonal NRMat & operator|=(const NRMat &rhs); //assignment to a new copy