Skip to content

Commit

Permalink
Improved error in matrix times vector so if matrix and vector do not …
Browse files Browse the repository at this point in the history
…have matching sizes the non matching sizes are output on the log
  • Loading branch information
Gareth Aneurin Tribello committed Jan 31, 2025
1 parent 16c465d commit fba58cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/matrixtools/MatrixTimesVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ MatrixTimesVector::MatrixTimesVector(const ActionOptions&ao):
error("number of columns in input matrix does not equal number of elements in vector");
}
} else if( getPntrToArgument(i)->getShape()[1]!=getPntrToArgument(n)->getShape()[0] ) {
error("number of columns in input matrix does not equal number of elements in vector");
std::string str_nmat, str_nvec; Tools::convert( getPntrToArgument(i)->getShape()[1], str_nmat); Tools::convert( getPntrToArgument(n)->getShape()[0], str_nvec );
error("number of columns in input matrix is " + str_nmat + " which does not equal number of elements in vector, which is " + str_nvec);
}
}
if( getPntrToArgument(n)->getRank()>0 ) {
Expand Down

0 comments on commit fba58cb

Please sign in to comment.