# Module Dls.ArrayDenseMatrix

module ArrayDenseMatrix: sig .. end
General purpose dense matrix operations on arrays.
See sundials: The DENSE Module

type t = Sundials.RealArray2.t
A dense matrix accessible directly through a Bigarray.
See sundials: Small dense matrices
See sundials: newDenseMat

#### Basic access

val make : int -> int -> float -> t
make m n x returns an m by n dense matrix with elements set to x.
See sundials: newDenseMat
val create : int -> int -> t
create m n returns an uninitialized m by n dense matrix.
See sundials: newDenseMat
val get : t -> int -> int -> float
get a i j returns the value at row i and column j of a.
val set : t -> int -> int -> float -> unit
set a i j v sets the value at row i and column j of a to v.
val update : t -> int -> int -> (float -> float) -> unit
update a i j f sets the value at row i and column j of a to f v.
val set_to_zero : t -> unit
Fills the matrix with zeros.
See sundials: setToZero

#### Calculations

val add_identity : t -> unit
Increments a square matrix by the identity matrix.
val matvec : t ->       x:Sundials.RealArray.t -> y:Sundials.RealArray.t -> unit
Compute the matrix-vector product $y = Ax$.
Since 2.6.0
See sundials: denseMatvec
val blit : t -> t -> unit
blit src dst copies the contents of src into dst. Both must have the same size.
See sundials: denseCopy
val scale : float -> t -> unit
Multiplies each element by a constant.
See sundials: denseScale
val getrf : t -> Sundials.LintArray.t -> unit
getrf a p performs the LU factorization of the square matrix a with partial pivoting according to p. The values in a are overwritten with those of the calculated L and U matrices. The diagonal belongs to U. The diagonal of L is all 1s. Multiplying L by U gives a permutation of a, according to the values of p: p.{k} = j means that rows k and j were swapped (in order, where p.{0} swaps against the original matrix a).
Raises ZeroDiagonalElement Zero found in matrix diagonal
See sundials: denseGETRF
val getrs : t ->       Sundials.LintArray.t -> Sundials.RealArray.t -> unit
getrs a p b finds the solution of ax = b using an LU factorization found by Dls.ArrayDenseMatrix.getrf. Both p and b must have the same number of rows as a.
See sundials: denseGETRS
val getrs' : t ->       Sundials.LintArray.t -> Sundials.RealArray.t -> int -> unit
Like Dls.ArrayDenseMatrix.getrs but stores b starting at a given offset.
val potrf : t -> unit
Performs Cholesky factorization of a real symmetric positive matrix.
See sundials: densePOTRF
val potrs : t -> Sundials.RealArray.t -> unit
potrs a b finds the solution of ax = b using the Cholesky factorization found by Dls.ArrayDenseMatrix.potrf. a must be an n by n matrix and b must be of length n.
See sundials: densePOTRS
val geqrf : t ->       Sundials.RealArray.t -> Sundials.RealArray.t -> unit
geqrf a beta work performs the QR factorization of a. a must be an m by n matrix, where m >= n. The beta vector must have length n. The work vector must have length m.
See sundials: denseGEQRF
val ormqr : a:t ->       beta:Sundials.RealArray.t ->       v:Sundials.RealArray.t ->       w:Sundials.RealArray.t -> work:Sundials.RealArray.t -> unit
ormqr q beta v w work computes the product w = qv . Q is an m by n matrix calculated using Dls.ArrayDenseMatrix.geqrf with m >= n, beta has length n, v has length n, w has length m, and work has length m.
See sundials: denseORMQR
beta : vector passed to Dls.ArrayDenseMatrix.geqrf
v : vector multiplier
w : result vector
work : temporary vector used in the calculation