10#include <boost/python/detail/prefix.hpp>
14namespace PythonInterface {
18template <
typename ElementType> PyObject *
clone1D(
const std::vector<ElementType> &cvector);
19template <
typename ElementType> PyObject *
cloneND(
const ElementType *carray,
const int ndims, Py_intptr_t *dims);
27 template <
typename ElementType>
struct apply {
34 static PyObject *
create1D(
const std::vector<ElementType> &cvector) {
return Impl::clone1D<ElementType>(cvector); }
42 static PyObject *
createFromArray(
const ElementType *carray,
const int ndims, Py_intptr_t *dims) {
43 return Impl::cloneND<ElementType>(carray, ndims, dims);
PyObject * cloneND(const ElementType *carray, const int ndims, Py_intptr_t *dims)
Returns a new numpy array with the a copy of the data from array.
PyObject * clone1D(const std::vector< ElementType > &cvector)
Returns a new numpy array with the a copy of the data from 1D vector with the exception of string ele...
Helper class which provides the Collimation Length for SANS instruments.
static PyObject * createFromArray(const ElementType *carray, const int ndims, Py_intptr_t *dims)
Returns a Numpy array that has a copy of the array data.
static PyObject * create1D(const std::vector< ElementType > &cvector)
Returns a Numpy array that has a copy of the vectors data.
Clone is a policy (in the C++ sense)for converting to an ND Array.