library.matop Submodule

Module Summary

Interfaces for the NAG Mark 30.0 matop Chapter.

matop - Matrix Operations, Including Inversion

This module provides facilities for four types of problem:

  1. matrix inversion;

  2. matrix factorizations;

  3. matrix arithmetic and manipulation;

  4. matrix functions.

See Background to the Problems where these problems are discussed.

See Also

naginterfaces.library.examples.matop :

This subpackage contains examples for the matop module. See also the Examples subsection.

Functionality Index

Action of the matrix exponential on a complex matrix: complex_gen_matrix_actexp()

Action of the matrix exponential on a complex matrix (reverse communication): complex_gen_matrix_actexp_rcomm()

Action of the matrix exponential on a real matrix: real_gen_matrix_actexp()

Action of the matrix exponential on a real matrix (reverse communication): real_gen_matrix_actexp_rcomm()

Inversion (also see submodule lapacklin )

real matrix

pseudo-inverse: real_gen_pseudinv()

real symmetric positive definite matrix

accurate inverse: real_symm_posdef_inv()

approximate inverse: real_symm_posdef_inv_noref()

Matrix Arithmetic and Manipulation

matrix addition

complex matrices: complex_addsub()

real matrices: real_addsub()

matrix multiplication

rectangular matrices

update

real matrices: real_gen_matmul()

triangular matrices

in-place

update

complex matrices: complex_tri_matmul()

real matrices: real_tri_matmul()

matrix storage conversion

full to packed triangular storage

complex matrices: ztrttp()

real matrices: dtrttp()

full to Rectangular Full Packed storage

complex matrix: ztrttf()

real matrix: dtrttf()

packed band rectangular storage, special provision for diagonal

complex matrices: complex_band_pack()

real matrices: real_band_pack()

packed triangular square storage, special provision for diagonal

complex matrices: complex_tri_pack()

real matrices: real_tri_pack()

packed triangular to full storage

complex matrices: ztpttr()

real matrices: dtpttr()

packed triangular to Rectangular Full Packed storage

complex matrices: ztpttf()

real matrices: dtpttf()

Rectangular Full Packed to full storage

complex matrices: ztfttr()

real matrices: dtfttr()

Rectangular Full Packed to packed triangular storage

complex matrices: ztfttp()

real matrices: dtfttp()

matrix subtraction

real matrices: real_addsub()

matrix transpose: real_gen_trans_inplace()

Matrix function

complex Hermitian matrix

matrix exponential: complex_herm_matrix_exp()

matrix function: complex_herm_matrix_fun()

complex matrix

condition number for a matrix exponential: complex_gen_matrix_cond_exp()

condition number for a matrix exponential, logarithm, sine, cosine, sinh or cosh: complex_gen_matrix_cond_std()

condition number for a matrix function, using numerical differentiation: complex_gen_matrix_cond_num()

condition number for a matrix function, using user-supplied derivatives: complex_gen_matrix_cond_usd()

condition number for a matrix logarithm: complex_gen_matrix_cond_log()

condition number for a matrix power: complex_gen_matrix_cond_pow()

condition number for the matrix square root, logarithm, sine, cosine, sinh or cosh: complex_gen_matrix_cond_sqrt()

Fréchet derivative

general power

matrix exponential: complex_gen_matrix_exp()

matrix exponential, sine, cosine, sinh or cosh: complex_gen_matrix_fun_std()

matrix function, using numerical differentiation: complex_gen_matrix_fun_num()

matrix function, using user-supplied derivatives: complex_gen_matrix_fun_usd()

matrix logarithm: complex_gen_matrix_log()

matrix square root: complex_gen_matrix_sqrt()

upper triangular

matrix square root: complex_tri_matrix_sqrt()

real matrix

condition number for a matrix exponential: real_gen_matrix_cond_exp()

condition number for a matrix function, using numerical differentiation: real_gen_matrix_cond_num()

condition number for a matrix function, using user-supplied derivatives: real_gen_matrix_cond_usd()

condition number for a matrix logarithm: real_gen_matrix_cond_log()

