package slap

  1. Overview
  2. Docs

A linear algebra library with type-based static size checking for matrix operations. SLAP (Sized Linear Algebra Package) helps debug of your programs by detecting dimensional inconsistency, e.g., addition of two- and three- dimensional vectors, at compile time (instead of runtime) and at higher level (i.e., at a caller site rather than somewhere deep inside of a call stack). This library is a wrapper of LACAML, a binding of widely-used linear algebra libraries BLAS (Basic Linear Algebra Subprograms) and LAPACK (Linear Algebra PACKage) in FORTRAN. Many functions are compatible with the interface of LACAML. You can make use of SLAP by referring Slap.Common and the module corresponding to the precision and the number type you need:

open Slap.Common
open Slap.S  (* 32-bit real BLAS and LAPACK functions *)
open Slap.D  (* 64-bit real BLAS and LAPACK functions *)
open Slap.C  (* 32-bit complex BLAS and LAPACK functions *)
open Slap.Z  (* 64-bit complex BLAS and LAPACK functions *)

To use this library, the following documentation may be useful to you:

The man pages are also available on your machine if you installed manpages.tgz or the corresponding package provided by your distribution.

Miscellaneous definitions.

include module type of struct include Slap_misc end
type cnt = Slap_misc.cnt

The flag for contiguous vectors and matrices.

type dsc = Slap_misc.dsc

The flag for discrete vectors and matrices.

val identity : 'a -> 'a

The identity function.

val failwithf : ('a, unit, string, unit -> 'b) format4 -> 'a

failwith + printf-style format

val invalid_argf : ('a, unit, string, unit -> 'b) format4 -> 'a

invalid_arg + printf-style format

exception Internal_error of string * int

Internal_error (location, code) is thrown when a BLAS or LAPACK function returns unexpected error. location is the function name (containing its module name) and code is an error code returned by the function.

module Size = Slap_size

Sizes (the dimensions of vectors and matrices).

module Vec = Slap_vec

Sized vectors.

module Mat = Slap_mat

Sized matrices.

module Io = Slap_io

Pretty printers.

module Version = Slap_version

The version number of SLAP.

Precision dependent modules

module Common = Slap_common

Types, flags and functions commonly used in precision dependent modules.

module D = Slap_D

64-bit real BLAS and LAPACK functions.

module S = Slap_S

32-bit real BLAS and LAPACK functions.

module Z = Slap_Z

64-bit complex BLAS and LAPACK functions.

module C = Slap_C

32-bit complex BLAS and LAPACK functions.

OCaml

Innovation. Community. Security.