42 #if !defined(Intrepid_MiniTensor_Tensor_h)
43 #define Intrepid_MiniTensor_Tensor_h
50 #include <boost/tuple/tuple.hpp>
52 #include "Intrepid_MiniTensor_Vector.h"
59 enum ComponentOrder {CANONICAL, SIERRA_FULL, SIERRA_SYMMETRIC};
65 class Tensor :
public TensorBase<T>
85 Tensor(Index
const dimension);
93 Tensor(Index
const dimension, ComponentValue value);
100 Tensor(Index
const dimension, T
const & s);
106 Tensor(T
const & s00, T
const & s01, T
const & s10, T
const & s11);
113 T
const & s00, T
const & s01, T
const & s02,
114 T
const & s10, T
const & s11, T
const & s12,
115 T
const & s20, T
const & s21, T
const & s22);
122 Tensor(Index
const dimension, T
const * data_ptr);
130 Index
const dimension,
132 ComponentOrder
const component_order);
155 operator()(Index
const i, Index
const j)
const;
170 fill(ComponentValue value);
180 ComponentOrder
const component_order = CANONICAL);
194 template<
typename S,
typename T>
195 Tensor<typename Promote<S, T>::type>
196 operator+(Tensor<S>
const & A, Tensor<T>
const & B);
202 template<
typename S,
typename T>
203 Tensor<typename Promote<S, T>::type>
204 operator-(Tensor<S>
const & A, Tensor<T>
const & B);
212 operator-(Tensor<T>
const & A);
221 operator==(Tensor<T>
const & A, Tensor<T>
const & B);
230 operator!=(Tensor<T>
const & A, Tensor<T>
const & B);
238 template<
typename S,
typename T>
239 Vector<typename Promote<S, T>::type>
240 operator*(Tensor<T>
const & A, Vector<S>
const & u);
248 template<
typename S,
typename T>
249 Vector<typename Promote<S, T>::type>
250 operator*(Vector<S>
const & u, Tensor<T>
const & A);
256 template<
typename S,
typename T>
257 Tensor<typename Promote<S, T>::type>
258 operator*(Tensor<S>
const & A, Tensor<T>
const & B);
266 template<
typename S,
typename T>
267 typename lazy_disable_if< order_1234<S>, apply_tensor< Promote<S,T> > >::type
268 operator*(S
const & s, Tensor<T>
const & A);
276 template<
typename S,
typename T>
277 typename lazy_disable_if< order_1234<S>, apply_tensor< Promote<S,T> > >::type
278 operator*(Tensor<T>
const & A, S
const & s);
286 template<
typename S,
typename T>
287 Tensor<typename Promote<S, T>::type>
288 operator/(Tensor<T>
const & A, S
const & s);
298 operator>>(std::istream & is, Tensor<T> & A);
308 operator<<(std::ostream & os, Tensor<T>
const & A);
318 row(Tensor<T>
const & A, Index
const i);
328 col(Tensor<T>
const & A, Index
const j);
336 template<
typename S,
typename T>
337 Vector<typename Promote<S, T>::type>
338 dot(Tensor<T>
const & A, Vector<S>
const & u);
346 template<
typename S,
typename T>
347 Vector<typename Promote<S, T>::type>
348 dot(Vector<S>
const & u, Tensor<T>
const & A);
356 template<
typename S,
typename T>
357 Tensor<typename Promote<S, T>::type>
358 dot(Tensor<S>
const & A, Tensor<T>
const & B);
366 template<
typename S,
typename T>
367 Tensor<typename Promote<S, T>::type>
368 t_dot(Tensor<S>
const & A, Tensor<T>
const & B);
376 template<
typename S,
typename T>
377 Tensor<typename Promote<S, T>::type>
378 dot_t(Tensor<S>
const & A, Tensor<T>
const & B);
386 template<
typename S,
typename T>
387 Tensor<typename Promote<S, T>::type>
388 t_dot_t(Tensor<S>
const & A, Tensor<T>
const & B);
396 template<
typename S,
typename T>
397 typename Promote<S, T>::type
398 dotdot(Tensor<S>
const & A, Tensor<T>
const & B);
406 template<
typename S,
typename T>
407 Tensor<typename Promote<S, T>::type>
408 dyad(Vector<S>
const & u, Vector<T>
const & v);
416 template<
typename S,
typename T>
417 Tensor<typename Promote<S, T>::type>
418 bun(Vector<S>
const & u, Vector<T>
const & v);
426 template<
typename S,
typename T>
427 Tensor<typename Promote<S, T>::type>
428 tensor(Vector<S>
const & u, Vector<T>
const & v);
437 diag(Vector<T>
const & v);
446 diag(Tensor<T>
const & A);
461 identity(Index
const N);
475 transpose(Tensor<T>
const & A);
482 adjoint(Tensor<T>
const & A);
490 sym(Tensor<T>
const & A);
498 skew(Tensor<T>
const & A);
508 skew(Vector<T>
const & u);
512 #include "Intrepid_MiniTensor_Tensor.i.h"
513 #include "Intrepid_MiniTensor_Tensor.t.h"
515 #endif //Intrepid_MiniTensor_Tensor_h
void fill(ComponentValue value)
T const & operator()(Index const i, Index const j) const