extendr_api::wrapper::matrix

Type Alias RMatrix3D

Source
pub type RMatrix3D<T> = RArray<T, [usize; 3]>;

Aliased Type§

struct RMatrix3D<T> {
    robj: Robj,
    dim: [usize; 3],
    _data: PhantomData<T>,
}

Fields§

§robj: Robj

Owning Robj (probably should be a Pin).

§dim: [usize; 3]

Dimensions of the array.

§_data: PhantomData<T>

Implementations§

Source§

impl<T> RMatrix3D<T>
where T: ToVectorValue, Robj: for<'a> AsTypedSlice<'a, T>,

Source

pub fn new_matrix3d<F: Clone + FnMut(usize, usize, usize) -> T>( nrows: usize, ncols: usize, nmatrix: usize, f: F, ) -> Self

Source

pub fn nrows(&self) -> usize

Get the number of rows.

Source

pub fn ncols(&self) -> usize

Get the number of columns.

Source

pub fn nsub(&self) -> usize

Get the number of submatrices.

Trait Implementations§

Source§

impl<T> TryFrom<&Robj> for RMatrix3D<T>
where Robj: for<'a> AsTypedSlice<'a, T>,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(robj: &Robj) -> Result<Self>

Performs the conversion.
Source§

impl<T> TryFrom<Robj> for RMatrix3D<T>
where Robj: for<'a> AsTypedSlice<'a, T>,

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(robj: Robj) -> Result<Self>

Performs the conversion.