// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1998, 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
* representing the two points.
*/
double distance (const Point<dim> &p) const;
-
- /** @addtogroup Exceptions
- * @{ */
-
- /**
- * Exception
- */
- DeclException1 (ExcDimTooSmall,
- int,
- << "Given dimensions must be >= 1, but was " << arg1);
- /**
- * Exception
- */
- DeclException0 (ExcInvalidConstructorCalled);
- //@}
-
};
/*------------------------------- Inline functions: Point ---------------------------*/
inline
Point<dim>::Point (const double x)
{
- Assert (dim==1, ExcInvalidConstructorCalled());
+ Assert (dim==1, StandardExceptions::ExcInvalidConstructorCall());
this->values[0] = x;
}
inline
Point<dim>::Point (const double x, const double y)
{
- Assert (dim==2, ExcInvalidConstructorCalled());
+ Assert (dim==2, StandardExceptions::ExcInvalidConstructorCall());
this->values[0] = x;
this->values[1] = y;
}
inline
Point<dim>::Point (const double x, const double y, const double z)
{
- Assert (dim==3, ExcInvalidConstructorCalled());
+ Assert (dim==3, StandardExceptions::ExcInvalidConstructorCall());
this->values[0] = x;
this->values[1] = y;
this->values[2] = z;
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+// Copyright (C) 1998, 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
*/
static unsigned int memory_consumption ();
- /** @addtogroup Exceptions
- * @{ */
-
/**
- * Exception
+ * Only tensors with a positive
+ * dimension are implemented. This
+ * exception is thrown by the
+ * constructor if the template
+ * argument <tt>dim</tt> is zero or
+ * less.
+ *
+ * @ingroup Exceptions
*/
DeclException1 (ExcDimTooSmall,
int,
- << "Given dimensions must be >= 1, but was " << arg1);
-
- //@}
+ << "dim must be positive, but was " << arg1);
private:
/**
* Store the values in a simple
inline
Tensor<1,dim>::Tensor (const array_type &initializer)
{
+ Assert (dim>0, ExcDimTooSmall(dim));
+
for (unsigned int i=0; i<dim; ++i)
values[i] = initializer[i];
}
inline
Tensor<1,dim>::Tensor (const Tensor<1,dim> &p)
{
+ Assert (dim>0, ExcDimTooSmall(dim));
+
for (unsigned int i=0; i<dim; ++i)
values[i] = p.values[i];
}