MADNESS 0.10.1
Classes | Namespaces | Macros | Functions
tensor.h File Reference

Defines and implements most of Tensor. More...

#include <madness/madness_config.h>
#include <madness/misc/ran.h>
#include <madness/world/posixmem.h>
#include <memory>
#include <complex>
#include <vector>
#include <array>
#include <cmath>
#include <cstdlib>
#include <cstddef>
#include <madness/world/archive.h>
#include <madness/tensor/basetensor.h>
#include <madness/tensor/aligned.h>
#include <madness/tensor/mxm.h>
#include <madness/tensor/tensorexcept.h>
#include <madness/tensor/tensoriter.h>
Include dependency graph for tensor.h:

Go to the source code of this file.

Classes

struct  madness::archive::ArchiveLoadImpl< Archive, Tensor< T > >
 Deserialize a tensor ... existing tensor is replaced. More...
 
struct  madness::archive::ArchiveStoreImpl< Archive, Tensor< T > >
 Serialize a tensor. More...
 
struct  madness::conditional_conj_struct< Q, iscomplex >
 For real types return value, for complex return conjugate. More...
 
struct  madness::conditional_conj_struct< Q, true >
 For real types return value, for complex return conjugate. More...
 
class  madness::SliceTensor< T >
 Indexing a non-constant tensor with slices returns a SliceTensor. More...
 
class  madness::Tensor< T >
 A tensor is a multidimension array. More...
 

Namespaces

namespace  madness
 Namespace for all elements and tools of MADNESS.
 
namespace  madness::archive
 Namespace for I/O tools.
 
namespace  madness::detail
 
namespace  std
 

Macros

#define HAVE_GENTENSOR   0
 
#define IS_ODD(n)   ((n)&0x1)
 
#define IS_UNALIGNED(p)   (((unsigned long)(p))&0x7)
 
#define TENSOR_ALIGNMENT   64
 
#define TENSOR_SHARED_PTR   std::shared_ptr
 

Functions

template<class T >
Tensor< typename Tensor< T >::scalar_type > madness::abs (const Tensor< T > &t)
 Return a new tensor holding the absolute value of each element of t.
 
static long std::abs (long a)
 
template<class T >
Tensor< typename Tensor< T >::scalar_type > madness::arg (const Tensor< T > &t)
 Return a new tensor holding the argument of each element of t (complex types only)
 
template<typename Q >
Q madness::conditional_conj (const Q &coeff)
 For real types return value, for complex return conjugate.
 
template<class T >
Tensor< Tmadness::conj (const Tensor< T > &t)
 Returns a new deep copy of the complex conjugate of the input tensor (complex types only)
 
template<class T >
Tensor< Tmadness::conj_transpose (const Tensor< T > &t)
 Returns a new deep copy of the complex conjugate transpose of the input tensor.
 
template<class Q , class T >
Tensor< Qmadness::convert (const Tensor< T > &t)
 Returns a new contiguous tensor of type Q that is a deep copy of the input.
 
template<class T >
Tensor< Tmadness::copy (const Tensor< T > &t)
 Returns a new contiguous tensor that is a deep copy of the input.
 
template<class T , class Q >
Tensor< TENSOR_RESULT_TYPE(T, Q) > & madness::fast_transform (const Tensor< T > &t, const Tensor< Q > &c, Tensor< TENSOR_RESULT_TYPE(T, Q) > &result, Tensor< TENSOR_RESULT_TYPE(T, Q) > &workspace)
 Restricted but heavily optimized form of transform()
 
template<class T , class Q >
Tensor< TENSOR_RESULT_TYPE(T, Q)> madness::general_transform (const Tensor< T > &t, const Tensor< Q > c[])
 Transform all dimensions of the tensor t by distinct matrices c.
 
template<class T >
Tensor< typename Tensor< T >::scalar_type > madness::imag (const Tensor< T > &t)
 Return a new tensor holding the imaginary part of each element of t (complex types only)
 
template<class T , class Q >
Tensor< TENSOR_RESULT_TYPE(T, Q)> madness::inner (const Tensor< T > &left, const Tensor< Q > &right, long k0=-1, long k1=0)
 Inner product ... result(i,j,...,p,q,...) = sum(z) left(i,j,...,z)*right(z,p,q,...)
 
template<class T , class Q >
void madness::inner_result (const Tensor< T > &left, const Tensor< Q > &right, long k0, long k1, Tensor< TENSOR_RESULT_TYPE(T, Q) > &result)
 Accumulate inner product into user provided, contiguous, correctly sized result tensor.
 
template<typename T = int>
double madness::detail::mynorm (int t)
 
template<typename T >
T madness::detail::mynorm (std::complex< T > t)
 
template<typename T >
T madness::detail::mynorm (T t)
 
template<typename T , typename Q >
IsSupported< TensorTypeData< Q >, Tensor< T > >::type madness::operator* (const Q &x, const Tensor< T > &t)
 The class defines tensor op scalar ... here define scalar op tensor.
 
template<typename T , typename Q >
IsSupported< TensorTypeData< Q >, Tensor< T > >::type madness::operator+ (Q x, const Tensor< T > &t)
 The class defines tensor op scalar ... here define scalar op tensor.
 
template<typename T , typename Q >
IsSupported< TensorTypeData< Q >, Tensor< T > >::type madness::operator- (Q x, const Tensor< T > &t)
 The class defines tensor op scalar ... here define scalar op tensor.
 
template<class T >
std::ostream & madness::operator<< (std::ostream &s, const Tensor< T > &t)
 Print (for human consumption) a tensor to the stream.
 
template<class T >
Tensor< Tmadness::outer (const Tensor< T > &left, const Tensor< T > &right)
 Outer product ... result(i,j,...,p,q,...) = left(i,k,...)*right(p,q,...)
 
template<class T >
void madness::outer_result (const Tensor< T > &left, const Tensor< T > &right, Tensor< T > &result)
 Outer product ... result(i,j,...,p,q,...) = left(i,k,...)*right(p,q,...)
 
template<class T >
Tensor< typename Tensor< T >::scalar_type > madness::real (const Tensor< T > &t)
 Return a new tensor holding the real part of each element of t (complex types only)
 
template<class T , class Q >
Tensor< TENSOR_RESULT_TYPE(T, Q)> madness::transform (const Tensor< T > &t, const Tensor< Q > &c)
 Transform all dimensions of the tensor t by the matrix c.
 
template<class T , class Q >
Tensor< TENSOR_RESULT_TYPE(T, Q)> madness::transform_dir (const Tensor< T > &t, const Tensor< Q > &c, int axis)
 Transforms one dimension of the tensor t by the matrix c, returns new contiguous tensor.
 
template<class T >
Tensor< Tmadness::transpose (const Tensor< T > &t)
 Returns a new deep copy of the transpose of the input tensor.
 

Detailed Description

Defines and implements most of Tensor.

Macro Definition Documentation

◆ HAVE_GENTENSOR

#define HAVE_GENTENSOR   0

◆ IS_ODD

#define IS_ODD (   n)    ((n)&0x1)

◆ IS_UNALIGNED

#define IS_UNALIGNED (   p)    (((unsigned long)(p))&0x7)

◆ TENSOR_ALIGNMENT

#define TENSOR_ALIGNMENT   64

◆ TENSOR_SHARED_PTR

#define TENSOR_SHARED_PTR   std::shared_ptr