tanhm

Function tanhm 

Source
pub fn tanhm<F>(a: &ArrayView2<'_, F>) -> LinalgResult<Array2<F>>
where F: Float + NumAssign + Sum + One + Send + Sync + ScalarOperand + 'static,
Expand description

Compute the matrix hyperbolic tangent.

The matrix hyperbolic tangent is computed as tanh(A) = sinh(A) * cosh(A)^{-1}

§Arguments

  • a - Input square matrix

§Returns

  • Matrix hyperbolic tangent of a

§Examples

use scirs2_core::ndarray::array;
use scirs2_linalg::matrix_functions::tanhm;

let a = array![[0.1_f64, 0.0], [0.0, 0.1]];
let tanh_a = tanhm(&a.view()).unwrap();