// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
- * The <tt>Point</tt> class provides for a point or vector in a space with arbitrary
- * dimension <tt>dim</tt>.
+ * The <tt>Point</tt> class provides for a point or vector in a space with
+ * arbitrary dimension <tt>dim</tt>.
*
- * It is the preferred object to be passed to functions which
- * operate on points in spaces of a priori unknown dimension: rather than
- * using functions like <tt>double f(double x)</tt> and <tt>double f(double x, double y)</tt>,
+ * It is the preferred object to be passed to functions which operate on
+ * points in spaces of a priori unknown dimension: rather than using functions
+ * like <tt>double f(double x)</tt> and <tt>double f(double x, double y)</tt>,
* you use double <tt>f(Point<dim> &p)</tt>.
*
- * <tt>Point</tt> also serves as a starting point for the implementation of the
- * geometrical primitives like <tt>Polyhedron</tt>, <tt>Triangle</tt>, etc.
+ * <tt>Point</tt> also serves as a starting point for the implementation of
+ * the geometrical primitives like <tt>Polyhedron</tt>, <tt>Triangle</tt>,
+ * etc.
*
- * <tt>Point</tt>s can also be thought of as vectors, i.e. points in a vector space
- * without an obvious meaning. For instance, it may be suitable to let the
- * gradient of a function be a <tt>point</tt> vector:
- * <tt>Point<dim> gradient_of_f (const Point<dim> &x)</tt>. <tt>Point</tt>s have all
+ * <tt>Point</tt>s can also be thought of as vectors, i.e. points in a vector
+ * space without an obvious meaning. For instance, it may be suitable to let
+ * the gradient of a function be a <tt>point</tt> vector: <tt>Point<dim>
+ * gradient_of_f (const Point<dim> &x)</tt>. <tt>Point</tt>s have all
* functionality for this, e.g. scalar products, addition etc. However, you
- * should also consider using the simpler <tt>Tensor<1,dim></tt> class, which seems
- * more suited to gradients.
+ * should also consider using the simpler <tt>Tensor<1,dim></tt> class, which
+ * seems more suited to gradients.
*
* @author Wolfgang Bangerth, 1997
*/
Point (const Tensor<1,dim> &);
/**
- * Constructor for one dimensional points. This
- * function is only implemented for <tt>dim==1</tt>
- * since the usage is considered unsafe
- * for points with <tt>dim!=1</tt>.
+ * Constructor for one dimensional
+ * points. This function is only
+ * implemented for <tt>dim==1</tt> since
+ * the usage is considered unsafe for
+ * points with <tt>dim!=1</tt>.
*/
explicit Point (const double x);
/**
- * Constructor for two dimensional points. This
- * function is only implemented for <tt>dim==2</tt>
- * since the usage is considered unsafe
- * for points with <tt>dim!=2</tt>.
+ * Constructor for two dimensional
+ * points. This function is only
+ * implemented for <tt>dim==2</tt> since
+ * the usage is considered unsafe for
+ * points with <tt>dim!=2</tt>.
*/
Point (const double x, const double y);
/**
- * Constructor for three dimensional points. This
- * function is only implemented for <tt>dim==3</tt>
- * since the usage is considered unsafe
- * for points with <tt>dim!=3</tt>.
+ * Constructor for three dimensional
+ * points. This function is only
+ * implemented for <tt>dim==3</tt> since
+ * the usage is considered unsafe for
+ * points with <tt>dim!=3</tt>.
*/
Point (const double x, const double y, const double z);
/**
- * Read access to the <tt>index</tt>th coordinate.
+ * Read access to the <tt>index</tt>th
+ * coordinate.
*/
double operator () (const unsigned int index) const;
/**
- * Read and write access to the <tt>index</tt>th
- * coordinate.
+ * Read and write access to the
+ * <tt>index</tt>th coordinate.
*/
double & operator () (const unsigned int index);
*/
/**
- * Add two point vectors. If possible, use
- * <tt>operator +=</tt> instead since this does not
- * need to copy a point at least once.
+ * Add two point vectors. If possible,
+ * use <tt>operator +=</tt> instead
+ * since this does not need to copy a
+ * point at least once.
*/
Point<dim> operator + (const Tensor<1,dim>&) const;
/**
- * Subtract two point vectors. If possible, use
- * <tt>operator +=</tt> instead since this does not
- * need to copy a point at least once.
+ * Subtract two point vectors. If
+ * possible, use <tt>operator +=</tt>
+ * instead since this does not need to
+ * copy a point at least once.
*/
Point<dim> operator - (const Tensor<1,dim>&) const;
Point<dim> operator - () const;
/**
- * Multiply by a factor. If possible, use
- * <tt>operator *=</tt> instead since this does not
- * need to copy a point at least once.
+ * Multiply by a factor. If possible,
+ * use <tt>operator *=</tt> instead
+ * since this does not need to copy a
+ * point at least once.
*
* There is a commutative complement to this
* function also
Point<dim> operator * (const double) const;
/**
- * Returns the scalar product of two vectors.
+ * Returns the scalar product of two
+ * vectors.
*/
double operator * (const Tensor<1,dim> &) const;
/**
* Divide by a factor. If possible, use
- * <tt>operator /=</tt> instead since this does not
- * need to copy a point at least once.
+ * <tt>operator /=</tt> instead since
+ * this does not need to copy a point at
+ * least once.
*/
Point<dim> operator / (const double) const;
/**
- * Returns the scalar product of this point
- * vector with itself, i.e. the square, or
- * the square of the norm.
+ * Returns the scalar product of this
+ * point vector with itself, i.e. the
+ * square, or the square of the norm.
*/
double square () const;
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
bool operator != (const Tensor<rank_,dim> &) const;
/**
- * Add another vector, i.e. move this tensor by
- * the given offset.
+ * Add another tensor.
*/
Tensor<rank_,dim> & operator += (const Tensor<rank_,dim> &);
/**
- * Subtract another vector.
+ * Subtract another tensor.
*/
Tensor<rank_,dim> & operator -= (const Tensor<rank_,dim> &);
/**
- * Scale the tensor by <tt>factor</tt>, i.e. multiply
- * all coordinates by <tt>factor</tt>.
+ * Scale the tensor by <tt>factor</tt>,
+ * i.e. multiply all components by
+ * <tt>factor</tt>.
*/
Tensor<rank_,dim> & operator *= (const double &factor);
/**
- * Scale the vector by <tt>1/factor</tt>.
+ * Scale the vector by
+ * <tt>1/factor</tt>.
*/
Tensor<rank_,dim> & operator /= (const double &factor);
/**
- * Add two tensors. If possible, use
- * <tt>operator +=</tt> instead since this does not
- * need to copy a point at least once.
+ * Add two tensors. If possible, you
+ * should use <tt>operator +=</tt>
+ * instead since this does not need the
+ * creation of a temporary.
*/
Tensor<rank_,dim> operator + (const Tensor<rank_,dim> &) const;
/**
- * Subtract two tensors. If possible, use
- * <tt>operator +=</tt> instead since this does not
- * need to copy a point at least once.
+ * Subtract two tensors. If possible,
+ * you should use <tt>operator -=</tt>
+ * instead since this does not need the
+ * creation of a temporary.
*/
Tensor<rank_,dim> operator - (const Tensor<rank_,dim> &) const;
/**
- * Invert all entries of a tensor.
+ * Unary minus operator. Negate all
+ * entries of a tensor.
*/
Tensor<rank_,dim> operator - () const;
// also, it would be sufficient to make
// the function unroll_loops a friend,
// but that seems to be impossible as well.
- template <int otherrank, int otherdim> friend class Tensor;
+ template <int, int> friend class Tensor;
};