ArrayLinalgNorms

Trait ArrayLinalgNorms 

Source
pub trait ArrayLinalgNorms<N: NumericOps>
where Self: Sized + Clone,
{ // 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§

Source

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}. optional
  • axis - axis along which vector norms are to be calculated. optional
  • keepdims - 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

Source

fn det(&self) -> Result<Array<N>, ArrayError>

Compute the determinant of an array

§Examples
use arr_rs::prelude::*;

assert_eq!(Array::single(-14), Array::new(vec![3, 8, 4, 6], vec![2, 2]).det());
§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.

Implementations on Foreign Types§

Source§

impl<N: NumericOps> ArrayLinalgNorms<N> for Result<Array<N>, ArrayError>

Source§

fn norm( &self, ord: Option<impl NormOrdType>, axis: Option<Vec<isize>>, keepdims: Option<bool>, ) -> Self

Source§

fn det(&self) -> Self

Implementors§