Trait ArrayHyperbolic

Source
pub trait ArrayHyperbolic<N: Numeric>
where Self: Sized + Clone,
{ // Required methods fn sinh(&self) -> Result<Array<N>, ArrayError>; fn cosh(&self) -> Result<Array<N>, ArrayError>; fn tanh(&self) -> Result<Array<N>, ArrayError>; fn asinh(&self) -> Result<Array<N>, ArrayError>; fn acosh(&self) -> Result<Array<N>, ArrayError>; fn atanh(&self) -> Result<Array<N>, ArrayError>; }
Expand description

ArrayTrait - Array Hyperbolic functions

Required Methods§

Source

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

Compute the hyperbolic sine of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![-1., 0., 1.]).unwrap();
assert_eq!(Array::flat(vec![-1.1752011936438014, 0., 1.1752011936438014]), arr.sinh());
§Errors

may returns ArrayError

Source

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

Compute the hyperbolic cosine of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![-1., 0., 1.]).unwrap();
assert_eq!(Array::flat(vec![1.5430806348152437, 1., 1.5430806348152437]), arr.cosh());
§Errors

may returns ArrayError

Source

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

Compute the hyperbolic tangent of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![-1., 0., 1.]).unwrap();
assert_eq!(Array::flat(vec![-0.7615941559557649, 0., 0.7615941559557649]), arr.tanh());
§Errors

may returns ArrayError

Source

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

Compute the inverse hyperbolic sine of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![-1., 0., 1.]).unwrap();
assert_eq!(Array::flat(vec![-0.881373587019543, 0., 0.881373587019543]), arr.asinh());
§Errors

may returns ArrayError

Source

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

Compute the inverse hyperbolic cosine of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![1., 2., 3.]).unwrap();
assert_eq!(Array::flat(vec![0., 1.3169578969248166, 1.762747174039086]), arr.acosh());
§Errors

may returns ArrayError

Source

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

Compute the inverse hyperbolic tangent of array elements

§Examples
use arr_rs::prelude::*;

let arr = Array::flat(vec![-1., 0., 1.]).unwrap();
assert_eq!(Array::flat(vec![-f64::INFINITY, 0., f64::INFINITY]), arr.atanh());
§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: Numeric> ArrayHyperbolic<N> for Result<Array<N>, ArrayError>

Source§

fn sinh(&self) -> Self

Source§

fn cosh(&self) -> Self

Source§

fn tanh(&self) -> Self

Source§

fn asinh(&self) -> Self

Source§

fn acosh(&self) -> Self

Source§

fn atanh(&self) -> Self

Implementors§