bug in:
Mat<T>::operator!=(const Mat<T> &m) const
the line (1001), \c
if (data[i]!=m.data[i]) return false;
should return true
further remarks:
line 1042: one ';' sign too much;
i optimized the operator \c
Mat<T>::operator*=(const Mat<T> &m)
for better memory usage. maybe you have some need for
it ?
\code
template<class T> inline
void Mat<T>::operator=(const Mat<T> &m)
{
it_assert1(no_cols == m.no_rows,"Mat<T>::operator=:
wrong sizes");
Vec<T> tmp(m.no_cols);
int i,j,k, pos=0, m_pos=0; for (i=0; i<no_rows; i++) { tmp.zeros(); for (j=0; j<m.no_cols; j++) { m_pos=0; for (k=0; k<no_cols; k++) { tmp(j) += data[pos+k] *
m.data[m_pos+j];
m_pos += m.row_offset;
}
}
set_row( i, tmp);
pos += row_offset;
}
}
\endcode
i tested it vor \c mat and \c cmat ...
Logged In: YES
user_id=326034
This bug has actually already been discovered, but not
reported into the bug-system. A fix is already into the CVS.
The more memory efficient version of oper*=() is of
interest, but will have to wait until after 3.7.0 since
there is an internal change of storage (from row-major to
column-major).
/Tony