From b0eec91acf993bcaf222f7f6c21854228ac424b2 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Fri, 14 Mar 2014 14:50:29 +0000 Subject: [PATCH] Improve some assertions git-svn-id: https://svn.dealii.org/trunk@32651 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/lapack_full_matrix.cc | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/deal.II/source/lac/lapack_full_matrix.cc b/deal.II/source/lac/lapack_full_matrix.cc index 2dec8d2861..2cf6cbee9a 100644 --- a/deal.II/source/lac/lapack_full_matrix.cc +++ b/deal.II/source/lac/lapack_full_matrix.cc @@ -227,9 +227,9 @@ LAPACKFullMatrix::mmult(LAPACKFullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); - Assert(C.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); + Assert(C.state == matrix || C.state == inverse_matrix, ExcState(state)); Assert (this->n_cols() == B.n_rows(), ExcDimensionMismatch(this->n_cols(), B.n_rows())); Assert (C.n_cols() == B.n_cols(), ExcDimensionMismatch(C.n_cols(), B.n_cols())); Assert (C.n_rows() == this->n_rows(), ExcDimensionMismatch(this->n_rows(), C.n_rows())); @@ -251,8 +251,8 @@ LAPACKFullMatrix::mmult(FullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); Assert (this->n_cols() == B.n_rows(), ExcDimensionMismatch(this->n_cols(), B.n_rows())); Assert (C.n_cols() == B.n_cols(), ExcDimensionMismatch(C.n_cols(), B.n_cols())); Assert (C.n_rows() == this->n_rows(), ExcDimensionMismatch(this->n_rows(), C.n_rows())); @@ -276,9 +276,9 @@ LAPACKFullMatrix::Tmmult(LAPACKFullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); - Assert(C.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); + Assert(C.state == matrix || C.state == inverse_matrix, ExcState(state)); Assert (this->n_rows() == B.n_rows(), ExcDimensionMismatch(this->n_rows(), B.n_rows())); Assert (C.n_cols() == B.n_cols(), ExcDimensionMismatch(C.n_cols(), B.n_cols())); Assert (C.n_rows() == this->n_cols(), ExcDimensionMismatch(this->n_cols(), C.n_rows())); @@ -300,8 +300,8 @@ LAPACKFullMatrix::Tmmult(FullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); Assert (this->n_rows() == B.n_rows(), ExcDimensionMismatch(this->n_rows(), B.n_rows())); Assert (C.n_cols() == B.n_cols(), ExcDimensionMismatch(C.n_cols(), B.n_cols())); Assert (C.n_rows() == this->n_cols(), ExcDimensionMismatch(this->n_cols(), C.n_rows())); @@ -325,9 +325,9 @@ LAPACKFullMatrix::mTmult(LAPACKFullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); - Assert(C.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); + Assert(C.state == matrix || C.state == inverse_matrix, ExcState(state)); Assert (this->n_cols() == B.n_cols(), ExcDimensionMismatch(this->n_cols(), B.n_cols())); Assert (C.n_cols() == B.n_rows(), ExcDimensionMismatch(C.n_cols(), B.n_rows())); Assert (C.n_rows() == this->n_rows(), ExcDimensionMismatch(this->n_rows(), C.n_rows())); @@ -349,8 +349,8 @@ LAPACKFullMatrix::mTmult(FullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); Assert (this->n_cols() == B.n_cols(), ExcDimensionMismatch(this->n_cols(), B.n_cols())); Assert (C.n_cols() == B.n_rows(), ExcDimensionMismatch(C.n_cols(), B.n_rows())); Assert (C.n_rows() == this->n_rows(), ExcDimensionMismatch(this->n_rows(), C.n_rows())); @@ -374,9 +374,9 @@ LAPACKFullMatrix::TmTmult(LAPACKFullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); - Assert(C.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); + Assert(C.state == matrix || C.state == inverse_matrix, ExcState(state)); Assert (this->n_rows() == B.n_cols(), ExcDimensionMismatch(this->n_rows(), B.n_cols())); Assert (C.n_cols() == B.n_rows(), ExcDimensionMismatch(C.n_cols(), B.n_rows())); Assert (C.n_rows() == this->n_cols(), ExcDimensionMismatch(this->n_cols(), C.n_rows())); @@ -398,8 +398,8 @@ LAPACKFullMatrix::TmTmult(FullMatrix &C, const LAPACKFullMatrix &B, const bool adding) const { - Assert(state == matrix, ExcState(state)); - Assert(B.state == matrix, ExcState(state)); + Assert(state == matrix || state == inverse_matrix, ExcState(state)); + Assert(B.state == matrix || B.state == inverse_matrix, ExcState(state)); Assert (this->n_rows() == B.n_cols(), ExcDimensionMismatch(this->n_rows(), B.n_cols())); Assert (C.n_cols() == B.n_rows(), ExcDimensionMismatch(C.n_cols(), B.n_rows())); Assert (C.n_rows() == this->n_cols(), ExcDimensionMismatch(this->n_cols(), C.n_rows())); -- 2.39.5