lapack-0.5: Numerical Linear Algebra using LAPACK
Safe Haskell None Haskell98

Numeric.LAPACK.Matrix.Function

Synopsis

# Documentation

class Property property => SqRt property Source #

Minimal complete definition

sqrt

#### Instances

Instances details
 Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodssqrt :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack Symmetric lower upper sh a -> Quadratic pack Symmetric lower upper sh a Source # Source # For Full matrices: Explicit solution for matrices up to size 2. Solution via sqrtDenmanBeavers for larger sizes. Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodssqrt :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack Arbitrary lower upper sh a -> Quadratic pack Arbitrary lower upper sh a Source # Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodssqrt :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack Unit lower upper sh a -> Quadratic pack Unit lower upper sh a Source # (neg ~ False, C zero, C pos) => SqRt (Hermitian neg zero pos) Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodssqrt :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack (Hermitian neg zero pos) lower upper sh a -> Quadratic pack (Hermitian neg zero pos) lower upper sh a Source #

sqrt :: (SqRt property, Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack property lower upper sh a -> Quadratic pack property lower upper sh a Source #

sqrtSchur :: (C sh, Real a) => Square sh a -> Square sh a Source #

Square root solver that works on the Schur decomposition.

Schur decomposition enables computing the square root of (some) singular matrices like ((1,0),(0,0)). However, the Schur decomposition might emit small negative values on the diagonal, where exact computation would yield zeros. This would let the square root solver fail. And there are singular matrices that have no square root, at all, e.g. ((0,1),(0,0)).

The solver is restricted to a real triangular Schur matrix. The check for non-real eigenvalues may exclude matrices that actually have a real-valued square root. E.g. sqrt ((0,-2),(2,0)) = ((1,-1),(1,-1))

In the future we might fix this by solving 2x2 blocks at the diagonal using sqrt2.

sqrtDenmanBeavers :: (Homogeneous prop, Additive prop) => (Packing pack, PowerStrip lower, PowerStrip upper) => (C sh, Floating a, RealOf a ~ ar, Real ar) => Quadratic pack prop lower upper sh a -> Quadratic pack prop lower upper sh a Source #

Iterative square root solver, similar to Newton iteration.

Eigenvalues must all be positive, otherwise, the iteration might loop forever, or if an eigenvalue is zero, the computation of matrix inverse will fail.

class Property property => Exp property Source #

Minimal complete definition

exp

#### Instances

Instances details
 Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodsexp :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Floating a) => Quadratic pack Symmetric lower upper sh a -> Quadratic pack Symmetric lower upper sh a Source # Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodsexp :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Floating a) => Quadratic pack Arbitrary lower upper sh a -> Quadratic pack Arbitrary lower upper sh a Source # (neg ~ True, zero ~ True, pos ~ True) => Exp (Hermitian neg zero pos) Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodsexp :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Floating a) => Quadratic pack (Hermitian neg zero pos) lower upper sh a -> Quadratic pack (Hermitian neg zero pos) lower upper sh a Source #

exp :: (Exp property, Packing pack, PowerStrip lower, PowerStrip upper, C sh, Floating a) => Quadratic pack property lower upper sh a -> Quadratic pack property lower upper sh a Source #

expRealHermitian :: (Packing pack, C sh, Real a) => HermitianP pack sh a -> HermitianPosSemidefP pack sh a Source #

Mathematically the name expRealSymmetric would be more common, but we support definiteness tags only for the Hermitian type. Formally the result is always positive definite, but negative eigenvalues easily yield numerically singular matrices as result.

class Property property => Log property Source #

Minimal complete definition

log

#### Instances

Instances details
 Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodslog :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack Symmetric lower upper sh a -> Quadratic pack Symmetric lower upper sh a Source # Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodslog :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack Arbitrary lower upper sh a -> Quadratic pack Arbitrary lower upper sh a Source # (neg ~ True, zero ~ True, pos ~ True) => Log (Hermitian neg zero pos) Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function Methodslog :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack (Hermitian neg zero pos) lower upper sh a -> Quadratic pack (Hermitian neg zero pos) lower upper sh a Source #

log :: (Log property, Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => Quadratic pack property lower upper sh a -> Quadratic pack property lower upper sh a Source #

logUnipotentUpper :: (Packing pack, C sh, Floating a) => UnitUpperP pack sh a -> UpperP pack sh a Source #

class Property property => LiftReal property Source #

Minimal complete definition

liftReal

#### Instances

Instances details
 Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function MethodsliftReal :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => (a -> a) -> Quadratic pack Symmetric lower upper sh a -> Quadratic pack Symmetric lower upper sh a Source # Source # Generic algorithm that applies a scalar function to the elements of the diagonal factor of a full, triangular or diagonal matrix with distinct eigenvalues. It is not checked whether the matrix has distinct eigenvalues. Instance detailsDefined in Numeric.LAPACK.Matrix.Function MethodsliftReal :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => (a -> a) -> Quadratic pack Arbitrary lower upper sh a -> Quadratic pack Arbitrary lower upper sh a Source # (neg ~ True, zero ~ True, pos ~ True) => LiftReal (Hermitian neg zero pos) Source # Instance detailsDefined in Numeric.LAPACK.Matrix.Function MethodsliftReal :: (Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => (a -> a) -> Quadratic pack (Hermitian neg zero pos) lower upper sh a -> Quadratic pack (Hermitian neg zero pos) lower upper sh a Source #

liftReal :: (LiftReal property, Packing pack, PowerStrip lower, PowerStrip upper, C sh, Real a) => (a -> a) -> Quadratic pack property lower upper sh a -> Quadratic pack property lower upper sh a Source #

Lift any function with a Taylor expansion to a diagonalizable matrix.