condition number for a matrix power: real_gen_matrix_cond_pow()

condition number for the matrix exponential, logarithm, sine, cosine, sinh or cosh: real_gen_matrix_cond_std()

condition number for the matrix square root, logarithm, sine, cosine, sinh or cosh: real_gen_matrix_cond_sqrt()

Fréchet derivative

matrix exponential: real_gen_matrix_frcht_exp()

matrix logarithm: real_gen_matrix_frcht_log()

matrix power: real_gen_matrix_frcht_pow()

general power

matrix exponential: real_gen_matrix_pow()

matrix exponential: real_gen_matrix_exp()

matrix exponential, sine, cosine, sinh or cosh: real_gen_matrix_fun_std()

matrix function, using numerical differentiation: real_gen_matrix_fun_num()

matrix function, using user-supplied derivatives: real_gen_matrix_fun_usd()

matrix logarithm: real_gen_matrix_log()

matrix square root: real_gen_matrix_sqrt()

upper quasi-triangular

matrix square root: real_tri_matrix_sqrt()

real symmetric matrix

matrix exponential: real_symm_matrix_exp()

matrix function: real_symm_matrix_fun()

Matrix Transformations

complex matrix

factorization: complex_gen_rq()

complex matrix, form unitary matrix: complex_gen_rq_formq()

complex upper trapezoidal matrix

factorization: complex_trapez_rq()

eigenproblem , , banded

reduction to standard symmetric problem: real_symm_posdef_geneig()

modified Cholesky factorization, form positive definite perturbed input matrix: real_mod_chol_perturbed_a()

modified Cholesky factorization of a real symmetric matrix: real_modified_cholesky()

non-negative matrix factorization: real_nmf()

non-negative matrix factorization, reverse communication: real_nmf_rcomm()

real almost block-diagonal matrix

factorization: real_gen_blkdiag_lu()

real band symmetric positive definite matrix

factorization: real_symm_posdef_fac()

variable bandwidth, factorization: real_vband_posdef_fac()

real matrix

factorization: real_gen_rq()

real matrix

form orthogonal matrix: real_gen_rq_formq()

real sparse matrix

factorization: real_gen_sparse_lu()

factorization, known sparsity pattern: real_gen_sparse_lu_reuse()

real upper trapezoidal matrix

factorization: real_trapez_rq()

tridiagonal matrix

factorization: real_gen_tridiag_lu()

For full information please refer to the NAG Library document

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/f01/f01intro.html

Examples

naginterfaces.library.examples.matop.real_gen_matrix_fun_num_ex.main()[source]

Example for naginterfaces.library.matop.real_gen_matrix_fun_num().

Function of a real matrix.

>>> main()
naginterfaces.library.matop.real_gen_matrix_fun_num Python Example Results.
Function of a real matrix.
For A =
[[ 3.  0.  1.  2.]
 [-1.  1.  3.  1.]
 [ 0.  2.  2.  1.]
 [ 2.  1. -1.  1.]]
cos(2A) =
[[-0.17036898 -1.15965573 -0.18778866 -0.73074175]
 [-0.39503854 -0.44095146  0.76061992  0.06554174]
 [-0.0949989  -0.07174814  0.06191979 -0.43512038]
 [-0.10341444  0.64237026 -1.39636277  0.10421077]]
naginterfaces.library.examples.matop.real_gen_matrix_fun_usd_ex.main()[source]

Example for naginterfaces.library.matop.real_gen_matrix_fun_usd().

Function of a real matrix.

>>> main()
naginterfaces.library.matop.real_gen_matrix_fun_usd Python Example Results.
Function of a real matrix.
For A =
[[ 1.  0. -2.  1.]
 [-1.  2.  0.  1.]
 [ 2.  0.  1.  0.]
 [ 1.  0. -1.  2.]]
exp(2A) =
[[-12.18798617   0.          -3.47466326   8.3696757 ]
 [-13.72738367  54.59815003 -23.98010407  82.85926011]
 [ -9.79002487   0.         -25.4526743   26.52937627]
 [-18.15970057   0.         -34.89905197  49.24044206]]