Function nalgebra_numpy::matrix_slice_from_numpy [−][src]
pub unsafe fn matrix_slice_from_numpy<'a, N, R, C>(
_py: Python<'_>,
input: &'a PyAny
) -> Result<MatrixSlice<'a, N, R, C, Dynamic, Dynamic>, Error> where
N: Scalar + Element,
R: Dim,
C: Dim,
Create a nalgebra view from a numpy array.
The array dtype must match the output type exactly.
If desired, you can convert the array to the desired type in Python
using numpy.ndarray.astype
.
Safety
This function creates a const slice that references data owned by Python. The user must ensure that the data is not modified through other pointers or references.