* Inquire Dimension (Col) . returns Number of Columns
*/
unsigned int n () const { return dim_range; }
+
+ /**
+ * Return whether the matrix contains only
+ * elements with value zero. This function
+ * is mainly for internal consistency
+ * check and should seldomly be used when
+ * not in debug mode since it uses quite
+ * some time.
+ */
+ bool all_zero () const;
+
//@}
*/
unsigned int size () const;
+ /**
+ * Return whether the vector contains only
+ * elements with value zero. This function
+ * is mainly for internal consistency
+ * check and should seldomly be used when
+ * not in debug mode since it uses quite
+ * some time.
+ */
+ bool all_zero () const;
+
/**
* Make the #dVector# class a bit like the
* #vector<># class of the C++ standard
delete[] val;
}
+
+bool dFMatrix::all_zero () const {
+ const double *p = &val[0],
+ *e = &val[n()*m()];
+ while (p!=e)
+ if (*p++ != 0.0)
+ return false;
+
+ return true;
+};
+
+
+
void dFMatrix::reinit (const unsigned int mm, const unsigned int nn)
{
if (val_size<nn*mm)
}
+
+bool dVector::all_zero () const {
+ const_iterator p = begin(),
+ e = end();
+ while (p!=e)
+ if (*p++ != 0.0)
+ return false;
+ return true;
+};
+
+
+
double dVector::operator * (const dVector& v) const
{
if (&v == this)
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams