* those in the <tt>C++</tt> standard libraries
* <tt>vector<...></tt> class.
*/
- typedef Number value_type;
- typedef value_type *pointer;
- typedef const value_type *const_pointer;
- typedef value_type *iterator;
- typedef const value_type *const_iterator;
- typedef value_type &reference;
- typedef const value_type &const_reference;
- typedef size_t size_type;
+ typedef Number value_type;
+ typedef typename numbers::NumberTraits<Number>::real_type real_type;
+ typedef value_type *pointer;
+ typedef const value_type *const_pointer;
+ typedef value_type *iterator;
+ typedef const value_type *const_iterator;
+ typedef value_type &reference;
+ typedef const value_type &const_reference;
+ typedef size_t size_type;
/**
/**
* Return square of the $l_2$-norm.
*/
- Number norm_sqr () const;
+ real_type norm_sqr () const;
/**
* Mean value of the elements of
* $l_1$-norm of the vector.
* The sum of the absolute values.
*/
- Number l1_norm () const;
+ real_type l1_norm () const;
/**
* $l_2$-norm of the vector. The
* square root of the sum of the
* squares of the elements.
*/
- Number l2_norm () const;
+ real_type l2_norm () const;
/**
* $l_p$-norm of the vector. The
* powers of the absolute values
* of the elements.
*/
- Number lp_norm (const Number p) const;
+ real_type lp_norm (const real_type p) const;
/**
* Maximum absolute value of the
* elements.
*/
- Number linfty_norm () const;
+ real_type linfty_norm () const;
/**
* Return dimension of the vector.
* used, for example, to check whether
* refinement indicators are really all
* positive (or zero).
+ *
+ * The function obviously only makes
+ * sense if the template argument of this
+ * class is a real type. If it is a
+ * complex type, then an exception is
+ * thrown.
*/
bool is_non_negative () const;
/**
- * Make the @p Vector class a bit like the
- * <tt>vector<></tt> class of the C++ standard
- * library by returning iterators to
- * the start and end of the elements of this
- * vector.
+ * Make the @p Vector class a bit like
+ * the <tt>vector<></tt> class of the C++
+ * standard library by returning
+ * iterators to the start and end of the
+ * elements of this vector.
*/
iterator begin ();
*/
//@{
/**
- * Output of vector in user-defined format.
+ * Output of vector in user-defined
+ * format. For complex-valued vectors,
+ * the format should include specifiers
+ * for both the real and imaginary
+ * parts.
*/
void print (const char* format = 0) const;
{
Assert (numbers::is_finite(factor),
ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- Assert (factor != 0., ExcZero() );
+ Assert (factor != Number(0.), ExcZero() );
- *this *= (1./factor);
+ this->operator *= (Number(1.)/factor);
return *this;
}
#include <base/template_constraints.h>
+#include <base/numbers.h>
#include <lac/vector.h>
#include <lac/block_vector.h>
DEAL_II_NAMESPACE_OPEN
-/*
- Note that in this file, we use std::fabs, std::sqrt, etc
- everywhere. The reason is that we want to use those version of these
- functions that take a variable of the template type "Number", rather
- than the C standard function which accepts and returns a double. The
- C++ standard library therefore offers overloaded versions of these
- functions taking floats, or long doubles, with the importance on the
- additional accuracy when using long doubles.
- */
-
namespace internal
{
- namespace VectorHelper
+ template <typename T>
+ bool is_non_negative (const T &t)
{
- template <typename Number>
- inline Number sqr (const Number x)
- {
- Assert (numbers::is_finite(x),
- ExcMessage("The given value is not finite but either infinite or Not A Number (NaN)"));
- return x*x;
- }
+ return t >= 0;
+ }
+
+
+ template <typename T>
+ bool is_non_negative (const std::complex<T> &)
+ {
+ Assert (false,
+ ExcMessage ("Complex numbers do not have an ordering."));
+
+ return false;
}
-}
+ template <typename T>
+ void print (const T &t,
+ const char *format)
+ {
+ if (format != 0)
+ std::printf (format, t);
+ else
+ std::printf (" %5.2f", double(t));
+ }
+
+
+
+ template <typename T>
+ void print (const std::complex<T> &t,
+ const char *format)
+ {
+ if (format != 0)
+ std::printf (format, t.real(), t.imag());
+ else
+ std::printf (" %5.2f+%5.2fi",
+ double(t.real()), double(t.imag()));
+ }
+}
template <typename Number>
Vector<Number>::Vector (const Vector<Number>& v)
- : Subscriptor(),
+ :
+ Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
val(0)
template <typename Number>
template <typename OtherNumber>
Vector<Number>::Vector (const Vector<OtherNumber>& v)
- : Subscriptor(),
+ :
+ Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
val(0)
template <typename Number>
Vector<Number>::Vector (const PETScWrappers::Vector &v)
- : Subscriptor(),
+ :
+ Subscriptor(),
vec_size(v.size()),
max_vec_size(v.size()),
val(0)
template <typename Number>
Vector<Number>::Vector (const PETScWrappers::MPI::Vector &v)
- : Subscriptor(),
+ :
+ Subscriptor(),
vec_size(0),
max_vec_size(0),
val(0)
template <typename Number>
template <typename Number2>
-void Vector<Number>::reinit (const Vector<Number2>& v, const bool fast)
+void Vector<Number>::reinit (const Vector<Number2>& v,
+ const bool fast)
{
reinit (v.size(), fast);
}
void
Vector<Number>::swap (Vector<Number> &v)
{
- std::swap (vec_size, v.vec_size);
+ std::swap (vec_size, v.vec_size);
std::swap (max_vec_size, v.max_vec_size);
- std::swap (val, v.val);
+ std::swap (val, v.val);
}
Vector<Number>::all_zero () const
{
Assert (vec_size!=0, ExcEmptyObject());
-
- const_iterator p = begin(),
- e = end();
- while (p!=e)
- if (*p++ != 0.0)
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ if (val[i] != Number(0))
return false;
return true;
}
{
Assert (vec_size!=0, ExcEmptyObject());
- const_iterator p = begin(),
- e = end();
- while (p!=e)
- if (*p++ < 0.0)
+ for (unsigned int i=0; i<vec_size; ++i)
+ if ( ! internal::is_non_negative (val[i]))
return false;
+
return true;
}
if (PointerComparison::equal (this, &v))
return norm_sqr();
- Assert (vec_size == v.size(), ExcDimensionMismatch(vec_size, v.size()));
+ Assert (vec_size == v.size(),
+ ExcDimensionMismatch(vec_size, v.size()));
- Number sum0 = 0,
- sum1 = 0,
- sum2 = 0,
- sum3 = 0;
-
- // use modern processors better by
- // allowing pipelined commands to be
- // executed in parallel
- const_iterator ptr = begin(),
- eptr = ptr + (vec_size/4)*4;
- typename Vector<Number2>::const_iterator vptr = v.begin();
- while (ptr!=eptr)
- {
- sum0 += (*ptr++ * *vptr++);
- sum1 += (*ptr++ * *vptr++);
- sum2 += (*ptr++ * *vptr++);
- sum3 += (*ptr++ * *vptr++);
- };
- // add up remaining elements
- while (ptr != end())
- sum0 += *ptr++ * *vptr++;
+ Number sum = 0;
+
+ // multiply the two vectors. we have to
+ // convert the elements of u to the type of
+ // the result vector. this is necessary
+ // because
+ // operator*(complex<float>,complex<double>)
+ // is not defined by default
+ for (unsigned int i=0; i<vec_size; ++i)
+ sum += numbers::NumberTraits<Number>::conjugate(val[i]) * Number(v.val[i]);
- return sum0+sum1+sum2+sum3;
+ return sum;
}
template <typename Number>
-Number Vector<Number>::norm_sqr () const
+typename Vector<Number>::real_type
+Vector<Number>::norm_sqr () const
{
Assert (vec_size!=0, ExcEmptyObject());
- Number sum0 = 0,
- sum1 = 0,
- sum2 = 0,
- sum3 = 0;
-
- // use modern processors better by
- // allowing pipelined commands to be
- // executed in parallel
- const_iterator ptr = begin(),
- eptr = ptr + (vec_size/4)*4;
- while (ptr!=eptr)
- {
- sum0 += internal::VectorHelper::sqr(*ptr++);
- sum1 += internal::VectorHelper::sqr(*ptr++);
- sum2 += internal::VectorHelper::sqr(*ptr++);
- sum3 += internal::VectorHelper::sqr(*ptr++);
- };
- // add up remaining elements
- while (ptr != end())
- sum0 += internal::VectorHelper::sqr(*ptr++);
+ real_type sum = 0;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ sum += numbers::NumberTraits<Number>::abs_square(val[i]);
- return sum0+sum1+sum2+sum3;
+ return sum;
}
{
Assert (vec_size!=0, ExcEmptyObject());
- Number sum0 = 0,
- sum1 = 0,
- sum2 = 0,
- sum3 = 0;
-
- // use modern processors better by
- // allowing pipelined commands to be
- // executed in parallel
- const_iterator ptr = begin(),
- eptr = ptr + (vec_size/4)*4;
- while (ptr!=eptr)
- {
- sum0 += *ptr++;
- sum1 += *ptr++;
- sum2 += *ptr++;
- sum3 += *ptr++;
- };
- // add up remaining elements
- while (ptr != end())
- sum0 += *ptr++;
+ Number sum = 0;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ sum += val[i];
- return (sum0+sum1+sum2+sum3)/size();
+ return sum / real_type(size());
}
template <typename Number>
-Number Vector<Number>::l1_norm () const
+typename Vector<Number>::real_type
+Vector<Number>::l1_norm () const
{
Assert (vec_size!=0, ExcEmptyObject());
- Number sum0 = 0,
- sum1 = 0,
- sum2 = 0,
- sum3 = 0;
-
- // use modern processors better by
- // allowing pipelined commands to be
- // executed in parallel
- const_iterator ptr = begin(),
- eptr = ptr + (vec_size/4)*4;
- while (ptr!=eptr)
- {
- sum0 += std::fabs(*ptr++);
- sum1 += std::fabs(*ptr++);
- sum2 += std::fabs(*ptr++);
- sum3 += std::fabs(*ptr++);
- };
- // add up remaining elements
- while (ptr != end())
- sum0 += std::fabs(*ptr++);
-
- return sum0+sum1+sum2+sum3;
+ real_type sum = 0;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ sum += numbers::NumberTraits<Number>::abs(val[i]);
+
+ return sum;
}
+
template <typename Number>
-Number Vector<Number>::l2_norm () const
+typename Vector<Number>::real_type
+Vector<Number>::l2_norm () const
{
return std::sqrt(norm_sqr());
}
+
template <typename Number>
-Number Vector<Number>::lp_norm (const Number p) const
+typename Vector<Number>::real_type
+Vector<Number>::lp_norm (const real_type p) const
{
Assert (vec_size!=0, ExcEmptyObject());
- Number sum0 = 0,
- sum1 = 0,
- sum2 = 0,
- sum3 = 0;
-
- // use modern processors better by
- // allowing pipelined commands to be
- // executed in parallel
- const_iterator ptr = begin(),
- eptr = ptr + (vec_size/4)*4;
- while (ptr!=eptr)
- {
- sum0 += std::pow(std::fabs(*ptr++), p);
- sum1 += std::pow(std::fabs(*ptr++), p);
- sum2 += std::pow(std::fabs(*ptr++), p);
- sum3 += std::pow(std::fabs(*ptr++), p);
- };
- // add up remaining elements
- while (ptr != end())
- sum0 += std::pow(std::fabs(*ptr++), p);
+ real_type sum = 0;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ sum += std::pow (numbers::NumberTraits<Number>::abs(val[i]), p);
- return std::pow(sum0+sum1+sum2+sum3,
- static_cast<Number>(1./p));
+ return std::pow(sum, static_cast<real_type>(1./p));
}
+
template <typename Number>
-Number Vector<Number>::linfty_norm () const
+typename Vector<Number>::real_type
+Vector<Number>::linfty_norm () const
{
Assert (vec_size!=0, ExcEmptyObject());
- Number max0=0.,
- max1=0.,
- max2=0.,
- max3=0.;
- for (unsigned int i=0; i<(vec_size/4); ++i)
- {
- if (max0<std::fabs(val[4*i])) max0=std::fabs(val[4*i]);
- if (max1<std::fabs(val[4*i+1])) max1=std::fabs(val[4*i+1]);
- if (max2<std::fabs(val[4*i+2])) max2=std::fabs(val[4*i+2]);
- if (max3<std::fabs(val[4*i+3])) max3=std::fabs(val[4*i+3]);
- };
- // add up remaining elements
- for (unsigned int i=(vec_size/4)*4; i<vec_size; ++i)
- if (max0<std::fabs(val[i]))
- max0 = std::fabs(val[i]);
+ real_type max = 0;
- return std::max (std::max(max0, max1),
- std::max(max2, max3));
+ for (unsigned int i=0; i<vec_size; ++i)
+ max = std::max (numbers::NumberTraits<Number>::abs(val[i]), max);
+
+ return max;
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator v_ptr = v.begin();
- while (i_ptr!=i_end)
- *i_ptr++ -= *v_ptr++;
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] -= v.val[i];
return *this;
}
{
Assert (vec_size!=0, ExcEmptyObject());
- iterator i_ptr = begin(),
- i_end = end();
- while (i_ptr!=i_end)
- *i_ptr++ += v;
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] += v;
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator v_ptr = v.begin();
- while (i_ptr!=i_end)
- *i_ptr++ += *v_ptr++;
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] += v.val[i];
}
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));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator v_ptr = v.begin(),
- w_ptr = w.begin();
- while (i_ptr!=i_end)
- *i_ptr++ += a * *v_ptr++ + b * *w_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] += a*v.val[i] + b*w.val[i];
}
template <typename Number>
-void Vector<Number>::sadd (const Number x, const Vector<Number>& v)
+void Vector<Number>::sadd (const Number x,
+ const Vector<Number>& v)
{
Assert (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(),
- i_end = end();
- const_iterator v_ptr = v.begin();
- for (; i_ptr!=i_end; ++i_ptr)
- *i_ptr = x * *i_ptr + *v_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = x*val[i] + v.val[i];
}
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));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator v_ptr = v.begin(),
- w_ptr = w.begin();
- for (; i_ptr!=i_end; ++i_ptr)
- *i_ptr = x * *i_ptr + a * *v_ptr++ + b * *w_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = x*val[i] + a*v.val[i] + b*w.val[i];
}
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
Assert (vec_size == y.vec_size, ExcDimensionMismatch(vec_size, y.vec_size));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator v_ptr = v.begin(),
- w_ptr = w.begin(),
- y_ptr = y.begin();
-
- for (; i_ptr!=i_end; ++i_ptr)
- *i_ptr = (x * *i_ptr) + (a * *v_ptr++) + (b * *w_ptr++) + (c * *y_ptr++);
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = x*val[i] + a*v.val[i] + b*w.val[i] +c*y.val[i];
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == s.vec_size, ExcDimensionMismatch(vec_size, s.vec_size));
- iterator ptr = begin();
- const const_iterator eptr = end();
- typename Vector<Number2>::const_iterator sptr = s.begin();
- while (ptr!=eptr)
- *ptr++ *= *sptr++;
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] *= s.val[i];
}
template <typename Number>
template <typename Number2>
-void Vector<Number>::equ (const Number a, const Vector<Number2>& u)
+void Vector<Number>::equ (const Number a,
+ const Vector<Number2>& u)
{
Assert (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(),
- i_end = end();
- typename Vector<Number2>::const_iterator u_ptr = u.begin();
- while (i_ptr!=i_end)
- *i_ptr++ = a * *u_ptr++;
+
+ // set the result vector to a*u. we have to
+ // convert the elements of u to the type of
+ // the result vector. this is necessary
+ // because
+ // operator*(complex<float>,complex<double>)
+ // is not defined by default
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = a * Number(u.val[i]);
}
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));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator u_ptr = u.begin(),
- v_ptr = v.begin();
- while (i_ptr!=i_end)
- *i_ptr++ = a * *u_ptr++ + b * *v_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = a * u.val[i] + b * v.val[i];
}
Assert (vec_size == u.vec_size, ExcDimensionMismatch(vec_size, u.vec_size));
Assert (vec_size == v.vec_size, ExcDimensionMismatch(vec_size, v.vec_size));
Assert (vec_size == w.vec_size, ExcDimensionMismatch(vec_size, w.vec_size));
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator u_ptr = u.begin(),
- v_ptr = v.begin(),
- w_ptr = w.begin();
- while (i_ptr!=i_end)
- *i_ptr++ = a * *u_ptr++ + b * *v_ptr++ + c * *w_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = a * u.val[i] + b * v.val[i] + c * w.val[i];
}
template <typename Number>
-void Vector<Number>::ratio (const Vector<Number> &a, const Vector<Number> &b)
+void Vector<Number>::ratio (const Vector<Number> &a,
+ const Vector<Number> &b)
{
Assert (vec_size!=0, ExcEmptyObject());
- Assert (a.vec_size == b.vec_size, ExcDimensionMismatch (a.vec_size, b.vec_size));
+ Assert (a.vec_size == b.vec_size,
+ ExcDimensionMismatch (a.vec_size, b.vec_size));
// no need to reinit with zeros, since
// we overwrite them anyway
reinit (a.size(), true);
- iterator i_ptr = begin(),
- i_end = end();
- const_iterator a_ptr = a.begin(),
- b_ptr = b.begin();
- while (i_ptr!=i_end)
- *i_ptr++ = *a_ptr++ / *b_ptr++;
+
+ for (unsigned int i=0; i<vec_size; ++i)
+ val[i] = a.val[i] / b.val[i];
}
Assert (vec_size!=0, ExcEmptyObject());
Assert (vec_size == v.size(), ExcDimensionMismatch(vec_size, v.size()));
+ // compare the two vector. we have to
+ // convert the elements of v to the type of
+ // the result vector. this is necessary
+ // because
+ // operator==(complex<float>,complex<double>)
+ // is not defined by default
for (unsigned int i=0; i<vec_size; ++i)
- if (val[i] != v.val[i])
+ if (val[i] != Number(v.val[i]))
return false;
return true;
template <typename Number>
-void Vector<Number>::print (const char* format) const
+void Vector<Number>::print (const char *format) const
{
Assert (vec_size!=0, ExcEmptyObject());
- if (!format) format = " %5.2f";
- for (unsigned int j=0;j<size();j++)
- std::printf (format, val[j]);
+
+ for (unsigned int j=0; j<size(); ++j)
+ internal::print (val[j], format);
std::printf ("\n");
}
if (across)
for (unsigned int i=0; i<size(); ++i)
- out << static_cast<double>(val[i]) << ' ';
+ out << val[i] << ' ';
else
for (unsigned int i=0; i<size(); ++i)
- out << static_cast<double>(val[i]) << std::endl;
+ out << val[i] << std::endl;
out << std::endl;
AssertThrow (out, ExcIO());
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
template void Vector<float>::scale<double>(const Vector<double>&);
template void Vector<float>::scale<float>(const Vector<float>&);
+
+
+// complex data types
+template class Vector<std::complex<double> >;
+
+#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
+template Vector<std::complex<double> >::Vector (const Vector<std::complex<float> > &);
+#endif
+
+template Vector<std::complex<double> >& Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<float> >(const Vector<std::complex<float> >&);
+template bool Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==<std::complex<double> >(const Vector<std::complex<double> >&) const;
+template bool Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==<std::complex<float> >(const Vector<std::complex<float> >&) const;
+template std::complex<double> Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*<std::complex<float> >(const Vector<std::complex<float> >&) const;
+template std::complex<double> Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*<std::complex<double> >(const Vector<std::complex<double> >&) const;
+template void Vector<std::complex<double> >::reinit<std::complex<double> >(const Vector<std::complex<double> >&, const bool);
+template void Vector<std::complex<double> >::reinit<std::complex<float> >(const Vector<std::complex<float> >&, const bool);
+template void Vector<std::complex<double> >::equ<std::complex<double> >(const std::complex<double>, const Vector<std::complex<double> >&);
+template void Vector<std::complex<double> >::equ<std::complex<float> >(const std::complex<double>, const Vector<std::complex<float> >&);
+template void Vector<std::complex<double> >::scale<std::complex<double> >(const Vector<std::complex<double> >&);
+template void Vector<std::complex<double> >::scale<std::complex<float> >(const Vector<std::complex<float> >&);
+
+template class Vector<std::complex<float> >;
+
+#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG
+template Vector<std::complex<float> >::Vector (const Vector<std::complex<double> > &);
+#endif
+
+template Vector<std::complex<float> >& Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<double> >(const Vector<std::complex<double> >&);
+template bool Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==<std::complex<double> >(const Vector<std::complex<double> >&) const;
+template bool Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator==<std::complex<float> >(const Vector<std::complex<float> >&) const;
+template std::complex<float> Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*<std::complex<float> >(const Vector<std::complex<float> >&) const;
+template std::complex<float> Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator*<std::complex<double> >(const Vector<std::complex<double> >&) const;
+template void Vector<std::complex<float> >::reinit<std::complex<double> >(const Vector<std::complex<double> >&, const bool);
+template void Vector<std::complex<float> >::reinit<std::complex<float> >(const Vector<std::complex<float> >&, const bool);
+template void Vector<std::complex<float> >::equ<std::complex<double> >(const std::complex<float>, const Vector<std::complex<double> >&);
+template void Vector<std::complex<float> >::equ<std::complex<float> >(const std::complex<float>, const Vector<std::complex<float> >&);
+template void Vector<std::complex<float> >::scale<std::complex<double> >(const Vector<std::complex<double> >&);
+template void Vector<std::complex<float> >::scale<std::complex<float> >(const Vector<std::complex<float> >&);
+
DEAL_II_NAMESPACE_CLOSE
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
DEAL_II_NAMESPACE_OPEN
-// explicit instantiations
+// explicit instantiations for long double
template class Vector<long double>;
#if !defined(DEAL_II_EXPLICIT_CONSTRUCTOR_BUG) && !defined(DEAL_II_LONG_DOUBLE_LOOP_BUG)
template void Vector<float>::reinit<long double>(const Vector<long double>&, const bool);
template void Vector<float>::equ<long double>(const float, const Vector<long double>&);
+
+// explicit instantiations for std::complex<long double>
+template class Vector<std::complex<long double> >;
+
+#if !defined(DEAL_II_EXPLICIT_CONSTRUCTOR_BUG) && !defined(DEAL_II_LONG_DOUBLE_LOOP_BUG)
+template Vector<std::complex<long double> >::Vector (const Vector<std::complex<double> > &);
+template Vector<std::complex<long double> >::Vector (const Vector<std::complex<float> > &);
+
+template Vector<std::complex<double> >::Vector (const Vector<std::complex<long double> > &);
+template Vector<std::complex<float> >::Vector (const Vector<std::complex<long double> > &);
+#endif
+
+template Vector<std::complex<long double> >& Vector<std::complex<long double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<double> >(const Vector<std::complex<double> >&);
+template Vector<std::complex<long double> >& Vector<std::complex<long double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<float> >(const Vector<std::complex<float> >&);
+template std::complex<long double> Vector<std::complex<long double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator *<std::complex<long double> > (const Vector<std::complex<long double> > &) const;
+template std::complex<long double> Vector<std::complex<long double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator *<std::complex<double> > (const Vector<std::complex<double> > &) const;
+template std::complex<long double> Vector<std::complex<long double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator *<std::complex<float> > (const Vector<std::complex<float> > &) const;
+template void Vector<std::complex<long double> >::reinit<std::complex<long double> >(const Vector<std::complex<long double> >&, const bool);
+template void Vector<std::complex<long double> >::reinit<std::complex<double> >(const Vector<std::complex<double> >&, const bool);
+template void Vector<std::complex<long double> >::reinit<std::complex<float> >(const Vector<std::complex<float> >&, const bool);
+template void Vector<std::complex<long double> >::equ<std::complex<long double> >(const std::complex<long double>, const Vector<std::complex<long double> >&);
+template void Vector<std::complex<long double> >::equ<std::complex<double> >(const std::complex<long double>, const Vector<std::complex<double> >&);
+template void Vector<std::complex<long double> >::equ<std::complex<float> >(const std::complex<long double>, const Vector<std::complex<float> >&);
+
+template Vector<std::complex<double> >& Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<long double> >(const Vector<std::complex<long double> >&);
+template std::complex<double> Vector<std::complex<double> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator *<std::complex<long double> > (const Vector<std::complex<long double> > &) const;
+template void Vector<std::complex<double> >::reinit<std::complex<long double> >(const Vector<std::complex<long double> >&, const bool);
+template void Vector<std::complex<double> >::equ<std::complex<long double> >(const std::complex<double>, const Vector<std::complex<long double> >&);
+
+template Vector<std::complex<float> >& Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator=<std::complex<long double> >(const Vector<std::complex<long double> >&);
+template std::complex<float> Vector<std::complex<float> >::DEAL_II_MEMBER_OP_TEMPLATE_INST operator *<std::complex<long double> > (const Vector<std::complex<long double> > &) const;
+template void Vector<std::complex<float> >::reinit<std::complex<long double> >(const Vector<std::complex<long double> >&, const bool);
+template void Vector<std::complex<float> >::equ<std::complex<long double> >(const std::complex<float>, const Vector<std::complex<long double> >&);
+
DEAL_II_NAMESPACE_CLOSE
solver_* \
deal_solver_* \
vector_* \
+ complex-vector_* \
subdomain_ids_* \
dof_constraints_* \
apply_boundary_values_* \
--- /dev/null
+//---------------------------- vector_11.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_11.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::size()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the vector
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ v(i) = std::complex<double> (i+1., i+2.);
+
+ v.compress ();
+
+ Assert (v.size() == 100, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_11/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_12.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_12.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator() in set-mode
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+
+ v.compress ();
+
+ // check that they are ok, and this time
+ // all of them
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_12/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_13.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_13.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator() in add-mode
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) += std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+
+ v.compress ();
+
+ // check that they are ok, and this time
+ // all of them
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert ((((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0)))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_13/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_14.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_14.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator() in set/add-mode alternatingly
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ bool flag = false;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ if (flag == true)
+ v(i) += std::complex<double> (i+1., i+2.);
+ else
+ v(i) = std::complex<double> (i+1., i+2.);
+ flag = !flag;
+
+ pattern[i] = true;
+ }
+
+ v.compress ();
+
+ // check that they are ok, and this time
+ // all of them
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_14/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_15.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_15.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator() in set/add-mode alternatingly, but
+// writing to the same elements
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ v(i) += std::complex<double> (i+1., i+2.);
+
+ v.compress ();
+
+ // check that they are ok, and this time
+ // all of them
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i) == 2.*std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_15/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_16.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_16.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator() in set/add-mode alternatingly, but
+// writing and overwriting the same elements
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ v(i) += std::complex<double> (i+1., i+2.);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ v(i) = std::complex<double> (i+1., i+2.);
+
+ v.compress ();
+
+ // check that they are ok, and this time
+ // all of them
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double> (0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_16/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_17.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_17.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::l1_norm()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ double norm = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ norm += std::abs(std::complex<double> (i+1., i+2.));
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (v.l1_norm() == norm, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_17/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_18.cc ---------------------------
+// vector_18.cc,v 1.4 2004/02/26 17:25:45 wolf Exp
+// Version:
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_18.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::l2_norm()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ double norm = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ norm += std::abs(std::complex<double> (i+1., i+2.))*
+ std::abs(std::complex<double> (i+1., i+2.));
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (std::fabs((v.l2_norm() - std::sqrt(norm))/std::sqrt(norm)) < 1e-14, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_18/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_19.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_19.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::linfty_norm()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ double norm = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ norm = std::max(norm,
+ std::abs(std::complex<double> (i+1., i+2.)));
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (v.linfty_norm() == norm, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_19/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_20.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_20.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator *=
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+ v.compress ();
+
+ // multiply v with 5/4
+ v *= 5./4.;
+
+ // check that the entries are ok
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*5./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_20/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_21.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_21.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator /=
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+ v.compress ();
+
+ // multiply v with 3/4
+ v /= 4./3.;
+
+ // check that the entries are ok
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i) == std::complex<double> (i+1., i+2.)*3./4.))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_21/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_21_negative.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_21_negative.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator /=. the original check was that the factor
+// by which we divide must be positive. this is of course nonsensical, it
+// should have been that the factor is != 0...
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. have a bit pattern of where we
+ // actually wrote elements to
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = 1.*i*std::complex<double> (i+1., i+2.);
+ pattern[i] = true;
+ }
+ v.compress ();
+
+ // multiply v with 3/4
+ v /= -4./3.;
+
+ // check that the entries are ok
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (((pattern[i] == true) && (v(i)-(-1.*i*std::complex<double> (i+1., i+2.)*3./4.) == std::complex<double>(0)))
+ ||
+ ((pattern[i] == false) && (v(i) == std::complex<double>(0))),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_21_negative/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_22.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_22.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator*(Vector) on two vectors that are
+// orthogonal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector, but disjoint sets of elements
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ else
+ w(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+ w.compress ();
+
+ // make sure the scalar product is zero
+ Assert (v*w == std::complex<double>(0), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_22/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_23.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_23.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator*(Vector) on two vectors that are
+// not orthogonal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector, and record the expected scalar
+ // product
+ std::complex<double> product = 0;
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ if (i%3 == 0)
+ {
+ w(i) = std::complex<double> (i+1., i+2.);
+ product += 1.*i*std::complex<double> (i+1., i+2.);
+ }
+ }
+
+ v.compress ();
+ w.compress ();
+
+
+ // make sure the scalar product is correct
+ deallog << v*w << ' ' << w*v << ' '
+ << product << ' ' << std::conj(product) << std::endl;
+
+ Assert (v*w == product, ExcInternalError());
+
+ // also make sure that v*w=conj(w*v)
+ Assert (w*v == std::conj(product), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_23/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_24.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_24.cc ---------------------------
+
+
+// this test used to check for Vector::clear(). However, this
+// function has since been removed, so we test for v=0 instead, although that
+// may be covered by one of the other tests
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then clear it again and make sure the
+ // vector is really empty
+ const unsigned int sz = v.size();
+ v = 0;
+ Assert (v.size() == sz, ExcInternalError());
+ Assert (v.l2_norm() == 0, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_24/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_25.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_25.cc ---------------------------
+
+// check Vector::operator = (Scalar) with setting to zero
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then clear it again and make sure the
+ // vector is really empty
+ const unsigned int sz = v.size();
+ v = 0;
+ Assert (v.size() == sz, ExcInternalError());
+ Assert (v.l2_norm() == 0, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_25/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_26.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_26.cc ---------------------------
+
+// check Vector::operator = (scalar) with setting to a
+// nonzero value
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ const unsigned int sz = v.size();
+ v = 2;
+ Assert (v.size() == sz, ExcInternalError());
+ Assert (v.l2_norm() == std::sqrt(4.*sz), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_26/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_27.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_27.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator = (Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then copy it
+ Vector<std::complex<double> > w (v.size());
+ w = v;
+
+ // make sure they're equal
+ deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
+ << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
+ Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm()) <
+ 1e-14*(std::abs(v*w)),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_27/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_28.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_28.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator = (Vector), except that we don't
+// resize the vector to be copied to beforehand
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then copy it to a vector of different
+ // size
+ Vector<std::complex<double> > w (1);
+ w = v;
+
+ // make sure they're equal
+ deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
+ << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
+ Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm()) <
+ 1e-14*std::abs(v*w),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_28/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_29.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_29.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::reinit(fast)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ v.reinit (13, true);
+
+ Assert (v.size() == 13, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_29/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_30.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_30.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::reinit(!fast)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then resize with setting to zero
+ v.reinit (13, false);
+
+ Assert (v.size() == 13, ExcInternalError());
+ Assert (v.l2_norm() == 0, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_30/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_31.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_31.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::l2_norm()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ std::complex<double> norm = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ norm += std::conj(std::complex<double> (i+1., i+2.)) *
+ std::complex<double> (i+1., i+2.);
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (std::abs(v.norm_sqr() - norm) < 1e-14*std::abs(norm),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_31/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_32.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_32.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::mean_value()
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ std::complex<double> sum = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ sum += std::complex<double> (i+1., i+2.);
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (std::abs(v.mean_value() - sum/(1.*v.size())) <
+ 1e-14*std::abs(sum)/v.size(),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_32/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_33.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_33.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::lp_norm(3)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ std::complex<double> sum = 0;
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ sum += std::pow (std::abs(std::complex<double> (i+1., i+2.)),
+ 3);
+ }
+ v.compress ();
+
+ // then check the norm
+ Assert (std::abs(v.lp_norm(3) - std::pow(sum, 1./3.)) <
+ 1e-14*std::abs(std::pow(sum, 1./3.)),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_33/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_34.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_34.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::all_zero
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some elements of the vector
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ }
+ v.compress ();
+
+ // set them to zero again
+ v = 0;
+
+ // then check all_zero
+ Assert (v.all_zero() == true, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_34/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_35.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_35.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator+=(Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v += w;
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ if (i%3 == 0)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == std::complex<double> (i+1., i+2.)+1.*i,
+ ExcInternalError());
+ }
+ else
+ {
+ Assert (w(i) == 0., ExcInternalError());
+ Assert (v(i) == 1.*i, ExcInternalError());
+ }
+ }
+
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_35/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_36.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_36.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator-=(Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v -= w;
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ if (i%3 == 0)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == std::complex<double> (-1., -(i+2.)),
+ ExcInternalError());
+ }
+ else
+ {
+ Assert (w(i) == 0., ExcInternalError());
+ Assert (v(i) == 1.*i, ExcInternalError());
+ }
+ }
+
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_36/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_37.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_37.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::add (scalar)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ v(i) = std::complex<double> (i+1., i+2.);
+
+ v.compress ();
+
+ v.add (1.);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ Assert (v(i) == std::complex<double> (i+2., i+2.),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_37/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_38.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_38.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::add(Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.add (w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == 1.*i+std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_38/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_39.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_39.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::add(scalar, Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.add (2, w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_39/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_40.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_40.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::add(s,V,s,V)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w,
+ Vector<std::complex<double> > &x)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ x(i) = i+2.;
+ }
+
+ v.compress ();
+ w.compress ();
+ x.compress ();
+
+ v.add (2, w, 3, x);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ Assert (x(i) == i+2., ExcInternalError());
+ Assert (v(i) == 1.*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_40/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ Vector<std::complex<double> > x (100);
+ test (v,w,x);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_41.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_41.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::sadd(s, Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.sadd (2, w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == 2.*i+std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_41/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_42.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_42.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::sadd(scalar, scalar, Vector)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.sadd (3, 2, w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == 3.*i+2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_42/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_43.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_43.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::sadd(s,s,V,s,V)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w,
+ Vector<std::complex<double> > &x)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ x(i) = i+2.;
+ }
+
+ v.compress ();
+ w.compress ();
+ x.compress ();
+
+ v.sadd (1.5, 2, w, 3, x);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ Assert (x(i) == i+2., ExcInternalError());
+ Assert (v(i) == 1.5*i+2.*std::complex<double> (i+1., i+2.)+3*(i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_43/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ Vector<std::complex<double> > x (100);
+ test (v,w,x);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_44.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_44.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::sadd(s,s,V,s,V,s,V)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w,
+ Vector<std::complex<double> > &x,
+ Vector<std::complex<double> > &y)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ x(i) = i+2.;
+ y(i) = std::complex<double> (i+3., i+4.);
+ }
+
+ v.compress ();
+ w.compress ();
+ x.compress ();
+ y.compress ();
+
+ v.sadd (1.5, 2, w, 3, x, 4, y);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (x(i) == i+2., ExcInternalError());
+ Assert (y(i) == std::complex<double> (i+3., i+4.),
+ ExcInternalError());
+ Assert (v(i) ==
+ 1.5*i+2.*std::complex<double> (i+1., i+2.)+
+ 3.*(i+2.)+4.*std::complex<double> (i+3., i+4.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_44/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ Vector<std::complex<double> > x (100);
+ Vector<std::complex<double> > y (100);
+ test (v,w,x,y);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_45.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_45.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::scale
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.scale (w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.), ExcInternalError());
+ Assert (v(i) == 1.*i*std::complex<double> (i+1., i+2.), ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_45/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_46.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_46.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::equ (s,V)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ v.compress ();
+ w.compress ();
+
+ v.equ (2, w);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (v(i) == 2.*std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_46/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_47.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_47.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::equ (s,V,s,V)
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w,
+ Vector<std::complex<double> > &x)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = i;
+ w(i) = std::complex<double> (i+1., i+2.);
+ x(i) = i+2.;
+ }
+
+ v.compress ();
+ w.compress ();
+ x.compress ();
+
+ v.equ (2, w, 3, x);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+1., i+2.),
+ ExcInternalError());
+ Assert (x(i) == i+2., ExcInternalError());
+ Assert (v(i) == 2.*std::complex<double> (i+1., i+2.)+3.*(i+2.),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_47/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ Vector<std::complex<double> > x (100);
+ test (v,w,x);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_48.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_48.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::ratio
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w,
+ Vector<std::complex<double> > &x)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i+1., i+2.);
+ w(i) = std::complex<double> (i+2., i+3.);
+ x(i) = std::complex<double> (i+3., i+4.);
+ }
+
+ v.compress ();
+ w.compress ();
+ x.compress ();
+
+ v.ratio (w, x);
+
+ // make sure we get the expected result
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ Assert (w(i) == std::complex<double> (i+2., i+3.),
+ ExcInternalError());
+ Assert (x(i) == std::complex<double> (i+3., i+4.),
+ ExcInternalError());
+ Assert (std::abs(v(i) -
+ std::complex<double> (i+2., i+3.) /
+ std::complex<double> (i+3., i+4.)) < 1e-14*std::abs(v(i)),
+ ExcInternalError());
+ }
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_48/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ Vector<std::complex<double> > x (100);
+ test (v,w,x);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_49.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_49.cc ---------------------------
+
+
+// check copy constructor Vector<std::complex<double> >::Vector(Vector) for same template
+// argument
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set some entries of the vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ if (i%3 == 0)
+ v(i) = std::complex<double> (i+1., i+2.);
+ v.compress ();
+
+ // then copy it
+ Vector<std::complex<double> > w (v);
+
+ // make sure they're equal
+ deallog << std::abs(v*w) << ' ' << v.l2_norm() * w.l2_norm()
+ << ' ' << std::abs(v*w) - v.l2_norm() * w.l2_norm() << std::endl;
+ Assert (std::abs(std::abs(v*w) - v.l2_norm() * w.l2_norm())
+ < 1e-14*std::abs(v*w),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_49/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_57.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_57.cc ---------------------------
+
+
+// check Vector::is_non_zero
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ // set only certain elements of the
+ // vector. they are all positive
+ std::vector<bool> pattern (v.size(), false);
+ for (unsigned int i=0; i<v.size(); i+=1+i)
+ {
+ v(i) += i;
+ pattern[i] = true;
+ }
+
+ v.compress ();
+
+ // check that the vector is really
+ // non-negative
+ Assert (v.is_non_negative() == true, ExcInternalError());
+
+ // then set a single element to a negative
+ // value and check again
+ v(v.size()/2) = -1;
+ Assert (v.is_non_negative() == false, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_57/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_1.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_1.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator==(Vector<std::complex<double> >) for vectors that are not
+// equal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i+0., i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ Assert (!(v==w), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_1/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_2.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_2.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator==(Vector<std::complex<double> >) for vectors that are
+// equal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+ // but then copy elements and make sure the
+ // vectors are actually equal
+ v = w;
+ Assert (v==w, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_2/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_3.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_3.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator!=(Vector<std::complex<double> >) for vectors that are not
+// equal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ Assert (v.operator != (w), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_3/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_4.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_4.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator!=(Vector<std::complex<double> >) for vectors that are
+// equal
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<double> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+ // but then copy elements and make sure the
+ // vectors are actually equal
+ v = w;
+ Assert (! (v.operator != (w)), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_4/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<double> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_1.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_1.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator==(Vector<std::complex<float> >) for vectors that are not
+// equal and different template arguments
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<float> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ Assert (!(v==w), ExcInternalError());
+ Assert (!(w==v), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_5/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<float> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_2.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_2.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator==(Vector<std::complex<float> >) for vectors that are
+// equal and different template arguments
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<float> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+ // but then copy elements and make sure the
+ // vectors are actually equal
+ v = w;
+ Assert (v==w, ExcInternalError());
+ Assert (w==v, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_6/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<float> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_3.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_3.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator!=(Vector<std::complex<float> >) for vectors that are not
+// equal and different template arguments
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<float> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+
+ Assert (v!=w, ExcInternalError());
+ Assert (w!=v, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_7/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<float> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_equality_4.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_equality_4.cc ---------------------------
+
+
+// check Vector<std::complex<double> >::operator!=(Vector<std::complex<float> >) for vectors that are
+// equal and different template arguments
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+#include <vector>
+
+
+void test (Vector<std::complex<double> > &v,
+ Vector<std::complex<float> > &w)
+{
+ // set only certain elements of each
+ // vector
+ for (unsigned int i=0; i<v.size(); ++i)
+ {
+ v(i) = std::complex<double> (i, i+1.);
+ if (i%3 == 0)
+ w(i) = std::complex<double> (i+1., i+2.);
+ }
+ // but then copy elements and make sure the
+ // vectors are actually equal
+ v = w;
+ Assert (! (v!=w), ExcInternalError());
+ Assert (! (w!=v), ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_equality_8/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ Vector<std::complex<float> > w (100);
+ test (v,w);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+//---------------------------- vector_vector_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2004, 2005, 2007 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- vector_vector_01.cc ---------------------------
+
+
+// check existence Vector<std::complex<double> >::Vector(Vector<std::complex<float> >). this conversion
+// constructor was disabled previously altogether because of a compiler defect
+// that did not honor the 'explicit' keyword on template constructors. this is
+// now autoconf'ed.
+
+#include "../tests.h"
+#include <lac/vector.h>
+#include <fstream>
+#include <iostream>
+
+
+void test (Vector<std::complex<double> > &v)
+{
+ for (unsigned int i=0; i<v.size(); ++i)
+ v(i) = std::complex<double> (i+1., i+2.);
+ Vector<std::complex<float> > w(v);
+
+ Assert (w==v, ExcInternalError());
+
+ deallog << "OK" << std::endl;
+}
+
+
+
+int main ()
+{
+ std::ofstream logfile("complex-vector_vector_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ try
+ {
+ Vector<std::complex<double> > v (100);
+ test (v);
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::(114444.,116127.) (114444.,-116127.) (114444.,116127.) (114444.,-116127.)
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::235790. 235790. 0
+DEAL::OK
--- /dev/null
+
+DEAL::235790. 235790. 0
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::235790. 235790. 0
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK
--- /dev/null
+
+DEAL::OK