pub struct NamedMatrix<'a, T> {
pub col_names: BTreeMap<String, usize>,
pub row_names: BTreeMap<String, usize>,
pub values: MatRef<'a, T>,
}Expand description
Structure to store named matrices
Fields§
§col_names: BTreeMap<String, usize>A BTreeMap representing the column names and the col indices
row_names: BTreeMap<String, usize>A BTreeMap representing the row names and the row indices
values: MatRef<'a, T>A faer matrix reference representing the matrix values.
Implementations§
Source§impl<'a, T> NamedMatrix<'a, T>where
T: BixverseFloat,
impl<'a, T> NamedMatrix<'a, T>where
T: BixverseFloat,
Sourcepub fn get_sub_mat(
&self,
rows_to_select: Option<&[&str]>,
cols_to_select: Option<&[&str]>,
) -> Option<Mat<T>>
pub fn get_sub_mat( &self, rows_to_select: Option<&[&str]>, cols_to_select: Option<&[&str]>, ) -> Option<Mat<T>>
Return a submatrix based on the row names and columns to select.
If no rows or columns are specified, returns the full matrix. If empty slices are provided, returns None.
§Params
rows_to_select- Names of the row featurescols_to_select- Names of the column features
§Returns
The faer Matrix with the values from the rows and columns.
Sourcepub fn get_full_mat(&self) -> Mat<T>
pub fn get_full_mat(&self) -> Mat<T>
Sourcepub fn get_col_names_refs(&self) -> Vec<&String>
pub fn get_col_names_refs(&self) -> Vec<&String>
Get column names as references (for temporary use within same scope)
§Returns
The column names as a reference
Sourcepub fn get_row_names_refs(&self) -> Vec<&String>
pub fn get_row_names_refs(&self) -> Vec<&String>
Get row names as references (for temporary use within same scope)
§Returns
The row names as a reference
Trait Implementations§
Source§impl<'a, T: Clone> Clone for NamedMatrix<'a, T>
impl<'a, T: Clone> Clone for NamedMatrix<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for NamedMatrix<'a, T>
impl<'a, T> RefUnwindSafe for NamedMatrix<'a, T>where
Mat<Ref<'a, T>>: RefUnwindSafe,
impl<'a, T> Send for NamedMatrix<'a, T>
impl<'a, T> Sync for NamedMatrix<'a, T>
impl<'a, T> Unpin for NamedMatrix<'a, T>
impl<'a, T> UnsafeUnpin for NamedMatrix<'a, T>where
Mat<Ref<'a, T>>: UnsafeUnpin,
impl<'a, T> UnwindSafe for NamedMatrix<'a, T>where
Mat<Ref<'a, T>>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.