MCPcopy Create free account
hub / github.com/PyO3/rust-numpy / try_as_matrix

Method try_as_matrix

src/array.rs:1697–1713  ·  view source on GitHub ↗
(
        &self,
    )

Source from the content-addressed store, hash-verified

1695
1696 #[cfg(feature = "nalgebra")]
1697 unsafe fn try_as_matrix<R, C, RStride, CStride>(
1698 &self,
1699 ) -> Option<nalgebra::MatrixView<'_, T, R, C, RStride, CStride>>
1700 where
1701 T: nalgebra::Scalar + Element,
1702 D: Dimension,
1703 R: nalgebra::Dim,
1704 C: nalgebra::Dim,
1705 RStride: nalgebra::Dim,
1706 CStride: nalgebra::Dim,
1707 {
1708 let (shape, strides) = try_as_matrix_shape_strides(self)?;
1709
1710 let storage = nalgebra::ViewStorage::from_raw_parts(self.data(), shape, strides);
1711
1712 Some(nalgebra::Matrix::from_data(storage))
1713 }
1714
1715 #[cfg(feature = "nalgebra")]
1716 unsafe fn try_as_matrix_mut<R, C, RStride, CStride>(

Callers

nothing calls this directly

Calls 2

dataMethod · 0.80

Tested by

no test coverage detected