pub trait ArrayLinalgNorms<N: NumericOps>{
// Required methods
fn norm(
&self,
ord: Option<impl NormOrdType>,
axis: Option<Vec<isize>>,
keepdims: Option<bool>,
) -> Result<Array<N>, ArrayError>;
fn det(&self) -> Result<Array<N>, ArrayError>;
}Expand description
ArrayTrait - Array Linalg Norms functions
Required Methods§
Sourcefn norm(
&self,
ord: Option<impl NormOrdType>,
axis: Option<Vec<isize>>,
keepdims: Option<bool>,
) -> Result<Array<N>, ArrayError>
fn norm( &self, ord: Option<impl NormOrdType>, axis: Option<Vec<isize>>, keepdims: Option<bool>, ) -> Result<Array<N>, ArrayError>
Calculates matrix or vector norm
§Arguments
ord- order of the norm: {non-zero int, inf, -inf,fro,nuc}. optionalaxis- axis along which vector norms are to be calculated. optionalkeepdims- if true, the result will broadcast correctly against the input. optional
§Examples
use arr_rs::prelude::*;
let array_a = Array::arange(-4., 4., None);
let array_b = array_a.reshape(&[3, 3]);
let expected = Array::single(7.745966692414834);
assert_eq!(expected, array_a.norm(None::<NormOrd>, None, None));
assert_eq!(expected, array_b.norm(None::<NormOrd>, None, None));§Errors
may returns ArrayError
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.