VISR  0.11.8
Versatile Interactive Scene Renderer
visr::python::bindinghelpers Namespace Reference

Functions

template<typename DataType >
efl::BasicMatrix< DataType > matrixFromNdArray (pybind11::array_t< SampleType > const &array, std::size_t alignment=0)
 
template<typename DataType >
efl::BasicVector< DataType > vectorFromNdArray (pybind11::array_t< SampleType > const &array, std::size_t alignment=0)
 

Function Documentation

◆ matrixFromNdArray()

template<typename DataType >
efl::BasicMatrix<DataType> visr::python::bindinghelpers::matrixFromNdArray ( pybind11::array_t< SampleType > const &  array,
std::size_t  alignment = 0 
)

Create a efl::BasicMatrix from a 2-D numpy.ndarray.

Template Parameters
DataTypeThe element data type.
Parameters
arrayA 2D ndarray with the Numpy equivalent of DataType.
alignmentElement alignment of the resulting BasicMatrix, default 0.
Returns
Initialized matrix object.

◆ vectorFromNdArray()

template<typename DataType >
efl::BasicVector<DataType> visr::python::bindinghelpers::vectorFromNdArray ( pybind11::array_t< SampleType > const &  array,
std::size_t  alignment = 0 
)

Create a efl::BasicMatrix from a 2-D numpy.ndarray.

Template Parameters
DataTypeThe element data type.
Parameters
arrayA 2D ndarray with the Numpy equivalent of DataType.
alignmentElement alignment of the resulting BasicMatrix, default 0.
Returns
Initialized matrix object.
Note
Dynamically converting from different dtypes would be more require a runtime dispatch to a suitable conversion function.