Link Search Menu Expand Document

MatrixTypes overview

Various Matrix sub-types that are guarded by various constructors and branded-newtypes. Allows for convenient inverses if the inverse need be applied to the diagonal of a particular matrix, such as with the Pearson Correlation Matrix for multivariate samples.

Added in v1.0.0


Table of contents


Constructors

extractDiagonal

Signature

export declare const extractDiagonal: <A>(zero: A) => <M>(m: M.Mat<M, M, A>) => DiagonalMatrix<M, A>

Added in v1.0.0

fromMatrix

Signature

export declare const fromMatrix: <A>(
  R: Rng.Ring<A>
) => <M>(m: M.Mat<M, M, A>) => [LowerTriangularMatrix<M, A>, UpperTriangularMatrix<M, A>]

Added in v1.0.0

toMatrix

Signature

export declare const toMatrix: <M, A>([l, u]: [LowerTriangularMatrix<M, A>, UpperTriangularMatrix<M, A>]) => M.Mat<
  M,
  M,
  A
>

Added in v1.0.0

Isomorphisms

getTransposeIso

Signature

export declare const getTransposeIso: <M extends number, A>() => Iso.Iso<
  LowerTriangularMatrix<M, A>,
  UpperTriangularMatrix<M, A>
>

Added in v1.0.0

Matrix Operations

backSub

See: Fundamentals of Matrix Computation, David S. Watkins, page 30. Returns O.none if matrix is singular

Signature

export declare const backSub: <M extends number>(
  U: UpperTriangularMatrix<M, number>,
  y: V.Vec<M, number>
) => O.Option<V.Vec<M, number>>

Added in v1.1.0

diagonalFoldMap

Signature

export declare const diagonalFoldMap: <A>(Mn: Mon.Monoid<A>) => <M>(as: DiagonalMatrix<M, A>) => A

Added in v1.0.4

diagonalInverse

Signature

export declare const diagonalInverse: <A>(F: Fld.Field<A>) => <M>(m: DiagonalMatrix<M, A>) => DiagonalMatrix<M, A>

Added in v1.0.0

diagonalMap

Signature

export declare const diagonalMap: <A>(f: (a: A) => A) => <M>(m: DiagonalMatrix<M, A>) => DiagonalMatrix<M, A>

Added in v1.0.0

forwardSub

See: Fundamentals of Matrix Computation, David S. Watkins, page 26. Returns O.none if matrix is singular

Signature

export declare const forwardSub: <M>(
  L: LowerTriangularMatrix<M, number>,
  b: V.Vec<M, number>
) => O.Option<V.Vec<M, number>>

Added in v1.1.0

orthogonalInverse

Signature

export declare const orthogonalInverse: <M extends number, A>(m: OrthogonalMatrix<M, A>) => OrthogonalMatrix<M, A>

Added in v1.1.0

Model

DiagonalMatrix (interface)

Diagonal Matricies

Signature

export interface DiagonalMatrix<M, A> extends M.Mat<M, M, A> {
  _URI: DiagonalSymbol
}

Added in v1.0.0

LowerTriangularMatrix (interface)

Lower Triangular Matricies

Signature

export interface LowerTriangularMatrix<M, A> extends M.Mat<M, M, A> {
  _URI: LowerTriangularSymbol
}

Added in v1.0.0

OrthogonalMatrix (interface)

Orthogonal Matricies

Signature

export interface OrthogonalMatrix<M, A> extends M.Mat<M, M, A> {
  _URI: OrthogonalSymbol
}

Added in v1.1.0

UpperTriangularMatrix (interface)

Upper Triangular Matricies

Signature

export interface UpperTriangularMatrix<M, A> extends M.Mat<M, M, A> {
  _URI: UpperTriangularSymbol
}

Added in v1.0.0