MADNESS 0.10.1
|
A tensor is a multidimension array. More...
#include <tensor.h>
Public Types | |
typedef TensorTypeData< T >::float_scalar_type | float_scalar_type |
C++ typename of the floating point type associated with scalar real type. | |
typedef TensorTypeData< T >::scalar_type | scalar_type |
C++ typename of the real type associated with a complex type. | |
typedef T | type |
C++ typename of this tensor. | |
Public Member Functions | |
Tensor () | |
Default constructor does not allocate any data and sets ndim=-1, size=0, _p=0, and id. | |
Tensor (const std::vector< long > &d, bool dozero=true) | |
Create and optionally zero new n-d tensor. This is the most general constructor. | |
Tensor (const Tensor< T > &t) | |
Copy constructor is shallow (same as assignment) | |
Tensor (long d0) | |
Create and zero new 1-d tensor. | |
Tensor (long d0, long d1) | |
Create and zero new 2-d tensor. | |
Tensor (long d0, long d1, long d2) | |
Create and zero new 3-d tensor. | |
Tensor (long d0, long d1, long d2, long d3) | |
Create and zero new 4-d tensor. | |
Tensor (long d0, long d1, long d2, long d3, long d4) | |
Create and zero new 5-d tensor. | |
Tensor (long d0, long d1, long d2, long d3, long d4, long d5) | |
Create and zero new 6-d tensor. | |
Tensor (long nd, const long d[], bool dozero=true) | |
Politically incorrect general constructor. | |
virtual | ~Tensor () |
scalar_type | absmax (long *ind=0) const |
Return the absolute maximum value (and if ind is non-null, its index) in the Tensor. | |
scalar_type | absmin (long *ind=0) const |
Return the absolute minimum value (and if ind is non-null, its index) in the Tensor. | |
BaseTensor * | base () |
Returns a pointer to the base class. | |
const BaseTensor * | base () const |
Returns a pointer to the base class. | |
template<class Q > | |
TensorIterator< T, Q > | binary_iterator (const Tensor< Q > &q, long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
Return iterator over two tensors. | |
void | clear () |
Frees all memory and resests to state of default constructor. | |
template<class Q > | |
bool | conforms (const Tensor< Q > &t) const |
Test if *this and t conform. | |
Tensor< T > & | conj () |
Inplace complex conjugate. | |
Tensor< T > | cycledim (long nshift, long start, long end) |
Returns new view/tensor cycling the sub-dimensions (start,...,end) with shift steps. | |
const Tensor< T > | cycledim (long nshift, long start, long end) const |
Returns new view/tensor cycling the sub-dimensions (start,...,end) with shift steps. | |
Tensor< T > & | emul (const Tensor< T > &t) |
Inplace multiply by corresponding elements of argument Tensor. | |
const TensorIterator< T > & | end () const |
End point for forward iteration. | |
Tensor< T > & | fill (T x) |
Inplace fill with a scalar (legacy name) | |
Tensor< T > & | fillindex () |
Inplace fill with the index of each element. | |
Tensor< T > & | fillrandom () |
Inplace fill with random values ( [0,1] for floats, [0,MAXSIZE] for integers) | |
Tensor< T > | flat () |
Returns new view/tensor rehshaping to flat (1-d) tensor. | |
const Tensor< T > | flat () const |
Returns new view/tensor rehshaping to flat (1-d) tensor. | |
Tensor< T > | fusedim (long i) |
Returns new view/tensor fusing contiguous dimensions i and i+1 . | |
const Tensor< T > | fusedim (long i) const |
Returns new view/tensor fusing contiguous dimensions i and i+1 . | |
Tensor< T > & | gaxpy (T alpha, const Tensor< T > &t, T beta) |
Inplace generalized saxpy ... this = this*alpha + other*beta. | |
bool | has_data () const |
Tensor< T > | mapdim (const std::vector< long > &map) |
Returns new view/tensor permuting the dimensions. | |
const Tensor< T > | mapdim (const std::vector< long > &map) const |
Returns new view/tensor permuting the dimensions. | |
float_complex | max (long *ind) const |
double_complex | max (long *ind) const |
float_complex | max (long *ind) const |
double_complex | max (long *ind) const |
T | max (long *ind=0) const |
Return the maximum value (and if ind is non-null, its index) in the Tensor. | |
float_complex | min (long *ind) const |
double_complex | min (long *ind) const |
float_complex | min (long *ind) const |
double_complex | min (long *ind) const |
T | min (long *ind=0) const |
Return the minimum value (and if ind is non-null, its index) in the Tensor. | |
float_scalar_type | normf () const |
Returns the Frobenius norm of the tensor. | |
template<class Q > | |
operator Tensor< Q > () const | |
Type conversion makes a deep copy. | |
T & | operator() (const long ind[]) |
Politically incorrect general indexing operation without bounds checking. | |
const T & | operator() (const long ind[]) const |
Politically incorrect general indexing operation without bounds checking. | |
SliceTensor< T > | operator() (const Slice &s0) |
Return a 1d SliceTensor that views the specified range of the 1d Tensor. | |
const Tensor< T > | operator() (const Slice &s0) const |
Return a 1d SliceTensor that views the specified range of the 1d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1) |
Return a 2d SliceTensor that views the specified range of the 2d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1) const |
Return a 2d constant Tensor that views the specified range of the 2d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2) |
Return a 3d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2) const |
Return a 3d constant Tensor that views the specified range of the 3d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3) |
Return a 1-4d SliceTensor that views the specified range of the 4d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3) const |
Return a 1-4d constant Tensor that views the specified range of the 4d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4) |
Return a 1-5d SliceTensor that views the specified range of the 5d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4) const |
Return a 1-5d constant Tensor that views the specified range of the 5d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4, const Slice &s5) |
Return a 1-6d SliceTensor that views the specified range of the 6d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, const Slice &s2, const Slice &s3, const Slice &s4, const Slice &s5) const |
Return a 1-6d constant Tensor that views the specified range of the 6d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, const Slice &s1, long k) |
Return a 2d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, const Slice &s1, long k) const |
Return a 2d constant Tensor that views the specified range of the 3d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, long j) |
Return a 1d SliceTensor that views the specified range of the 2d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, long j) const |
Return a 1d constant Tensor that views the specified range of the 2d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, long j, const Slice &s2) |
Return a 2d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, long j, const Slice &s2) const |
Return a 2d constant Tensor that views the specified range of the 3d Tensor. | |
SliceTensor< T > | operator() (const Slice &s0, long j, long k) |
Return a 1d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (const Slice &s0, long j, long k) const |
Return a 1d constant Tensor that views the specified range of the 3d Tensor. | |
SliceTensor< T > | operator() (const std::array< Slice, TENSOR_MAXDIM > &s) |
General slicing operation. | |
const Tensor< T > | operator() (const std::array< Slice, TENSOR_MAXDIM > &s) const |
General slicing operation (const) | |
T & | operator() (const std::vector< long > ind) |
General indexing operation with bounds checking. | |
const T & | operator() (const std::vector< long > ind) const |
General indexing operation with bounds checking. | |
SliceTensor< T > | operator() (const std::vector< Slice > &s) |
General slicing operation. | |
const Tensor< T > | operator() (const std::vector< Slice > &s) const |
General slicing operation (const) | |
T & | operator() (long i) |
1-d indexing operation without bounds checking. | |
const T & | operator() (long i) const |
1-d indexing operation without bounds checking. | |
SliceTensor< T > | operator() (long i, const Slice &s1) |
Return a 1d SliceTensor that views the specified range of the 2d Tensor. | |
const Tensor< T > | operator() (long i, const Slice &s1) const |
Return a 1d SliceTensor that views the specified range of the 2d Tensor. | |
SliceTensor< T > | operator() (long i, const Slice &s1, const Slice &s2) |
Return a 2d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (long i, const Slice &s1, const Slice &s2) const |
Return a 2d constant Tensor that views the specified range of the 3d Tensor. | |
SliceTensor< T > | operator() (long i, const Slice &s1, long k) |
Return a 1d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (long i, const Slice &s1, long k) const |
Return a 1d constant Tensor that views the specified range of the 3d Tensor. | |
T & | operator() (long i, long j) |
2-d indexing operation without bounds checking. | |
const T & | operator() (long i, long j) const |
2-d indexing operation without bounds checking. | |
SliceTensor< T > | operator() (long i, long j, const Slice &s2) |
Return a 1d SliceTensor that views the specified range of the 3d Tensor. | |
const Tensor< T > | operator() (long i, long j, const Slice &s2) const |
Return a 1d constant Tensor that views the specified range of the 3d Tensor. | |
T & | operator() (long i, long j, long k) |
3-d indexing operation without bounds checking. | |
const T & | operator() (long i, long j, long k) const |
3-d indexing operation without bounds checking. | |
T & | operator() (long i, long j, long k, long l) |
4-d indexing operation without bounds checking. | |
const T & | operator() (long i, long j, long k, long l) const |
4-d indexing operation without bounds checking. | |
T & | operator() (long i, long j, long k, long l, long m) |
5-d indexing operation without bounds checking. | |
const T & | operator() (long i, long j, long k, long l, long m) const |
5-d indexing operation without bounds checking. | |
T & | operator() (long i, long j, long k, long l, long m, long n) |
6-d indexing operation without bounds checking. | |
const T & | operator() (long i, long j, long k, long l, long m, long n) const |
6-d indexing operation without bounds checking. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator* (const Q &x) const |
Multiplication of tensor by a scalar of a supported type to produce a new tensor. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator*= (const Q &x) |
Inplace multiplication by scalar of supported type. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator+ (const Q &x) const |
Add a scalar of the same type to all elements of a tensor producing a new tensor. | |
template<typename Q > | |
Tensor< TENSOR_RESULT_TYPE(T, Q) > | operator+ (const Tensor< Q > &t) const |
Addition of two tensors to produce a new tensor. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator+= (const Q &x) |
Inplace increment by scalar of supported type. | |
template<typename Q > | |
Tensor< T > & | operator+= (const Tensor< Q > &t) |
Inplace addition of two tensors. | |
Tensor< T > | operator- () const |
Unary negation producing a new tensor. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator- (const Q &x) const |
Subtract a scalar of the same type from all elements producing a new tensor. | |
template<typename Q > | |
Tensor< TENSOR_RESULT_TYPE(T, Q) > | operator- (const Tensor< Q > &t) const |
Subtraction of two tensors to produce a new tensor. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | operator-= (const Q &x) |
Inplace decrement by scalar of supported type. | |
template<typename Q > | |
Tensor< T > & | operator-= (const Tensor< Q > &t) |
Inplace subtraction of two tensors. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< TENSOR_RESULT_TYPE(T, Q)> >::type | operator/ (const Q &x) const |
Divide tensor by a scalar of a supported type to produce a new tensor. | |
Tensor< T > & | operator= (const Tensor< T > &t) |
Assignment is shallow (same as copy constructor) | |
Tensor< T > & | operator= (T x) |
Inplace fill tensor with scalar. | |
T & | operator[] (long i) |
1-d indexing operation using [] without bounds checking. | |
const T & | operator[] (long i) const |
1-d indexing operation using [] without bounds checking. | |
T | product () const |
Return the product of all elements of the tensor. | |
T * | ptr () |
Returns a pointer to the internal data. | |
const T * | ptr () const |
Returns a pointer to the internal data. | |
Tensor< T > | reshape (const std::vector< long > &d) |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor. | |
const Tensor< T > | reshape (const std::vector< long > &d) const |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor. | |
Tensor< T > | reshape (int ndimnew, const long *d) |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor. | |
const Tensor< T > | reshape (int ndimnew, const long *d) const |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor. | |
Tensor< T > | reshape (long dim0) |
Returns new view/tensor rehapings to conforming 1-d tensor with given dimension. | |
const Tensor< T > | reshape (long dim0) const |
Returns new view/tensor rehapings to conforming 1-d tensor with given dimension. | |
Tensor< T > | reshape (long dim0, long dim1) |
Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions. | |
const Tensor< T > | reshape (long dim0, long dim1) const |
Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions. | |
Tensor< T > | reshape (long dim0, long dim1, long dim2) |
Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions. | |
const Tensor< T > | reshape (long dim0, long dim1, long dim2) const |
Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions. | |
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3) |
Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions. | |
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3) const |
Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions. | |
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4) |
Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions. | |
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4) const |
Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions. | |
Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4, long dim5) |
Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions. | |
const Tensor< T > | reshape (long dim0, long dim1, long dim2, long dim3, long dim4, long dim5) const |
Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions. | |
template<typename Q > | |
IsSupported< TensorTypeData< Q >, Tensor< T > & >::type | scale (Q x) |
Inplace multiplication by scalar of supported type (legacy name) | |
Tensor< T > & | screen (double x) |
Inplace set elements of *this less than x in absolute magnitude to zero. | |
Tensor< T > | splitdim (long i, long dimi0, long dimi1) |
Returns new view/tensor splitting dimension i as dimi0*dimi1 to produce conforming d+1 dimension tensor. | |
const Tensor< T > | splitdim (long i, long dimi0, long dimi1) const |
Returns new view/tensor splitting dimension i as dimi0*dimi1 to produce conforming d+1 dimension tensor. | |
T | sum () const |
Returns the sum of all elements of the tensor. | |
T | sumsq () const |
Returns the sum of the squares of the elements. | |
Tensor< T > | swapdim (long idim, long jdim) |
Returns new view/tensor swaping dimensions i and j . | |
const Tensor< T > | swapdim (long idim, long jdim) const |
Returns new view/tensor swaping dimensions i and j . | |
template<class Q > | |
TENSOR_RESULT_TYPE (T, Q) trace_conj(const Tensor< Q > &t) const | |
Return the trace of two tensors with complex conjugate of the leftmost (i.e., this) | |
template<class Q , class R > | |
TensorIterator< T, Q, R > | ternary_iterator (const Tensor< Q > &q, const Tensor< R > &r, long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
Return iterator over three tensors. | |
T | trace (const Tensor< T > &t) const |
Return the trace of two tensors (no complex conjugate invoked) | |
TensorIterator< T > | unary_iterator (long iterlevel=0, bool optimize=true, bool fusedim=true, long jdim=default_jdim) const |
Return iterator over single tensor. | |
template<typename opT > | |
Tensor< T > & | unaryop (opT &op) |
Inplace apply a unary function to each element of the tensor. | |
Public Member Functions inherited from madness::BaseTensor | |
BaseTensor () | |
virtual | ~BaseTensor () |
bool | conforms (const BaseTensor *t) const |
Returns true if this and *t are the same shape and size. | |
long | dim (int i) const |
Returns the size of dimension i . | |
const long * | dims () const |
Returns the array of tensor dimensions. | |
long | id () const |
Returns the typeid of the tensor (c.f., TensorTypeData<T> ) | |
bool | iscontiguous () const |
Returns true if the tensor refers to contiguous memory locations. | |
long | ndim () const |
Returns the number of dimensions in the tensor. | |
long | size () const |
Returns the number of elements in the tensor. | |
long | stride (int i) const |
Returns the stride associated with dimension i . | |
const long * | strides () const |
Returns the array of tensor strides. | |
Static Public Member Functions | |
static bool | bounds_checking () |
Return true if bounds checking was enabled at compile time. | |
Static Public Member Functions inherited from madness::BaseTensor | |
static int | get_instance_count () |
Returns the count of all current instances of tensors & slice tensors of all types. | |
Protected Member Functions | |
void | allocate (long nd, const long d[], bool dozero) |
void | deallocate () |
Protected Member Functions inherited from madness::BaseTensor | |
void | cycledim_inplace (long shift, long start, long end) |
Cyclic shift of dimensions. | |
void | flat_inplace () |
Reshapes the tensor inplace into 1D. | |
void | fusedim_inplace (long i) |
Fuses dimensions i and i+1 . | |
void | mapdim_inplace (const std::vector< long > &map) |
General permutation of dimensions. | |
void | reshape_inplace (const std::vector< long > &d) |
Reshapes the tensor inplace. | |
void | reshape_inplace (int ndimnew, const long *d) |
Reshapes the tensor inplace. | |
void | set_dims_and_size (long nd, const long d[]) |
void | splitdim_inplace (long i, long dimi0, long dimi1) |
Splits dimension i . | |
void | swapdim_inplace (long i, long j) |
Swaps the dimensions. | |
Protected Attributes | |
T *MADNESS_RESTRICT | _p |
TENSOR_SHARED_PTR< T > | _shptr |
Protected Attributes inherited from madness::BaseTensor | |
long | _dim [TENSOR_MAXDIM] |
Size of each dimension. | |
long | _id |
Id from TensorTypeData<T> in type_data.h. | |
long | _ndim |
Number of dimensions (-1=invalid; 0=no supported; >0=tensor) | |
long | _size |
Number of elements in the tensor. | |
long | _stride [TENSOR_MAXDIM] |
Increment between elements in each dimension. | |
Friends | |
template<class U > | |
class | SliceTensor |
typedef TensorTypeData<T>::float_scalar_type madness::Tensor< T >::float_scalar_type |
C++ typename of the floating point type associated with scalar real type.
typedef TensorTypeData<T>::scalar_type madness::Tensor< T >::scalar_type |
C++ typename of the real type associated with a complex type.
typedef T madness::Tensor< T >::type |
C++ typename of this tensor.
|
inline |
Default constructor does not allocate any data and sets ndim=-1, size=0, _p=0, and id.
References madness::BaseTensor::_id.
|
inline |
Copy constructor is shallow (same as assignment)
Caveat emptor: The shallow copy constructor has many virtues but enables you to violate constness with simple code such as
References madness::BaseTensor::_id.
|
inlineexplicit |
Create and zero new 1-d tensor.
[in] | d0 | Size of dimension 0 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and zero new 2-d tensor.
[in] | d0 | Size of dimension 0 |
[in] | d1 | Size of dimension 1 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and zero new 3-d tensor.
[in] | d0 | Size of dimension 0 |
[in] | d1 | Size of dimension 1 |
[in] | d2 | Size of dimension 2 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and zero new 4-d tensor.
[in] | d0 | Size of dimension 0 |
[in] | d1 | Size of dimension 1 |
[in] | d2 | Size of dimension 2 |
[in] | d3 | Size of dimension 3 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and zero new 5-d tensor.
[in] | d0 | Size of dimension 0 |
[in] | d1 | Size of dimension 1 |
[in] | d2 | Size of dimension 2 |
[in] | d3 | Size of dimension 3 |
[in] | d4 | Size of dimension 4 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and zero new 6-d tensor.
[in] | d0 | Size of dimension 0 |
[in] | d1 | Size of dimension 1 |
[in] | d2 | Size of dimension 2 |
[in] | d3 | Size of dimension 3 |
[in] | d4 | Size of dimension 4 |
[in] | d5 | Size of dimension 5 |
References madness::BaseTensor::_dim, and madness::Tensor< T >::allocate().
|
inlineexplicit |
Create and optionally zero new n-d tensor. This is the most general constructor.
[in] | d | Vector containing size of each dimension, number of dimensions inferred from vector size. |
[in] | dozero | If true (default) the tensor is initialized to zero |
References madness::Tensor< T >::allocate(), and d.
|
inlineexplicit |
Politically incorrect general constructor.
[in] | nd | Number of dimensions |
[in] | d | Size of each dimension |
[in] | dozero | If true (default) the tensor is initialized to zero |
References madness::Tensor< T >::allocate(), and d.
|
inlinevirtual |
|
inline |
Return the absolute maximum value (and if ind is non-null, its index) in the Tensor.
References madness::BaseTensor::_ndim, std::abs(), T(), UNARY_OPTIMIZED_ITERATOR, and UNARY_UNOPTIMIZED_ITERATOR.
Referenced by madness::projector_irrep::apply_symmetry_operators(), madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality(), madness::Nemo::hessian(), madness::OEP::iterate(), madness::density_mask_operator::operator()(), madness::MolecularOptimizer::optimize_quasi_newton(), madness::ortho3(), madness::ortho5(), madness::apply_kernel_helper::slater_apply(), madness::Nemo::solve(), and madness::Nemo::solve_cphf().
|
inline |
Return the absolute minimum value (and if ind is non-null, its index) in the Tensor.
References madness::BaseTensor::_ndim, std::abs(), T(), UNARY_OPTIMIZED_ITERATOR, and UNARY_UNOPTIMIZED_ITERATOR.
|
inlineprotected |
References madness::BaseTensor::_id, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::Tensor< T >::_shptr, madness::BaseTensor::_size, madness::aligned_zero(), d, MADNESS_PRAGMA_GCC, madness::pop(), posix_memalign(), madness::BaseTensor::set_dims_and_size(), T(), TENSOR_ALIGNMENT, TENSOR_ASSERT, TENSOR_EXCEPTION, and TENSOR_MAXDIM.
Referenced by madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), madness::Tensor< T >::Tensor(), and madness::Tensor< T >::Tensor().
|
inline |
Returns a pointer to the base class.
|
inline |
Returns a pointer to the base class.
|
inline |
Return iterator over two tensors.
References madness::Tensor< T >::fusedim(), and q().
|
inlinestatic |
Return true if bounds checking was enabled at compile time.
Referenced by main().
|
inline |
Frees all memory and resests to state of default constructor.
References madness::Tensor< T >::deallocate().
Referenced by madness::PNO::compute_cispd_fluctuation_matrix(), madness::MP2::enforce_core_valence_separation(), madness::MolecularOrbitals< T, NDIM >::invalidate_eps(), madness::MolecularOrbitals< T, NDIM >::invalidate_occ(), madness::ortho3(), madness::ortho5(), and madness::MolecularOrbitals< T, NDIM >::write_to().
|
inline |
Test if *this
and t
conform.
References madness::BaseTensor::conforms().
Referenced by madness::TensorIterator< T, Q, R >::TensorIterator().
|
inline |
Inplace complex conjugate.
References madness::conditional_conj(), T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::FunctionImpl< T, NDIM >::do_inner_localX(), and madness::Function< T, NDIM >::doconj().
|
inline |
Returns new view/tensor cycling the sub-dimensions (start,...,end)
with shift
steps.
References madness::BaseTensor::cycledim_inplace(), and madness::Tensor< T >::end().
Referenced by madness::apply().
|
inline |
Returns new view/tensor cycling the sub-dimensions (start,...,end)
with shift
steps.
References madness::BaseTensor::cycledim_inplace(), and madness::Tensor< T >::end().
|
inlineprotected |
References madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::Tensor< T >::_shptr, and madness::BaseTensor::_size.
Referenced by madness::Tensor< T >::clear().
Inplace multiply by corresponding elements of argument Tensor.
References BINARY_OPTIMIZED_ITERATOR, and T().
Referenced by madness::Nemo::compute_IR_intensities(), madness::FunctionImpl< T, NDIM >::dirac_convolution_op(), madness::SRConf< T >::normf(), madness::guessfactory::ExopUnaryOpStructure::operator()(), madness::guessfactory::ExopUnaryOpStructure::operator()(), YetAnotherWrapperClass::operator()(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), test_multiop< T, NDIM >::operator()(), madness::detail::abssqop< NDIM >::operator()(), madness::BinaryOpStructure< NDIM >::operator()(), madness::UnaryOpStructure< NDIM >::operator()(), madness::detail::squareinplace< T, NDIM >::operator()(), madness::detail::abssquareinplace< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), madness::ortho5(), madness::apply_kernel_helper::slater_apply(), test_emul(), and madness::SRConf< T >::trace().
|
inline |
End point for forward iteration.
Referenced by madness::SliceTensor< T >::SliceTensor(), MySteepestDescent::check_positive(), madness::Tensor< T >::cycledim(), madness::Tensor< T >::cycledim(), madness::operator<<(), madness::outer_result(), and test_convergence().
Inplace fill with a scalar (legacy name)
[in] | x | Value used to fill tensor via assigment |
Referenced by madness::exchange_anchor_test(), exchange_anchor_test(), main(), madness::divide_add_interpolate::operator()(), madness::GenTensor< T >::operator+=(), madness::GenTensor< T >::operator-=(), madness::MolecularOptimizer::optimize_conjugate_gradients(), Test7(), madness::test_exchange(), test_exchange(), and madness::FunctionImpl< T, NDIM >::tnorm().
|
inline |
Inplace fill with the index of each element.
Each element is assigned it's logical index according to this loop structure
References T(), and UNARY_UNOPTIMIZED_ITERATOR.
Referenced by Test1().
|
inline |
Inplace fill with random values ( [0,1] for floats,
[0,MAXSIZE] for integers)
References madness::BaseTensor::iscontiguous(), madness::Tensor< T >::ptr(), madness::BaseTensor::size(), T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::RandomizedMatrixDecomposition< T >::do_compute_range(), main(), main(), madness::Localizer::matrix_exponential(), Test1(), Test5(), Test7(), test_addition(), test_constructor(), test_convert(), test_emul(), test_general_transform(), madness::test_gesv(), madness::test_qr(), test_reconstruct(), test_reduce_rank(), test_sliced_addition(), test_sliced_assignment(), madness::test_syev(), and madness::test_sygv().
|
inline |
Returns new view/tensor rehshaping to flat (1-d) tensor.
References madness::BaseTensor::_size, d, and madness::Tensor< T >::reshape().
Referenced by madness::TensorTrain< T >::TensorTrain(), main(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::MolecularEnergy::output_calc_info_schema(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), madness::rank_revealing_decompose(), run_all_calculations(), test_read_restartaodata(), test_read_restartdata(), and madness::TensorTrain< T >::truncate().
|
inline |
Returns new view/tensor rehshaping to flat (1-d) tensor.
References madness::BaseTensor::_size, d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor fusing contiguous dimensions i
and i+1
.
References madness::BaseTensor::fusedim_inplace().
Referenced by madness::Tensor< T >::binary_iterator(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), madness::TensorTrain< T >::reconstruct(), madness::Tensor< T >::ternary_iterator(), madness::TensorTrain< T >::trace(), and madness::Tensor< T >::unary_iterator().
|
inline |
Returns new view/tensor fusing contiguous dimensions i
and i+1
.
References madness::BaseTensor::fusedim_inplace().
|
inline |
Inplace generalized saxpy ... this = this*alpha + other*beta.
References madness::BaseTensor::_size, a, alpha, b, beta, BINARY_OPTIMIZED_ITERATOR, madness::BaseTensor::iscontiguous(), madness::Tensor< T >::ptr(), and T().
Referenced by madness::FunctionImpl< T, NDIM >::gaxpy_ext_node(), madness::Convolution1D< Q >::get_rnlp(), madness::Localizer::localize_boys(), madness::Localizer::localize_new(), main(), madness::SCF::make_fock_matrix(), MySteepestDescent::optimize(), SteepestDescent::optimize(), and madness::SteepestDescent::optimize().
|
inline |
References madness::BaseTensor::size().
Referenced by madness::SVDTensor< T >::SVDTensor(), madness::FunctionImpl< T, NDIM >::assemble_coefficients(), madness::FunctionImpl< T, NDIM >::do_apply_directed_screening(), madness::FunctionImpl< T, NDIM >::do_print_plane(), madness::MP2::get_fock_matrix(), and madness::Localizer::localize().
|
inline |
Returns new view/tensor permuting the dimensions.
[in] | map | Old dimension i becomes new dimension map [i] |
References madness::BaseTensor::mapdim_inplace().
Referenced by madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()().
|
inline |
Returns new view/tensor permuting the dimensions.
References madness::BaseTensor::mapdim_inplace().
float_complex madness::Tensor< float_complex >::max | ( | long * | ind | ) | const |
References TENSOR_EXCEPTION.
double_complex madness::Tensor< double_complex >::max | ( | long * | ind | ) | const |
References TENSOR_EXCEPTION.
float_complex madness::Tensor< float_complex >::max | ( | long * | ind | ) | const |
double_complex madness::Tensor< double_complex >::max | ( | long * | ind | ) | const |
|
inline |
Return the maximum value (and if ind is non-null, its index) in the Tensor.
References madness::BaseTensor::_ndim, madness::Tensor< T >::_p, T(), UNARY_OPTIMIZED_ITERATOR, and UNARY_UNOPTIMIZED_ITERATOR.
Referenced by MolecularNuclearPotentialFunctor2::MolecularNuclearPotentialFunctor2(), madness::BSHOperatorPtr3D(), madness::GradBSHOperator(), GradBSHOperator_Joel(), madness::GradCoulombOperator(), madness::GradSlaterOperator(), madness::SeparatedConvolution< Q, NDIM >::make_coeff_for_operator(), madness::PeriodicBSHOperator3D(), madness::PeriodicBSHOperatorPtr3D(), madness::PeriodicHFExchangeOperator(), madness::plotpovray(), madness::FunctionDefaults< NDIM >::set_length_scale(), and madness::FunctionFunctorInterface< T, NDIM >::set_length_scale().
float_complex madness::Tensor< float_complex >::min | ( | long * | ind | ) | const |
References TENSOR_EXCEPTION.
double_complex madness::Tensor< double_complex >::min | ( | long * | ind | ) | const |
References TENSOR_EXCEPTION.
float_complex madness::Tensor< float_complex >::min | ( | long * | ind | ) | const |
double_complex madness::Tensor< double_complex >::min | ( | long * | ind | ) | const |
|
inline |
Return the minimum value (and if ind is non-null, its index) in the Tensor.
References madness::BaseTensor::_ndim, madness::Tensor< T >::_p, T(), UNARY_OPTIMIZED_ITERATOR, and UNARY_UNOPTIMIZED_ITERATOR.
Referenced by madness::TDHF::make_guess_from_initial_diagonalization(), madness::plotpovray(), and madness::FunctionDefaults< NDIM >::recompute_cell_info().
|
inline |
Returns the Frobenius norm of the tensor.
References madness::detail::mynorm(), T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::ConvolutionData1D< Q >::ConvolutionData1D(), madness::ConvolutionData1D< Q >::ConvolutionData1D(), madness::GeneralTwoElectronInterface< T, NDIM >::GeneralTwoElectronInterface(), madness::GenericConvolution1D< Q, opT >::GenericConvolution1D(), MolecularNuclearPotentialFunctor2::MolecularNuclearPotentialFunctor2(), madness::TwoElectronInterface< T, NDIM >::TwoElectronInterface(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), madness::projector_irrep::apply_symmetry_operators(), madness::BSHOperatorPtr3D(), madness::LowRankFunction< T, NDIM, LDIM >::check_orthonormality(), madness::PNO::check_orthonormality(), madness::FunctionImpl< T, NDIM >::Vphi_op_NS< opT, LDIM >::compute_error_from_inaccurate_refinement(), madness::Diamagnetic_potential_factor::compute_nabla_R_div_R(), madness::OEP::compute_ocep_correction(), madness::RandomizedMatrixDecomposition< T >::compute_range(), madness::SVDTensor< T >::compute_svd(), dist(), madness::FunctionImpl< T, NDIM >::do_apply(), madness::FunctionImpl< T, NDIM >::do_apply_kernel(), madness::FunctionImpl< T, NDIM >::do_apply_kernel2(), madness::RandomizedMatrixDecomposition< T >::do_compute_range(), madness::gelss(), madness::GMRES(), madness::GradBSHOperator(), GradBSHOperator_Joel(), madness::GradCoulombOperator(), gradPbarA(), madness::GradSlaterOperator(), madness::SeparatedConvolution< Q, NDIM >::make_coeff_for_operator(), make_grad_operator(), madness::Localizer::matrix_exponential(), madness::FunctionImpl< T, NDIM >::mulXXa(), madness::FunctionImpl< T, NDIM >::mulXXveca(), madness::detail::norm(), norm(), madness::hartree_leaf_op< T, NDIM >::operator()(), madness::hartree_convolute_leaf_op< T, NDIM, LDIM, opT >::operator()(), madness::FunctionImpl< T, NDIM >::pointwise_multiplier< LDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_check_symmetry_local::operator()(), MySteepestDescent::optimize(), SteepestDescent::optimize(), QuasiNewton::optimize(), madness::SteepestDescent::optimize(), madness::QuasiNewton::optimize(), madness::MolecularOptimizer::optimize_conjugate_gradients(), madness::MolecularOptimizer::optimize_quasi_newton(), madness::PeriodicBSHOperator3D(), madness::PeriodicBSHOperatorPtr3D(), madness::PeriodicHFExchangeOperator(), projector_external_dof(), madness::MolecularOptimizer::projector_external_dof(), Test7(), test_asymmetric(), test_hermiticity(), madness::test_inverse(), test_orthogonalization(), madness::FunctionImpl< T, NDIM >::tnorm(), and Calculation::update().
Type conversion makes a deep copy.
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, BINARY_OPTIMIZED_ITERATOR, Q(), and T().
|
inline |
Politically incorrect general indexing operation without bounds checking.
[in] | ind | Array containing index for each dimension |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, d, offset, and TENSOR_ASSERT.
|
inline |
Politically incorrect general indexing operation without bounds checking.
[in] | ind | Array containing index for each dimension |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, d, offset, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 1d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 1d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d SliceTensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d constant Tensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 3d SliceTensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 3d constant Tensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-4d SliceTensor that views the specified range of the 4d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-4d constant Tensor that views the specified range of the 4d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-5d SliceTensor that views the specified range of the 5d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-5d constant Tensor that views the specified range of the 5d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-6d SliceTensor that views the specified range of the 6d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1-6d constant Tensor that views the specified range of the 6d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d SliceTensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d constant Tensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1d constant Tensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d SliceTensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 2d constant Tensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
Return a 1d constant Tensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), s0, and TENSOR_ASSERT.
|
inline |
General slicing operation.
[in] | s | array containing slice for each dimension |
|
inline |
General slicing operation (const)
[in] | s | array containing slice for each dimension |
|
inline |
General indexing operation with bounds checking.
[in] | ind | Vector containing index for each dimension |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, d, and TENSOR_ASSERT.
|
inline |
General indexing operation with bounds checking.
[in] | ind | Vector containing index for each dimension |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, d, and TENSOR_ASSERT.
|
inline |
General slicing operation.
[in] | s | Vector containing slice for each dimension |
References TENSOR_ASSERT.
|
inline |
General slicing operation (const)
[in] | s | Vector containing slice for each dimension |
References TENSOR_ASSERT.
|
inline |
1-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
1-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 2d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 2d SliceTensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 2d constant Tensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 1d constant Tensor that views the specified range of the 3d Tensor.
References k, madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
2-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
2-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
Return a 1d SliceTensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
Return a 1d constant Tensor that views the specified range of the 3d Tensor.
References madness::BaseTensor::ndim(), and TENSOR_ASSERT.
|
inline |
3-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, and TENSOR_ASSERT.
|
inline |
3-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, and TENSOR_ASSERT.
|
inline |
4-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, and TENSOR_ASSERT.
|
inline |
4-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, and TENSOR_ASSERT.
|
inline |
5-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
[in] | m | index for dimension 4 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, m, and TENSOR_ASSERT.
|
inline |
5-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
[in] | m | index for dimension 4 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, m, and TENSOR_ASSERT.
|
inline |
6-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
[in] | m | index for dimension 4 |
[in] | n | index for dimension 5 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, m, and TENSOR_ASSERT.
|
inline |
6-d indexing operation without bounds checking.
[in] | i | index for dimension 0 |
[in] | j | index for dimension 1 |
[in] | k | index for dimension 2 |
[in] | l | index for dimension 3 |
[in] | m | index for dimension 4 |
[in] | n | index for dimension 5 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, k, m, and TENSOR_ASSERT.
|
inline |
Multiplication of tensor by a scalar of a supported type to produce a new tensor.
[in] | x | Scalar value |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, BINARY_OPTIMIZED_ITERATOR, Q(), T(), and TENSOR_RESULT_TYPE.
|
inline |
Inplace multiplication by scalar of supported type.
[in] | x | Scalar value |
References T(), and UNARY_OPTIMIZED_ITERATOR.
|
inline |
Add a scalar of the same type to all elements of a tensor producing a new tensor.
[in] | x | Scalar value |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, BINARY_OPTIMIZED_ITERATOR, Q(), T(), and TENSOR_RESULT_TYPE.
|
inline |
Addition of two tensors to produce a new tensor.
[in] | t | Conforming tensor to be added out-of-place to this tensor |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, Q(), T(), TENSOR_RESULT_TYPE, and TERNARY_OPTIMIZED_ITERATOR.
|
inline |
Inplace increment by scalar of supported type.
[in] | x | Scalar value |
References T(), and UNARY_OPTIMIZED_ITERATOR.
|
inline |
Inplace addition of two tensors.
[in] | t | Conforming tensor to be added in-place to this tensor |
References BINARY_OPTIMIZED_ITERATOR, and T().
|
inline |
Unary negation producing a new tensor.
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, BINARY_OPTIMIZED_ITERATOR, and T().
|
inline |
Subtract a scalar of the same type from all elements producing a new tensor.
[in] | x | Scalar value |
|
inline |
Subtraction of two tensors to produce a new tensor.
[in] | t | Conforming tensor to be subtracted out-of-place from this tensor |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, Q(), T(), TENSOR_RESULT_TYPE, and TERNARY_OPTIMIZED_ITERATOR.
|
inline |
Inplace decrement by scalar of supported type.
[in] | x | Scalar value |
References T(), and UNARY_OPTIMIZED_ITERATOR.
|
inline |
Inplace subtraction of two tensors.
[in] | t | Conforming tensor to be subtracted in-place from this tensor |
References BINARY_OPTIMIZED_ITERATOR, and T().
|
inline |
Divide tensor by a scalar of a supported type to produce a new tensor.
[in] | x | Scalar value |
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, BINARY_OPTIMIZED_ITERATOR, Q(), T(), and TENSOR_RESULT_TYPE.
Assignment is shallow (same as copy constructor)
Caveat emptor: The shallow assignment has many virtues but enables you to violate constness with simple code such as
References madness::BaseTensor::_dim, madness::BaseTensor::_ndim, madness::Tensor< T >::_p, madness::Tensor< T >::_shptr, madness::BaseTensor::_size, madness::BaseTensor::_stride, MADNESS_PRAGMA_GCC, madness::pop(), and TENSOR_MAXDIM.
Inplace fill tensor with scalar.
[in] | x | Value used to fill tensor via assigment |
References T(), and UNARY_OPTIMIZED_ITERATOR.
|
inline |
1-d indexing operation using [] without bounds checking.
[in] | i | index for dimension 0 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
1-d indexing operation using [] without bounds checking.
[in] | i | index for dimension 0 |
References madness::BaseTensor::_dim, madness::Tensor< T >::_p, madness::BaseTensor::_stride, and TENSOR_ASSERT.
|
inline |
Return the product of all elements of the tensor.
References T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::FunctionDefaults< NDIM >::recompute_cell_info().
|
inline |
Returns a pointer to the internal data.
References madness::Tensor< T >::_p.
Referenced by madness::Convolution1D< Q >::Convolution1D(), madness::TensorIterator< T, Q, R >::TensorIterator(), madness::FunctionCommonData< T, NDIM >::_init_quadrature(), madness::FunctionImpl< T, NDIM >::apply_1d_realspace_push_op(), madness::SeparatedConvolution< Q, NDIM >::apply_transformation(), madness::Localizer::compute_core_valence_separation_transformation_matrix(), madness::FunctionImpl< T, NDIM >::do_dot_localX(), madness::FunctionImpl< T, NDIM >::do_inner_localX(), AtomicBasis::eval_guess_density(), madness::AtomicBasis::eval_guess_density(), madness::FunctionImpl< T, NDIM >::eval_plot_cube(), madness::XCfunctional::exc(), madness::fast_transform(), madness::fcube(), madness::Tensor< T >::fillrandom(), madness::Tensor< T >::gaxpy(), madness::geev(), geev_(), geev_(), madness::gelss(), gelss_(), gelss_(), geqp3_(), geqp3_(), madness::geqp3_result(), madness::gesv(), gesvd_(), gesvd_(), get_fock_transformation(), madness::SCF::get_fock_transformation(), madness::ggev(), ggev_(), ggev_(), madness::inner(), madness::inner(), madness::inner_result(), madness::inverse(), madness::archive::ArchiveLoadImpl< Archive, Tensor< T > >::load(), madness::load_coeffs(), madness::Localizer::localize_boys(), madness::Localizer::localize_new(), madness::lq_result(), main(), main(), madness::matrix_dot(), madness::matrix_inner(), madness::matrix_inner_old(), madness::Convolution1D< Q >::mod_nonstandard(), madness::Convolution1D< Q >::nonstandard(), madness::xc_lda_potential::operator()(), myunaryop_square< T, NDIM >::operator()(), BoysLocalization::operator()(), madness::orgqr(), madness::outer_result(), madness::plotdx(), madness::FunctionImpl< T, NDIM >::print_stats(), readin(), madness::TensorIterator< T, Q, R >::reuse(), madness::GenericConvolution1D< Q, opT >::rnlp(), madness::rr_cholesky(), madness::archive::ArchiveStoreImpl< Archive, Tensor< T > >::store(), madness::svd(), madness::svd_result(), madness::syev(), syev_(), syev_(), madness::sygv(), sygv_(), sygv_(), madness::SystolicMatrixAlgorithm< T >::unshuffle(), madness::SubspaceK< T, NDIM >::update_subspace(), madness::Subspace< T, NDIM >::update_subspace(), madness::SCF::update_subspace(), and madness::XCfunctional::vxc().
|
inline |
Returns a pointer to the internal data.
References madness::Tensor< T >::_p.
|
inline |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor.
[in] | d | Array containing size of each new dimension |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor.
[in] | d | Array containing size of each new dimension |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor.
[in] | ndimnew | Number of dimensions in the result |
[in] | d | Array containing size of each new dimension |
References d, and madness::BaseTensor::reshape_inplace().
Referenced by madness::SRConf< T >::add_SVD(), madness::apply(), madness::GTHPseudopotential< Q >::apply_potential(), madness::F12Potentials::compute_f12_correction(), madness::SVDTensor< T >::concatenate(), madness::GenTensor< T >::convert_inplace(), madness::TensorTrain< T >::emul(), madness::Tensor< T >::flat(), madness::Tensor< T >::flat(), madness::SRConf< T >::flat_vector(), madness::SRConf< T >::flat_vector(), madness::FunctionImpl< T, NDIM >::project_out_op< LDIM >::operator()(), madness::outer(), madness::FunctionImpl< T, NDIM >::partial_inner_contract(), madness::SRConf< T >::reconstruct(), slymer::ES_Interface::reset(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::Tensor< T >::reshape(), madness::FunctionImpl< T, NDIM >::tnorm(), madness::TensorTrain< T >::trace(), madness::TensorTrain< T >::truncate(), madness::HartreeFock< T, NDIM >::value(), madness::Nemo::value(), madness::MolecularEnergy::value(), and madness::Znemo::value().
|
inline |
Returns new view/tensor reshaping size/number of dimensions to conforming tensor.
[in] | ndimnew | Number of dimensions in the result |
[in] | d | Array containing size of each new dimension |
References d, and madness::BaseTensor::reshape_inplace().
|
inline |
Returns new view/tensor rehapings to conforming 1-d tensor with given dimension.
[in] | dim0 | Size of new dimension 0 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehapings to conforming 1-d tensor with given dimension.
[in] | dim0 | Size of new dimension 0 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 2-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 3-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 4-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
[in] | dim4 | Size of new dimension 4 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 5-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
[in] | dim4 | Size of new dimension 4 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
[in] | dim4 | Size of new dimension 4 |
[in] | dim5 | Size of new dimension 5 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Returns new view/tensor rehaping to conforming 6-d tensor with given dimensions.
[in] | dim0 | Size of new dimension 0 |
[in] | dim1 | Size of new dimension 1 |
[in] | dim2 | Size of new dimension 2 |
[in] | dim3 | Size of new dimension 3 |
[in] | dim4 | Size of new dimension 4 |
[in] | dim5 | Size of new dimension 5 |
References d, and madness::Tensor< T >::reshape().
|
inline |
Inplace multiplication by scalar of supported type (legacy name)
[in] | x | Scalar value |
Referenced by MolecularNuclearPotentialFunctor2::MolecularNuclearPotentialFunctor2(), madness::SeparatedConvolution< Q, NDIM >::apply_transformation3(), madness::Znemo::canonicalize(), madness::Nemo::compute_IR_intensities(), DF::diagonalize(), madness::FunctionImpl< T, NDIM >::do_binary_op(), madness::FunctionImpl< T, NDIM >::do_mul(), madness::Nemo::hessian(), QuasiNewton::hessian_update_sr1(), madness::QuasiNewton::hessian_update_sr1(), iterate(), iterate(), MiniDFT::kinetic_energy_matrix(), madness::Localizer::localize_boys(), madness::Localizer::localize_new(), main(), madness::Localizer::matrix_exponential(), madness::FunctionImpl< T, NDIM >::mul(), madness::detail::scaleinplace< T, NDIM >::operator()(), madness::FunctionImpl< T, NDIM >::do_unary_op_value_inplace< opT >::operator()(), BoysLocalization::operator()(), QuasiNewton::optimize(), madness::QuasiNewton::optimize(), madness::MolecularOptimizer::optimize_quasi_newton(), madness::FunctionImpl< T, NDIM >::phi_for_mul(), madness::plot_cubefile(), madness::FunctionImpl< T, NDIM >::project(), projector_external_dof(), madness::MolecularOptimizer::projector_external_dof(), and madness::Localizer::undo_reordering().
|
inline |
Inplace set elements of *this
less than x
in absolute magnitude to zero.
[in] | x | Scalar value |
References std::abs(), T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::ortho3(), and madness::ortho5().
|
inline |
Returns new view/tensor splitting dimension i
as dimi0*dimi1
to produce conforming d+1 dimension tensor.
References madness::BaseTensor::splitdim_inplace().
|
inline |
Returns new view/tensor splitting dimension i
as dimi0*dimi1
to produce conforming d+1 dimension tensor.
References madness::BaseTensor::splitdim_inplace().
|
inline |
Returns the sum of all elements of the tensor.
References T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::projector_irrep::apply_symmetry_operators(), madness::Nemo::compute_energy_regularized(), madness::FunctionImpl< T, NDIM >::inner_ext_recursive(), DF::iterate(), madness::CC2::iterate_singles(), madness::TDHF::make_overlap_matrix(), madness::TDHF::make_perturbed_fock_matrix(), madness::AtomicBasisSet::modify_dmat_psp(), madness::SRConf< T >::normf(), madness::TDHF::oscillator_strength_length(), madness::TDHF::oscillator_strength_velocity(), madness::FunctionImpl< T, NDIM >::print_stats(), su_complex(), and madness::SRConf< T >::trace().
|
inline |
Returns the sum of the squares of the elements.
References T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by madness::Znemo::iterate(), madness::TDHF::oscillator_strength_length(), madness::TDHF::oscillator_strength_velocity(), madness::HartreeFock< T, NDIM >::value(), madness::MP2::value(), madness::Nemo::value(), madness::MolecularEnergy::value(), Test::value(), and CoreFittingTarget::value().
|
inline |
Returns new view/tensor swaping dimensions i
and j
.
References madness::BaseTensor::swapdim_inplace().
Referenced by madness::conj_transpose(), PNOTensors::Tensor_IJ_IK< T >::set(), PNOTensors::Tensor_IJ_KJ< T >::set(), Test7(), madness::transform_dir(), and madness::transpose().
|
inline |
Returns new view/tensor swaping dimensions i
and j
.
References madness::BaseTensor::swapdim_inplace().
|
inline |
Return the trace of two tensors with complex conjugate of the leftmost (i.e., this)
References BINARY_OPTIMIZED_ITERATOR, madness::conditional_conj(), Q(), T(), and TENSOR_RESULT_TYPE.
|
inline |
Return iterator over three tensors.
References madness::Tensor< T >::fusedim(), and q().
Return the trace of two tensors (no complex conjugate invoked)
References BINARY_OPTIMIZED_ITERATOR, and T().
Referenced by madness::MP2::compute_gQf(), dot_product(), QuasiNewton::hessian_update_bfgs(), madness::QuasiNewton::hessian_update_bfgs(), madness::Localizer::localize_boys(), madness::Localizer::localize_new(), madness::Localizer::matrix_exponential(), madness::FunctionImpl< T, NDIM >::do_inner_local_on_demand< R >::operator()(), QuasiNewton::optimize(), madness::QuasiNewton::optimize(), madness::MolecularOptimizer::optimize_quasi_newton(), madness::GenTensor< T >::TENSOR_RESULT_TYPE(), test_Kcommutator(), and madness::TensorTrain< T >::trace().
|
inline |
Return iterator over single tensor.
References madness::Tensor< T >::fusedim().
Referenced by MySteepestDescent::check_positive(), madness::inner_result(), madness::operator<<(), madness::outer_result(), and madness::MyPmap< D >::prepare_not_so_simple_map().
|
inline |
Inplace apply a unary function to each element of the tensor.
References op(), T(), and UNARY_OPTIMIZED_ITERATOR.
Referenced by map_tensor(), madness::XCOperator< T, NDIM >::logme::operator()(), madness::XCOperator< T, NDIM >::expme::operator()(), and madness::apply_kernel_helper::slater_apply().
|
protected |
Referenced by madness::SliceTensor< T >::SliceTensor(), madness::Tensor< T >::allocate(), madness::Tensor< T >::deallocate(), madness::Tensor< T >::max(), madness::Tensor< T >::min(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator()(), madness::Tensor< T >::operator=(), madness::Tensor< T >::operator[](), madness::Tensor< T >::operator[](), madness::Tensor< T >::ptr(), and madness::Tensor< T >::ptr().
|
protected |