|
MADNESS 0.10.1
|
#include <pybind11/pybind11.h>#include <pybind11/numpy.h>#include <pybind11/stl.h>#include <algorithm>#include <madness/tensor/tensor.h>
Functions | |
| void | bind_tensor (py::module_ &m) |
| static Tensor< double > | numpy_to_tensor (py::array_t< double, py::array::c_style > arr) |
| Convert a numpy array to a MADNESS Tensor<double> (copies data). | |
| static py::array_t< double > | tensor_to_numpy (const Tensor< double > &t) |
| Convert a MADNESS Tensor<double> to a numpy array (copies data). | |
| void bind_tensor | ( | py::module_ & | m | ) |
References madness::BaseTensor::dim(), m, madness::BaseTensor::ndim(), numpy_to_tensor(), madness::BaseTensor::size(), and tensor_to_numpy().
Referenced by PYBIND11_MODULE().
|
static |
Convert a numpy array to a MADNESS Tensor<double> (copies data).
References madness::Tensor< T >::ptr(), and madness::BaseTensor::size().
Referenced by bind_tensor().
|
static |
Convert a MADNESS Tensor<double> to a numpy array (copies data).
References madness::copy(), madness::BaseTensor::dim(), madness::BaseTensor::iscontiguous(), madness::BaseTensor::ndim(), madness::Tensor< T >::ptr(), madness::BaseTensor::size(), and tc.
Referenced by bind_tensor().