-//---------------------------- vector.templates.h ---------------------------
+//---------------------------------------------------------------------------
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
+// Copyright (C) 1998 - 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.templates.h ---------------------------
+//---------------------------------------------------------------------------
#ifndef __deal2__vector_templates_h
#define __deal2__vector_templates_h
bool
Vector<Number>::all_zero () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
const_iterator p = begin(),
e = end();
bool
Vector<Number>::is_non_negative () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
const_iterator p = begin(),
e = end();
template <typename Number2>
Number Vector<Number>::operator * (const Vector<Number2>& v) const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
if (this == reinterpret_cast<const Vector<Number>*>(&v))
return norm_sqr();
template <typename Number>
Number Vector<Number>::norm_sqr () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Number sum0 = 0,
sum1 = 0,
template <typename Number>
Number Vector<Number>::mean_value () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Number sum0 = 0,
sum1 = 0,
template <typename Number>
Number Vector<Number>::l1_norm () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Number sum0 = 0,
sum1 = 0,
template <typename Number>
Number Vector<Number>::lp_norm (const Number p) const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Number sum0 = 0,
sum1 = 0,
template <typename Number>
Number Vector<Number>::linfty_norm () const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Number max0=0.,
max1=0.,
template <typename Number>
Vector<Number>& Vector<Number>::operator += (const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
add (v);
return *this;
template <typename Number>
Vector<Number>& Vector<Number>::operator -= (const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
template <typename Number>
void Vector<Number>::add (const Number v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
iterator i_ptr = begin(),
i_end = end();
template <typename Number>
void Vector<Number>::add (const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
template <typename Number>
void Vector<Number>::add (const Number a, const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
void Vector<Number>::add (const Number a, const Vector<Number>& v,
const Number b, const Vector<Number>& w)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
Assert (dim == w.dim, ExcDimensionMismatch(dim, w.dim));
iterator i_ptr = begin(),
template <typename Number>
void Vector<Number>::sadd (const Number x, const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
i_end = end();
void Vector<Number>::sadd (const Number x, const Number a,
const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
i_end = end();
const Vector<Number>& v, const Number b,
const Vector<Number>& w)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
Assert (dim == w.dim, ExcDimensionMismatch(dim, w.dim));
iterator i_ptr = begin(),
const Vector<Number>& w, const Number c,
const Vector<Number>& y)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
Assert (dim == w.dim, ExcDimensionMismatch(dim, w.dim));
Assert (dim == y.dim, ExcDimensionMismatch(dim, y.dim));
template <typename Number>
void Vector<Number>::scale (const Number factor)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
iterator ptr = begin();
const const_iterator eptr = end();
template <typename Number2>
void Vector<Number>::scale (const Vector<Number2> &s)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == s.dim, ExcDimensionMismatch(dim, s.dim));
iterator ptr = begin();
void Vector<Number>::equ (const Number a, const Vector<Number>& u,
const Number b, const Vector<Number>& v)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == u.dim, ExcDimensionMismatch(dim, u.dim));
Assert (dim == v.dim, ExcDimensionMismatch(dim, v.dim));
iterator i_ptr = begin(),
template <typename Number2>
void Vector<Number>::equ (const Number a, const Vector<Number2>& u)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == u.dim, ExcDimensionMismatch(dim, u.dim));
iterator i_ptr = begin(),
i_end = end();
template <typename Number>
void Vector<Number>::ratio (const Vector<Number> &a, const Vector<Number> &b)
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (a.dim == b.dim, ExcDimensionMismatch (a.dim, b.dim));
// no need to reinit with zeros, since
bool
Vector<Number>::operator == (const Vector<Number2>& v) const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
Assert (dim == v.size(), ExcDimensionMismatch(dim, v.size()));
for (unsigned int i=0; i<dim; ++i)
template <typename Number>
void Vector<Number>::print (const char* format) const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
if (!format) format = " %5.2f";
for (unsigned int j=0;j<size();j++)
std::printf (format, val[j]);
const bool scientific,
const bool across) const
{
- Assert (dim!=0, ExcEmptyVector());
+ Assert (dim!=0, ExcEmptyObject());
AssertThrow (out, ExcIO());
std::ios::fmtflags old_flags = out.flags();