45 #include "DenseLinAlgPack_AssertOp.hpp" 46 #include "Teuchos_Assert.hpp" 48 #ifdef LINALGPACK_CHECK_RHS_SIZES 52 TEUCHOS_TEST_FOR_EXCEPTION(
53 v_lhs_size != v_rhs_size, std::length_error
54 ,
"Vp_V_assert_sizes(...) : The sizes of v_lhs = " << v_lhs_size <<
" and v_rhs = " << v_rhs_size
55 <<
" in the operation v_lhs += op v_rhs do not match");
60 TEUCHOS_TEST_FOR_EXCEPTION(
61 v_rhs1_size != v_rhs2_size, std::length_error
62 ,
"VopV_assert_sizes(...) : The sizes of v_rhs1 and v_rhs2 " 63 "in the operation v_rhs1 op v_rhs2 do not match");
69 if(
rows(m_lhs_rows,m_lhs_cols,trans_lhs) !=
rows(m_rhs_rows,m_rhs_cols,trans_rhs)
70 ||
cols(m_lhs_rows,m_lhs_cols,trans_lhs) !=
cols(m_rhs_rows,m_rhs_cols,trans_rhs) )
72 TEUCHOS_TEST_FOR_EXCEPTION(
73 true, std::length_error
74 ,
"Mp_M_assert_sizes(...) : The sizes of m_lhs and m_rhs " 75 "in the operation op(m_lhs) += op op(m_rhs) do not match");
82 if(
rows(m_rhs1_rows,m_rhs1_cols,trans_rhs1) !=
rows(m_rhs2_rows,m_rhs2_cols,trans_rhs2)
83 ||
cols(m_rhs1_rows,m_rhs1_cols,trans_rhs1) !=
cols(m_rhs2_rows,m_rhs2_cols,trans_rhs2) )
85 TEUCHOS_TEST_FOR_EXCEPTION(
86 true, std::length_error
87 ,
"Mp_M_assert_sizes(...) : The sizes of m_rhs1 and m_rhs2 " 88 "in the operation op(m_rhs1) op op(m_rhs2) do not match");
95 if(
cols(m_rhs1_rows,m_rhs1_cols,trans_rhs1) != v_rhs2_size)
96 TEUCHOS_TEST_FOR_EXCEPTION(
97 true, std::length_error
98 ,
"MtV_assert_sizes(...) : The number of columns in " 99 "m_rhs1 and the size of v_rhs2 in the operation v_lhs += op(m_rhs1) * v_rhs2 " 106 if(
cols(m_rhs1_rows,m_rhs1_cols,trans_rhs1) != v_rhs2_size)
107 TEUCHOS_TEST_FOR_EXCEPTION(
108 true, std::length_error
109 ,
"Vp_MtV_assert_sizes(...) : The number of columns in" 110 " m_rhs1 and the size of v_rhs2 in the operation v_lhs += op(m_rhs1) * v_rhs2" 112 if(
rows(m_rhs1_rows,m_rhs1_cols,trans_rhs1) != v_lhs_size)
113 TEUCHOS_TEST_FOR_EXCEPTION(
114 true, std::length_error
115 ,
"Vp_MtV_assert_sizes(...) : The number of rows in" 116 " m_rhs1 and the size of v_lhs in the operation v_lhs += op(m_rhs1) * v_rhs2" 120 void DenseLinAlgPack::MtM_assert_sizes(
124 if(
cols(m_rhs1_rows,m_rhs1_cols,trans_rhs1) !=
rows(m_rhs2_rows,m_rhs2_cols,trans_rhs2))
125 TEUCHOS_TEST_FOR_EXCEPTION(
126 true, std::length_error
127 ,
"MtM_assert_sizes(...) : The number of columns in" 128 " m_rhs1 and the number of rows in m_rhs2 in the operation" 129 " op(m_lhs) += op(m_rhs1) * op(m_rhs2) do not match");
132 void DenseLinAlgPack::Mp_MtM_assert_sizes(
137 if(
cols(m_rhs1_rows,m_rhs1_cols,trans_rhs1) !=
rows(m_rhs2_rows,m_rhs2_cols,trans_rhs2))
138 TEUCHOS_TEST_FOR_EXCEPTION(
139 true, std::length_error
140 ,
"Mp_MtM_assert_sizes(...) : The number of columns in" 141 " m_rhs1 and the number of rows in m_rhs2 in the operation" 142 " op(m_lhs) += op(m_rhs1) * op(m_rhs2) do not match");
143 if(
rows(m_lhs_rows,m_lhs_cols,trans_lhs) !=
rows(m_rhs1_rows,m_rhs1_cols,trans_rhs1))
144 TEUCHOS_TEST_FOR_EXCEPTION(
145 true, std::length_error
146 ,
"Mp_MtM_assert_sizes(...) : The number of rows in" 147 " m_lhs and the number of rows in m_rhs1 in the operation" 148 " op(m_lhs) += op(m_rhs1) * op(m_rhs2) do not match");
149 if(
cols(m_lhs_rows,m_lhs_cols,trans_lhs) !=
cols(m_rhs2_rows,m_rhs2_cols,trans_rhs2))
150 TEUCHOS_TEST_FOR_EXCEPTION(
151 true, std::length_error
152 ,
"Mp_MtM_assert_sizes(...) : The number of columns in" 153 " m_lhs and the number of columns in m_rhs1 in the operation" 154 " op(m_lhs) += op(m_rhs1) * op(m_rhs2) do not match");
157 #endif // LINALGPACK_CHECK_RHS_SIZES size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
size_type cols(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)