All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
o2scl::tensor3< vec_t, vec_size_t_int > Class Template Reference

Rank 3 tensor. More...

Detailed Description

template<class vec_t = std::vector<double>, class vec_size_t_int = std::vector<size_t>>
class o2scl::tensor3< vec_t, vec_size_t_int >

Definition at line 605 of file tensor.h.

#include <tensor.h>

Inheritance diagram for o2scl::tensor3< vec_t, vec_size_t_int >:
o2scl::tensor< vec_t, vec_size_t_int >

Public Member Functions

 tensor3 ()
 Create an empty tensor.
 
 tensor3 (size_t sz, size_t sz2, size_t sz3)
 Create a rank 3 tensor of size (sz,sz2,sz3)
 
double & get (size_t ix1, size_t ix2, size_t ix3)
 Get the element indexed by (ix1,ix2,ix3)
 
const double & get (size_t ix1, size_t ix2, size_t ix3) const
 Get the element indexed by (ix1,ix2,ix3)
 
void set (size_t ix1, size_t ix2, size_t ix3, double val)
 Set the element indexed by (ix1,ix2,ix3) to value val.
 
template<class size_vec_t >
void set (const size_vec_t &index, double val)
 Set the element indexed by index to value val. More...
 
- Public Member Functions inherited from o2scl::tensor< vec_t, vec_size_t_int >
 tensor ()
 Create an empty tensor with zero rank.
 
template<class size_vec_t >
 tensor (size_t rank, const size_vec_t &dim)
 Create a tensor of rank rank with sizes given in dim. More...
 
template<class size_vec_t >
void set (const size_vec_t &index, double val)
 Set the element indexed by index to value val.
 
void set_all (double x)
 Set all elements in a tensor to some fixed value.
 
template<class size_vec_t >
double & get (const size_vec_t &index)
 Get the element indexed by index.
 
template<class size_vec_t >
double const & get (const size_vec_t &index) const
 Get a const reference to the element indexed by index.
 
template<class size_vec_t >
ubvector_slice vector_slice (size_t ix, const size_vec_t &index)
 Fix all but one index to create a vector. More...
 
template<class size_vec_t >
void resize (size_t rank, const size_vec_t &dim)
 Resize the tensor to rank rank with sizes given in dim. More...
 
size_t get_rank () const
 Return the rank of the tensor.
 
size_t get_size (size_t i) const
 Returns the size of the ith index.
 
const vec_size_t_int & get_size_arr () const
 Return the full vector of sizes.
 
const vec_t & get_data () const
 Return the full data vector.
 
size_t total_size () const
 Returns the size of the tensor (the product of the sizes over every index)
 
template<class size_vec_t >
size_t pack_indices (const size_vec_t &index)
 Pack the indices into a single vector index.
 
template<class size_vec_t >
void unpack_indices (size_t ix, size_vec_t &index)
 Unpack the single vector index into indices.
 

Additional Inherited Members

- Public Types inherited from o2scl::tensor< vec_t, vec_size_t_int >
typedef
boost::numeric::ublas::vector_slice
< boost::numeric::ublas::vector
< double > > 
ubvector_slice
 
typedef
boost::numeric::ublas::slice 
slice
 
- Protected Attributes inherited from o2scl::tensor< vec_t, vec_size_t_int >
vec_t data
 The data.
 
vec_size_t_int size
 A rank-sized vector of the sizes of each dimension.
 
size_t rk
 Rank.
 

Member Function Documentation

template<class vec_t = std::vector<double>, class vec_size_t_int = std::vector<size_t>>
template<class size_vec_t >
void o2scl::tensor3< vec_t, vec_size_t_int >::set ( const size_vec_t &  index,
double  val 
)
inline

(We have to explicitly provide this version since the set() function is overloaded in this child of tensor.)

Definition at line 650 of file tensor.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..