Commit 69642cf4 authored by simone's avatar simone
Browse files

Assertion with more talkative outputs :-)

parent 9db73f52
......@@ -282,7 +282,8 @@ MSRMatr( const MSRPatt* ex_pattern, const std::vector<DataType> &ex_value ) :
// _nnz = ex_pattern.nnz();
// _nrows = ex_pattern.nrow();
// _ncols = ex_pattern.ncol();
ASSERT( _Patt->nNz() == ex_value.size() - 1, "Error in MSR Values " ); // in MSR value has lenghth nnz+1
ASSERT( _Patt->nNz() == ex_value.size() - 1, "Error in MSR Values . _Patt->nNz() = "
<< _Patt->nNz() << " ex_value.size() - 1 " << ex_value.size() - 1 ); // in MSR value has lenghth nnz+1
}
template <class DataType>
......@@ -362,7 +363,9 @@ std::vector<DataType>
MSRMatr<DataType>::operator* ( const std::vector<DataType> &v ) const
{
UInt nrows = _Patt->nRows();
ASSERT( nrows == v.size(), "Error in Matrix Vector product" );
ASSERT( nrows == v.size(), "Error in Matrix Vector product. nrows = "
<< nrows << " v.size() = " << v.size() );
std::vector<DataType> ans;
ans.resize( nrows, 0.0 );
for ( UInt i = 0 + OFFSET;i < nrows + OFFSET;++i )
......@@ -381,7 +384,8 @@ MSRMatr<DataType>::
operator*( const Vector &v ) const
{
UInt nrows = _Patt->nRows();
ASSERT( nrows == v.size(), "Error in Matrix Vector product" );
ASSERT( nrows == v.size(), "Error in Matrix Vector product. nrows = "
<< nrows << " v.size() = " << v.size() );
Vector ans( nrows );
ans = ZeroVector( nrows );
......@@ -417,7 +421,8 @@ MSRMatr<DataType>::
trans_mult( const Vector &v ) const
{
UInt nrows = _Patt->nRows();
ASSERT( nrows == v.size(), "Error in Matrix Vector product" );
ASSERT( nrows == v.size(), "Error in Matrix Vector product. nrows = "
<< nrows << " v.size() = " << v.size() );
Vector ans( nrows );
ans = 0.;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment