MADNESS 0.10.1
|
Test code for Tensor, TensorIterator, SliceTensor, etc. More...
#include <madness/tensor/tensor.h>
#include <iostream>
#include <cstdio>
#include <complex>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <madness/world/print.h>
Typedefs | |
typedef std::complex< double > | double_complex |
typedef std::complex< float > | float_complex |
Functions | |
template<typename T , typename Q > | |
bool | check (const T &t, const Q &q, double tol=1e-7) |
void | error (const char *msg, int code) |
int | main () |
template<typename T > | |
double | mynorm (T x) |
template<> | |
double | mynorm< double_complex > (double_complex x) |
template<> | |
double | mynorm< float_complex > (float_complex x) |
template<typename T , typename Q > | |
void | Test1 () |
template<typename T > | |
void | Test3 () |
template<class T > | |
void | Test5 () |
template<class T > | |
void | Test6 () |
template<> | |
void | Test6a (Tensor< double_complex > &, long[]) |
template<> | |
void | Test6a (Tensor< float_complex > &, long[]) |
template<class T > | |
void | Test6a (Tensor< T > &f, long ind[]) |
template<class T > | |
void | Test7 () |
template<class T > | |
void | Test8 () |
Test code for Tensor, TensorIterator, SliceTensor, etc.
typedef std::complex<double> double_complex |
typedef std::complex<float> float_complex |
void error | ( | const char * | msg, |
int | code | ||
) |
int main | ( | void | ) |
double mynorm< double_complex > | ( | double_complex | x | ) |
double mynorm< float_complex > | ( | float_complex | x | ) |
References check(), d, madness::BaseTensor::dim(), e(), error(), madness::Tensor< T >::fillindex(), madness::Tensor< T >::fillrandom(), madness::BaseTensor::id(), IND1, IND2, IND3, IND4, IND5, IND6, ITERATOR1, ITERATOR2, ITERATOR3, ITERATOR4, ITERATOR5, ITERATOR6, madness::BaseTensor::ndim(), madness::BaseTensor::size(), madness::BaseTensor::stride(), and madness::tensor_type_names.
void Test3 | ( | ) |
References ITERATOR3, and madness::tensor_type_names.
void Test5 | ( | ) |
References a, std::abs(), b, c, check(), madness::copy(), d, e(), error(), madness::f, madness::Tensor< T >::fillrandom(), IND5, ITERATOR5, T(), and madness::tensor_type_names.
void Test6 | ( | ) |
References std::abs(), e(), error(), madness::f, madness::g, IND4, ITERATOR4, mynorm(), q(), T(), TENSOR_MAXDIM, madness::tensor_type_names, and Test6a().
void Test6a | ( | Tensor< double_complex > & | , |
long | [] | ||
) |
void Test6a | ( | Tensor< float_complex > & | , |
long | [] | ||
) |
References error(), madness::f, and T().
Referenced by Test6().
void Test7 | ( | ) |
References std::abs(), c, check(), madness::copy(), dave(), e(), error(), madness::fast_transform(), madness::Tensor< T >::fill(), madness::Tensor< T >::fillrandom(), fred(), madness::inner(), ITERATOR2, ITERATOR4, ITERATOR6, k, madness::Tensor< T >::normf(), madness::outer(), madness::print(), q(), sum, madness::Tensor< T >::swapdim(), T(), madness::tensor_type_names, and madness::transform().
void Test8 | ( | ) |