<h3>lac</h3>
<ol>
+ <li> <p>
+ Improved: All matrix (and some vector) classes now check whether
+ entries written into them represent finite floating point
+ values. This should catch some bugs earlier where one writes
+ infinite or NaN values into a matrix only to realize later that
+ the linear solver fails.
+ <br>
+ (Stephan Kramer, WB 2006/03/15)
+ </p>
+
<li> <p>
Changed: There are new <code
class="class">FullMatrix</code>::<code
* Set the element <tt>(i,j)</tt>
* to <tt>value</tt>. Throws an
* error if the entry does not
- * exist. Still, it is allowed to
- * store zero values in
- * non-existent fields.
+ * exist or if <tt>value</tt> is
+ * not a finite number. Still, it
+ * is allowed to store zero
+ * values in non-existent fields.
*/
void set (const unsigned int i,
const unsigned int j,
const value_type value);
/**
- * Add <tt>value</tt> to the element
- * <tt>(i,j)</tt>. Throws an error if
- * the entry does not
- * exist. Still, it is allowed to
- * store zero values in
+ * Add <tt>value</tt> to the
+ * element <tt>(i,j)</tt>.
+ * Throws an error if the entry
+ * does not exist or if
+ * <tt>value</tt> is not a finite
+ * number. Still, it is allowed
+ * to store zero values in
* non-existent fields.
*/
void add (const unsigned int i,
const unsigned int j,
const value_type value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
const std::pair<unsigned int,unsigned int>
row_index = row_block_indices.global_to_local (i),
col_index = column_block_indices.global_to_local (j);
const unsigned int j,
const value_type value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
// save some cycles for zero additions, but
// only if it is safe for the matrix we are
// working with
unsigned int n () const;
/**
- * Set the element <tt>(i,j)</tt> to
- * @p value. Throws an error if
- * the entry does not
- * exist. Still, it is allowed to
- * store zero values in
- * non-existent fields.
+ * Set the element <tt>(i,j)</tt>
+ * to @p value. Throws an error
+ * if the entry does not exist or
+ * if <tt>value</tt> is not a
+ * finite number. Still, it is
+ * allowed to store zero values
+ * in non-existent fields.
*/
void set (const unsigned int i,
const unsigned int j,
/**
* Add @p value to the element
- * <tt>(i,j)</tt>. Throws an error if
- * the entry does not
- * exist. Still, it is allowed to
- * store zero values in
- * non-existent fields.
+ * <tt>(i,j)</tt>. Throws an
+ * error if the entry does not
+ * exist or if <tt>value</tt> is
+ * not a finite number. Still, it
+ * is allowed to store zero
+ * values in non-existent fields.
*/
void add (const unsigned int i, const unsigned int j,
const Number value);
const unsigned int j,
const Number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
const std::pair<unsigned int,unsigned int>
row_index = row_indices.global_to_local (i),
col_index = column_indices.global_to_local (j);
const unsigned int j,
const Number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
const std::pair<unsigned int,unsigned int>
row_index = row_indices.global_to_local (i),
col_index = column_indices.global_to_local (j);
BlockVector<Number> &
BlockVector<Number>::operator = (const value_type s)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
BaseClass::operator = (s);
return *this;
}
template <typename Number>
void BlockVector<Number>::scale (const value_type factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
for (unsigned int i=0; i<this->n_blocks();++i)
this->components[i].scale(factor);
}
template <class VectorType>
void BlockVectorBase<VectorType>::add (const value_type a)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
for (unsigned int i=0;i<n_blocks();++i)
{
components[i].add(a);
void BlockVectorBase<VectorType>::add (const value_type a,
const BlockVectorBase<VectorType>& v)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const value_type b,
const BlockVectorBase<VectorType>& w)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
Assert (n_blocks() == w.n_blocks(),
void BlockVectorBase<VectorType>::sadd (const value_type x,
const BlockVectorBase<VectorType>& v)
{
+
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
void BlockVectorBase<VectorType>::sadd (const value_type x, const value_type a,
const BlockVectorBase<VectorType>& v)
{
+
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
const value_type b,
const BlockVectorBase<VectorType>& w)
{
+
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
Assert (n_blocks() == w.n_blocks(),
const value_type c,
const BlockVectorBase<VectorType>& y)
{
+
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(c),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
Assert (n_blocks() == w.n_blocks(),
const value_type b,
const BlockVectorBase<VectorType>& w)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
Assert (n_blocks() == w.n_blocks(),
void BlockVectorBase<VectorType>::equ (const value_type a,
const BlockVector2 &v)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (n_blocks() == v.n_blocks(),
ExcDimensionMismatch(n_blocks(), v.n_blocks()));
BlockVectorBase<VectorType>&
BlockVectorBase<VectorType>::operator = (const value_type s)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
for (unsigned int i=0;i<n_blocks();++i)
components[i] = s;
BlockVectorBase<VectorType> &
BlockVectorBase<VectorType>::operator *= (const value_type factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
for (unsigned int i=0;i<n_blocks();++i)
components[i] *= factor;
BlockVectorBase<VectorType> &
BlockVectorBase<VectorType>::operator /= (const value_type factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (factor > 0., ExcZero() );
+
for (unsigned int i=0;i<n_blocks();++i)
components[i] /= factor;
number
FullMatrix<number>::Accessor::value() const
{
+ Assert (deal_II_numbers::is_finite( matrix->el(a_row, a_col) ),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
return matrix->el(a_row, a_col);
}
FullMatrix<number> &
FullMatrix<number>::operator *= (const double factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
number *p = &this->el(0,0);
const number *e = &this->el(0,0) + n()*m();
while (p != e)
FullMatrix<number> &
FullMatrix<number>::operator /= (const double factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
number *p = &this->el(0,0);
const number *e = &this->el(0,0) + n()*m();
const number factor_inv = 1./factor;
-
+
+ Assert (deal_II_numbers::is_finite(factor_inv),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
while (p != e)
*p++ *= factor_inv;
* contrast to the SparseMatrix
* class which throws an error
* if the entry does not exist.
- */
+ * If <tt>value</tt> is not a
+ * finite number an exception
+ * is thrown.
+ */
void set (const unsigned int i,
const unsigned int j,
const PetscScalar value);
* contrast to the SparseMatrix
* class which throws an error
* if the entry does not exist.
+ * If <tt>value</tt> is not a
+ * finite number an exception
+ * is thrown.
*/
void add (const unsigned int i,
const unsigned int j,
* Set the element (<i>i,j</i>)
* to <tt>value</tt>. Throws an
* error if the entry does not
- * exist. Still, it is allowed to
- * store zero values in
- * non-existent fields.
+ * exist or if <tt>value</tt> is
+ * not a finite number. Still, it
+ * is allowed to store zero
+ * values in non-existent fields.
*/
void set (const unsigned int i,
const unsigned int j,
* Add <tt>value</tt> to the
* element (<i>i,j</i>). Throws
* an error if the entry does not
- * exist. Still, it is allowed to
- * store zero values in
- * non-existent fields.
+ * exist or if <tt>value</tt> is
+ * not a finite number. Still, it
+ * is allowed to store zero
+ * values in non-existent fields.
*/
void add (const unsigned int i,
const unsigned int j,
const unsigned int j,
const number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (cols != 0, ExcNotInitialized());
// it is allowed to set elements of
// the matrix that are not part of
const unsigned int j,
const number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (cols != 0, ExcNotInitialized());
const unsigned int index = cols->operator()(i,j);
* @p value. Allocates the entry,
* if it does not exist and
* @p value is non-zero.
+ * If <tt>value</tt> is not a
+ * finite number an exception
+ * is thrown.
*/
void set (const unsigned int i, const unsigned int j,
const number value);
* <tt>(i,j)</tt>. Allocates the entry
* if it does not exist. Filters
* out zeroes automatically.
+ * If <tt>value</tt> is not a
+ * finite number an exception
+ * is thrown.
*/
void add (const unsigned int i, const unsigned int j,
const number value);
const unsigned int j,
const number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (i<m(), ExcIndexRange(i,0,m()));
Assert (j<n(), ExcIndexRange(j,0,n()));
const unsigned int j,
const number value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (i<m(), ExcIndexRange(i,0,m()));
Assert (j<n(), ExcIndexRange(j,0,n()));
inline
Vector<Number> & Vector<Number>::operator = (const Number s)
{
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
if (s != 0.)
Assert (vec_size!=0, ExcEmptyObject());
if (vec_size!=0)
inline
Vector<Number> & Vector<Number>::operator *= (const Number factor)
{
+
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
scale (factor);
return *this;
}
inline
Vector<Number> & Vector<Number>::operator /= (const Number factor)
{
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (factor > 0., ExcZero() );
+
*this *= (1./factor);
return *this;
}
template <typename Number>
inline Number sqr (const Number x)
{
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
return x*x;
}
}
template <typename Number>
void Vector<Number>::add (const Number a, const Vector<Number>& v)
{
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
void Vector<Number>::add (const Number a, const Vector<Number>& v,
const Number b, const Vector<Number>& w)
{
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
template <typename Number>
void Vector<Number>::sadd (const Number x, const Vector<Number>& v)
{
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
iterator i_ptr = begin(),
void Vector<Number>::sadd (const Number x, const Number a,
const Vector<Number>& v)
{
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
iterator i_ptr = begin(),
const Vector<Number>& v, const Number b,
const Vector<Number>& w)
{
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
const Vector<Number>& w, const Number c,
const Vector<Number>& y)
{
+ Assert (deal_II_numbers::is_finite(x),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(c),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
template <typename Number>
void Vector<Number>::scale (const Number factor)
{
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
iterator ptr = begin();
template <typename Number2>
void Vector<Number>::equ (const Number a, const Vector<Number2>& u)
{
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
iterator i_ptr = begin(),
void Vector<Number>::equ (const Number a, const Vector<Number>& u,
const Number b, const Vector<Number>& v)
{
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
// $Id$
// Version: $Name$
//
-// Copyright (C) 2004, 2005 by the deal.II authors
+// Copyright (C) 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
const unsigned int j,
const PetscScalar value)
{
+
+ Assert (!std::isnan(value) && !std::isinf(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
if (last_action != LastAction::insert)
{
int ierr;
const unsigned int j,
const PetscScalar value)
{
+
+ Assert (deal_II_numbers::is_finite(value),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
if (last_action != LastAction::add)
{
int ierr;
// $Id$
// Version: $Name$
//
-// Copyright (C) 2004, 2005 by the deal.II authors
+// Copyright (C) 2004, 2005, 2006 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
VectorBase &
VectorBase::operator = (const PetscScalar s)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
// flush previously cached elements. this
// seems to be necessary since petsc
// 2.2.1, at least for parallel vectors
VectorBase &
VectorBase::operator *= (const PetscScalar a)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
#if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
const int ierr = VecScale (&a, vector);
#else
VectorBase &
VectorBase::operator /= (const PetscScalar a)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
const PetscScalar factor = 1./a;
+ Assert (deal_II_numbers::is_finite(factor),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
#if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
const int ierr = VecScale (&factor, vector);
#else
void
VectorBase::add (const PetscScalar s)
{
- #if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
+#if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
const int ierr = VecShift (&s, vector);
#else
const int ierr = VecShift (vector, s);
VectorBase::add (const PetscScalar a,
const VectorBase &v)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
#if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
const int ierr = VecAXPY (&a, v, vector);
#else
const PetscScalar b,
const VectorBase &w)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
const PetscScalar weights[2] = {a,b};
Vec addends[2] = {v.vector, w.vector};
VectorBase::sadd (const PetscScalar s,
const VectorBase &v)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
#if (PETSC_VERSION_MAJOR <= 2) && (PETSC_VERSION_MINOR < 3)
const int ierr = VecAYPX (&s, v, vector);
#else
const PetscScalar a,
const VectorBase &v)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
// there is nothing like a AXPAY
// operation in Petsc, so do it in two
// steps
const PetscScalar b,
const VectorBase &w)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
// there is no operation like MAXPAY, so
// do it in two steps
*this *= s;
const PetscScalar c,
const VectorBase &x)
{
+
+ Assert (deal_II_numbers::is_finite(s),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(c),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
// there is no operation like MAXPAY, so
// do it in two steps
*this *= s;
VectorBase::equ (const PetscScalar a,
const VectorBase &v)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (size() == v.size(),
ExcDimensionMismatch (size(), v.size()));
const PetscScalar b,
const VectorBase &w)
{
+
+ Assert (deal_II_numbers::is_finite(a),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+ Assert (deal_II_numbers::is_finite(b),
+ ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
+
Assert (size() == v.size(),
ExcDimensionMismatch (size(), v.size()));