coshm

Function coshm 

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

Compute the matrix hyperbolic cosine.

The matrix hyperbolic cosine is computed using: cosh(A) = (exp(A) + exp(-A)) / 2

For efficiency, this can also be computed using the series expansion: cosh(A) = I + A²/2! + A⁴/4! + A⁶/6! + …

§Arguments

  • a - Input square matrix

§Returns

  • Matrix hyperbolic cosine of a

§Examples

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

let a = array![[0.0_f64, 1.0], [1.0, 0.0]];
let cosh_a = coshm(&a.view()).unwrap();