// ---------------------------------------------------------------------
//
-// Copyright (C) 1998 - 2014 by the deal.II authors
+// Copyright (C) 1998 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
Tensor (const array_type &initializer);
/**
- * Copy constructor taking a tesnor of another base data type
+ * Copy constructor from tensors with different underlying scalar
+ * type. This obviously requires that the @p OtherNumber type is
+ * convertible to @p Number.
*/
template <typename OtherNumber>
explicit
- Tensor (const Tensor<rank_,dim,OtherNumber> &);
+ Tensor (const Tensor<rank_,dim,OtherNumber> &initializer);
/**
* Conversion operator from tensor of tensors.
*/
- Tensor (const Tensor<1,dim,Tensor<rank_-1,dim,Number> > &tensor_in);
+ Tensor (const Tensor<1,dim,Tensor<rank_-1,dim,Number> > &initializer);
/**
* Conversion operator to tensor of tensors.
/**
* Assignment operator.
*/
- Tensor &operator = (const Tensor<rank_,dim,Number> &);
+ Tensor &operator = (const Tensor<rank_,dim,Number> &rhs);
+ /**
+ * Assignment operator from tensors with different underlying scalar
+ * type. This obviously requires that the @p OtherNumber type is
+ * convertible to @p Number.
+ */
template <typename OtherNumber>
- Tensor &operator = (const Tensor<rank_,dim,OtherNumber> &);
+ Tensor &operator = (const Tensor<rank_,dim,OtherNumber> &rhs);
/**
* This operator assigns a scalar to a tensor. To avoid confusion with what
return subtensor[i];
}
+
+
template <int rank_, int dim, typename Number>
inline
Number
return (subtensor[inner_ind])[indices1];
}
+
+
template <int rank_, int dim, typename Number>
inline
Number &
return (subtensor[inner_ind])[indices1];
}
+
+
template <int rank_, int dim, typename Number>
inline
Tensor<rank_,dim,Number> &
return *this;
}
+
+
template <int rank_, int dim, typename Number>
template <typename OtherNumber>
Tensor<rank_,dim,Number>::Tensor (const Tensor<rank_,dim,OtherNumber> &t)
/**
* Copy constructor.
*/
- Tensor (const Tensor<0,dim,Number> &);
+ Tensor (const Tensor<0,dim,Number> &initializer);
/**
* Copy constructor from tensors with different underlying scalar
* convertible to @p Number.
*/
template <typename OtherNumber>
- Tensor (const Tensor<0,dim,OtherNumber> &);
+ explicit
+ Tensor (const Tensor<0,dim,OtherNumber> &initializer);
/**
* Conversion to Number. Since rank-0 tensors are scalars, this is a natural
/**
* Assignment operator.
*/
- Tensor<0,dim,Number> &operator = (const Tensor<0,dim,Number> &);
+ Tensor<0,dim,Number> &operator = (const Tensor<0,dim,Number> &rhs);
/**
* Assignment operator from tensors with different underlying scalar
* convertible to @p Number.
*/
template <typename OtherNumber>
- Tensor<0,dim,Number> &operator = (const Tensor<0,dim,OtherNumber> &);
+ Tensor<0,dim,Number> &operator = (const Tensor<0,dim,OtherNumber> &rhs);
/**
* Assignment operator.
/**
* Test for equality of two tensors.
*/
- bool operator == (const Tensor<0,dim,Number> &) const;
+ bool operator == (const Tensor<0,dim,Number> &rhs) const;
/**
* Test for inequality of two tensors.
*/
- bool operator != (const Tensor<0,dim,Number> &) const;
+ bool operator != (const Tensor<0,dim,Number> &rhs) const;
/**
* Add another vector, i.e. move this point by the given offset.
*/
- Tensor<0,dim,Number> &operator += (const Tensor<0,dim,Number> &);
+ Tensor<0,dim,Number> &operator += (const Tensor<0,dim,Number> &rhs);
/**
* Subtract another vector.
*/
- Tensor<0,dim,Number> &operator -= (const Tensor<0,dim,Number> &);
+ Tensor<0,dim,Number> &operator -= (const Tensor<0,dim,Number> &rhs);
/**
* Scale the vector by <tt>factor</tt>, i.e. multiply all coordinates by
* Constructor. Initialize all entries to zero if <tt>initialize==true</tt>;
* this is the default behaviour.
*/
- explicit Tensor (const bool initialize = true);
+ explicit
+ Tensor (const bool initialize = true);
/**
* Copy constructor, where the data is copied from a C-style array.
/**
* Copy constructor.
*/
- Tensor (const Tensor<1,dim,Number> &);
+ Tensor (const Tensor<1,dim,Number> &initializer);
/**
* Copy constructor from tensors with different underlying scalar
* convertible to @p Number.
*/
template <typename OtherNumber>
- Tensor (const Tensor<1,dim,OtherNumber> &);
+ explicit
+ Tensor (const Tensor<1,dim,OtherNumber> &initializer);
/**
* Read access to the <tt>index</tt>th coordinate.
/**
* Assignment operator.
*/
- Tensor<1,dim,Number> &operator = (const Tensor<1,dim,Number> &);
+ Tensor<1,dim,Number> &operator = (const Tensor<1,dim,Number> &rhs);
/**
* Assignment operator from tensors with different underlying scalar
* convertible to @p Number.
*/
template <typename OtherNumber>
- Tensor<1,dim,Number> &operator = (const Tensor<1,dim,OtherNumber> &);
+ Tensor<1,dim,Number> &operator = (const Tensor<1,dim,OtherNumber> &rhs);
/**
* This operator assigns a scalar to a tensor. To avoid confusion with what
/**
* Test for equality of two tensors.
*/
- bool operator == (const Tensor<1,dim,Number> &) const;
+ bool operator == (const Tensor<1,dim,Number> &rhs) const;
/**
* Test for inequality of two tensors.
*/
- bool operator != (const Tensor<1,dim,Number> &) const;
+ bool operator != (const Tensor<1,dim,Number> &rhs) const;
/**
* Add another vector, i.e. move this point by the given offset.
*/
- Tensor<1,dim,Number> &operator += (const Tensor<1,dim,Number> &);
+ Tensor<1,dim,Number> &operator += (const Tensor<1,dim,Number> &rhs);
/**
* Subtract another vector.
*/
- Tensor<1,dim,Number> &operator -= (const Tensor<1,dim,Number> &);
+ Tensor<1,dim,Number> &operator -= (const Tensor<1,dim,Number> &rhs);
/**
* Scale the vector by <tt>factor</tt>, i.e. multiply all coordinates by