mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Replace assert() by eigen_assert() (fixes bug #548).
This commit is contained in:
@@ -38,7 +38,7 @@ struct traits<DGMRES<_MatrixType,_Preconditioner> >
|
||||
template <typename VectorType, typename IndexType>
|
||||
void sortWithPermutation (VectorType& vec, IndexType& perm, typename IndexType::Scalar& ncut)
|
||||
{
|
||||
assert(vec.size() == perm.size());
|
||||
eigen_assert(vec.size() == perm.size());
|
||||
typedef typename IndexType::Scalar Index;
|
||||
typedef typename VectorType::Scalar Scalar;
|
||||
Index n = vec.size();
|
||||
@@ -525,4 +525,4 @@ struct solve_retval<DGMRES<_MatrixType, _Preconditioner>, Rhs>
|
||||
} // end namespace internal
|
||||
|
||||
} // end namespace Eigen
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Eigen {
|
||||
VectorType w_new(precond.solve(v_new)); // initialize w_new
|
||||
// RealScalar beta; // will be initialized inside loop
|
||||
RealScalar beta_new2(v_new.dot(w_new));
|
||||
assert(beta_new2 >= 0 && "PRECONDITIONER IS NOT POSITIVE DEFINITE");
|
||||
eigen_assert(beta_new2 >= 0 && "PRECONDITIONER IS NOT POSITIVE DEFINITE");
|
||||
RealScalar beta_new(sqrt(beta_new2));
|
||||
const RealScalar beta_one(beta_new);
|
||||
v_new /= beta_new;
|
||||
@@ -91,7 +91,7 @@ namespace Eigen {
|
||||
v_new -= alpha*v; // overwrite v_new
|
||||
w_new = precond.solve(v_new); // overwrite w_new
|
||||
beta_new2 = v_new.dot(w_new); // compute beta_new
|
||||
assert(beta_new2 >= 0 && "PRECONDITIONER IS NOT POSITIVE DEFINITE");
|
||||
eigen_assert(beta_new2 >= 0 && "PRECONDITIONER IS NOT POSITIVE DEFINITE");
|
||||
beta_new = sqrt(beta_new2); // compute beta_new
|
||||
v_new /= beta_new; // overwrite v_new for next iteration
|
||||
w_new /= beta_new; // overwrite w_new for next iteration
|
||||
|
||||
@@ -73,7 +73,7 @@ class IterScaling
|
||||
{
|
||||
int m = mat.rows();
|
||||
int n = mat.cols();
|
||||
assert((m>0 && m == n) && "Please give a non - empty matrix");
|
||||
eigen_assert((m>0 && m == n) && "Please give a non - empty matrix");
|
||||
m_left.resize(m);
|
||||
m_right.resize(n);
|
||||
m_left.setOnes();
|
||||
@@ -182,4 +182,4 @@ class IterScaling
|
||||
int m_maxits; // Maximum number of iterations allowed
|
||||
};
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user