Matrix Functions API

Matrix-variable functions f(A::AbstractMatrix)::AbstractMatrix

MatrixFuns.mat_funFunction
mat_fun(f, A; scale, sep, max_deg, color, ε, checknative)

Compute the matrix-variable function f(A). Return a matrix.

f a general scalar function, and called as f(x).

A an arbitrary square matrix.

scale the scaling of the Talyor series error, is used to control the spread of each splitting cluster. By default, scale = 1.

sep the initial separation distance, to split the eigenvalues of A into clusters that satisfy (i) min{|λ - μ|: λ ∈ clp, μ ∈ clq, p ≠ q} > sep. (ii) for clp with |clp| > 1, ∀ λ ∈ clp, ∃ μ ∈ clp and μ ≠ λ, s.t. |λ - μ| ≤ sep. Here cl_p is the cluster with index p. By default, sep = 0.1*scale.

max_deg the maximum Taylor series order for the diagonal blocks computation.

color(x::Number)::Integer an index mapping function. This is to ensure all eigenvalues within a cluster have the same color index. By default, the color function maps x to 1. For discontinuous functions, users can assign a distinct color to each continuous interval. E.g., for the sign function, users can customize the color mapping using color = x -> Int(real(sign(x)))

ε the target accuracy, set to machine accuracy by default.

checknative check f is a Julia native function.

source

Divided Differences of f(x::Real)::Number

MatrixFuns.div_diffFunction
div_diff(f, x::AbstractVector; kwargs...)
div_diff(f, x::Tuple; kwargs...)
div_diff(f, x...; kwargs...)

Return the divided difference f[x_0,x_1,...,x_n], assuming f is called as f(x). See mat_fun for a description of possible keyword arguments.

source

Fréchet derivatives of f(A::AbstractMatrix)::AbstractMatrix

MatrixFuns.mat_fun_frechetFunction
mat_fun_frechet(f, H::AbstractMatrix, h::Vector{AbstractMatrix}; kwargs...)
mat_fun_frechet(DD_F, Ψ::AbstractMatrix, h::Vector{AbstractMatrix})

Return the n-th order Fréchet derivative d^nf(H)h[1]…h[n], assuming f is called as f(x). See mat_fun for a description of possible keyword arguments.

source

Implementation details

MatrixFuns.get_splittingsFunction

Construct the splitting cluster assignments vector z (z_i is the index of the splitting cluster for the i-th data points (eigenvalues)).

source
MatrixFuns.split_by_sepFunction
split_by_sep(pts::AbstractVector{<:Real}, δ::Real)
split_by_sep(pts::AbstractVector{<:Complex}, δ::Real)

Split the data points (eigenvalues) by separation parameter δ.

source
MatrixFuns.get_swappingsFunction

Find the swap strategy that converts an integer sequence into a confluent sequence that the repeated indexes are next to each other. E.g., (1,4,2,1,2,3,3,2) -> (1,1,4,2,2,3,3,2) -> (2,2,2,1,1,4,3,3)

source
MatrixFuns.atomic_block_fun!Function
atomic_block_fun!(f, F, A; max_deg, tol_taylor, checknative)

Implement the atomic block computation f(A), and overwriting the values of F.

max_deg the maximum Taylor series order for the diagonal blocks computation.

tol_taylor the termination tolerance for evaluating the Taylor series of diagonal blocks.

checknative check f is a Julia native function.

source
MatrixFuns.taylor_coeffsFunction
taylor_coeffs(f, x0, ordr, ordl::Integer=0)

Compute Taylor coefficients of f at x0 for orders from ordl to ordr.

source
MatrixFuns.DD_tensorFunction

Generate the divided difference tensor (DD_F)_{i_0,...,i_n} = f[λ_{i_0},..., λ_{i_n}]. By the permutation symmetry of the divided difference, only need to calculate the irreducible vals.

source