Next: , Previous: Package FL.MULTIPROCESSING, Up: Reference manual


6.10 Package FL.MATLISP

This package provides a Common Lisp version of full matrices with elements being numbers of a given type. Those classes are automatically generated when needed. It provides also part of the BLAS and LAPACK operations for those matrices. The corresponding methods are automatically compiled for the given matrix classes. The interface is very similar to the library Matlisp (Matlisp), which provides a CLOS interface to the Fortran BLAS and LAPACK routines.

— Variable: *PRINT-MATRIX*

Maximum number of columns and/or rows to print. NIL: no elements, T: all elements.

— Variable: *PRINT-TENSOR*

Maximum number of columns and/or rows to print. Set this to NIL to print no cells (same as *PRINT-ARRAY* set to NIL). Set this to T to print all cells of the tensor.

— Class: <MATRIX>

General matrix class.

Superclasses: <VECTOR>

— Class: <SUBMATRIX>

Describes an ordered submatrix of a matrix. Only a restricted set of operations is allowed for these matrices and element access is slow. They are indexed with ordinary integers.

Superclasses: <MATRIX>

Direct slots:

— Class: <VECTOR>

General vector class.

— Function: AREA-OF-SPAN MAT

Computes the volume spanned by the columns of mat.

— Function: AXPY ALPHA X Y

Returns alpha X + Y. Uses AXPY! and COPY.

— Function: AXPY! ALPHA X Y

Y <- alpha*X + Y

— Function: CCS-MATRIX TYPE

Construct a CCS matrix with entries of type.

— Class: CCS-MATRIX

A CCS (compressed column storage) matrix. This is an abstract class which is made concrete by mixing it with a store-vector.

Superclasses: <MATRIX>

Direct slots:

— Class: CCS-PATTERN

A CCS (compressed column storage) pattern. Note: if you use integer vectors for column-starts and row-indices they do not have to be copied for a call to the alien sparse solvers.

Direct slots:

— Function: COPY POLY

Returns a deep copy of X.

— Function: COPY! X Y

Y <- X

— Function: DET MAT

Returns the determinant of the square matrix mat.

— Function: DET-FROM-LR LR PIVOT

This routine computes the determinant using a given LR decomposition.

— Function: DOT X Y

Returns the dot product of X and Y.

— Function: DOT-ABS X Y

Returns the dot product between |X| and |Y|.

— Macro: DOTENSOR (ARGS TENSOR &KEY DEPTH) &BODY BODY

Usage: (dotensor (entry tensor :depth 1) ...) (dotensor ((index1 ... . entry) tensor :depth 1) ...) (dotensor ((index1 ...) tensor :depth 1) ...)

— Function: DOUBLE-VEC &REST COMPS

Returns a double-vec with the entries in comps.

— Type: DOUBLE-VEC

Uniform double-float vector.

— Macro: DOVEC (LOOP-VARS VEC) &BODY BODY

Loops on indices and entries of a vector. Examples:

            (dovec ((key) vec) ...)
            (dovec (entry vec) ...)
            (dovec ((key entry) vec) ...)
     

— Function: ELEMENT-TYPE VECTOR

Type of the elements of the vector/matrix.

— Function: EXTEND-MATLISP-FUNCTION FUNC

If MATLISP is available, and the argument func is a generic function in this package, this function is extended to be applicable to matrices in FL.MATLISP. This is done by defining a method for no-applicable-method which converts the arguments, calls func and reconverts the returned values. If MATLISP is not available, NIL is returned.

— Function: FILL! X S

Fills X with element s.

— Function: FILL-RANDOM! X S

Fills X with random values (obtained by (random s)).

— Function: FOR-EACH-COL-KEY FN SMAT

Loop through column keys.

— Function: FOR-EACH-ENTRY FN SMAT

Calls func on all entries of vec.

— Function: FOR-EACH-ENTRY-IN-COL FN SMAT KEY

Loop through entries in column col.

— Function: FOR-EACH-ENTRY-IN-ROW FN SMAT KEY

Loop through col-keys in row.

— Function: FOR-EACH-KEY FN SMAT

Calls func on all indices/keys of vec.

— Function: FOR-EACH-KEY-AND-ENTRY FN SMAT

Calls func on all keys and associated entries of vec.

— Function: FOR-EACH-KEY-AND-ENTRY-IN-COL FN SMAT KEY

Loop through row-keys and entries in col.

— Function: FOR-EACH-KEY-AND-ENTRY-IN-ROW FN SMAT KEY

Loop through col-keys and entries in row.

— Function: FOR-EACH-KEY-IN-COL FN SMAT KEY

Loop through row-keys in column col.

— Function: FOR-EACH-KEY-IN-ROW FN SMAT KEY

Loop through col-keys in row.

— Function: FOR-EACH-ROW-KEY FN SMAT

Loop through row keys.

— Function: FULL-CCS-PATTERN NROWS NCOLS

Returns trivial rectangular ccs-patterns.

— Function: FULL-TENSOR TYPE

Construct a full tensor with entries of type.

— Class: FULL-TENSOR

Mixin for full tensors.

Direct slots:

— Function: GEMM ALPHA X Y BETA Z &OPTIONAL (JOB NN)

Rewriting of GEMM in terms of GEMM!.

— Function: GEMM! ALPHA X Y BETA Z &OPTIONAL (JOB NN)

Dispatches on the optional job argument (member :nn :tn :nt :tt) and calls the corresponding generic function, e.g. GEMM-NN!.

— Function: GEMM-NN! ALPHA X Y BETA Z

General matrix-matrix multiplication: Z <- alpha * X * Y + beta * Z

— Function: GEMM-NT! ALPHA X Y BETA Z

General matrix-matrix multiplication: Z <- alpha * X * Y' + beta * Z

— Function: GEMM-TN! ALPHA A Y BETA X

General matrix-matrix multiplication: Z <- alpha * X' * Y + beta * Z

— Function: GEMM-TT! ALPHA A Y BETA X

General matrix-matrix multiplication: Z <- alpha * X' * Y' + beta * Z

— Function: GESV X B

Rewriting for GESV in terms of GESV!.

— Function: GETRF X &OPTIONAL IPIV

Rewriting for GETRF in terms of GETRF!.

— Function: GETRF! MAT &OPTIONAL IPIV

Computes the PLU decomposition of X (overwriting X). Returns X and as a second value the permuations vector.

— Function: GETRS LU B &OPTIONAL IPIV

Rewriting for GETRS in terms of GETRS!.

— Function: GETRS! LR B &OPTIONAL IPIV

Solves the given PLU decomposition for the rhs b while overwriting b.

— Function: INT-VEC &REST COMPS

Returns a int-vec with the entries in comps.

— Type: INT-VEC

Uniform int vector.

— Function: JOIN X Y &OPTIONAL (ORIENTATION HORIZONTAL)

Joins X and Y horizontally or vertically depending on the value of orientation.

— Function: L2-NORM X

Returns the 2-norm of x.

— Function: LAPLACE-FULL-MATRIX N

Generates the matrix for a 1-dimensional Laplace problem discretized with the 3-point stencil on a structured mesh.

— Function: LINF-NORM X

Returns the maximum norm of x.

— Function: LP-NORM X P

Returns the p-norm of x.

— Function: M*-PRODUCT-INSTANCE A Y

Returns a zero matrix for storing the product of X and Y.

— Function: M*-TN X Y

By default M*-TN is rewritten in terms of GEMM-TN!.

— Function: M+ X Y

Returns X + Y.

— Function: M+! X Y

Y <- X + Y

— Function: M- X Y

Returns X-Y. Uses AXPY.

— Function: M-! X Y

Y - X -> Y. Uses AXPY!.

— Macro: M-INCF RESULT INCREMENT

Adds increment to result which should be a symbol. If its value is nil then result is set to increment.

— Function: M.* X Y

Returns X .* Y. Uses M.*! and COPY.

— Function: M/ X

Returns the inverse of X.

— Function: MAKE-DOUBLE-VEC DIM &OPTIONAL (INIT 0.0)

Returns a double-vec of length dim and initial value init.

— Function: MAKE-REAL-MATRIX &REST ARGS

Generates a real matrix as specified by its arguments. If two arguments are provided, they should be numbers which are interpreted as rows and columns. If only one argument is provided, it should be either a number meaning the rows and columns of a square matrix or a nested list or vector structure defining the contents matrix.

— Function: MAKE-REAL-TENSOR DIMENSIONS

Generates an instance of a tensor with DOUBLE-FLOAT entries and the given dimensions.

— Function: MAKE-REAL-VECTOR DIM &OPTIONAL (VALUE 0.0)

Generates a real matrix of dimension dim x 1.

— Function: MATRIX-SLICE MAT &KEY (FROM-ROW 0) (FROM-COL 0) (NROWS (- (NROWS MAT) FROM-ROW)) (NCOLS (- (NCOLS MAT) FROM-COL))

Extract a submatrix of size nrows times ncols out of x starting from position from-row/from-col.

— Function: MATRIX-TRANSPOSE-INSTANCE SMAT

Returns a zero matrix for storing the transpose of X.

— Function: MEQUALP X Y

Returns T if X and Y have equal entries, otherwise NIL.

— Function: MEXTRACT X Y ROW-OFF COL-OFF

Extract matrix Y out of matrix X from the position given by ROW-OFFSET and COL-OFFSET.

— Function: MINJECT X Y ROW-OFF COL-OFF

Inject matrix X in matrix Y at the position given by ROW-OFFSET and COL-OFFSET.

— Function: MREF SMAT ROW-KEY COL-KEY

Returns the matrix element A[i,j].

— Function: MULTIPLICITY <ANSATZ-SPACE>

We allow multiple vectors, for solving linear problems in parallel.

— Function: MZEROP SMAT &OPTIONAL (THRESHOLD 0.0)

Returns T if each entry of x is smaller or equal than threshold.

— Function: NCOLS MAT

Number of matrix rows.

— Function: NORM X &OPTIONAL (P 2)

Returns the p-norm of x.

— Function: NORMALIZE X &OPTIONAL (P 2)

Scales x to have p-norm equal to 1.

— Function: NORMALIZE! X &OPTIONAL (P 2)

Scales x destructively to have p-norm equal to 1.

— Function: NROWS MAT

Number of matrix rows.

— Function: SCAL ALPHA X

Returns alpha * X. Uses SCAL! and COPY.

— Function: SCAL! ALPHA X

X <- alpha X

— Function: SCALAR-TYPE VECTOR

Type of the scalars for the vector class.

— Function: STANDARD-MATRIX TYPE

Defines the programmatic class standard-matrix for element type type as extensions of the programmatic class store-vector.

— Class: STANDARD-MATRIX

Mixin for dense matrices.

Superclasses: <MATRIX>

Direct slots:

— Class: STORE-VECTOR

This mixin yields vector behaviour for a class containing a store. The store is a unifom array with elements of a certain type which can be determined by the funtion element-type. It often is but does not have to be equal to the type of scalars for this vector which can be obtained by calling the function scalar-type.

Superclasses: <VECTOR>

Direct slots:

— Function: TOTAL-ENTRIES MAT

Total number of entries for block vectors.

— Function: TRANSPOSE X

Rewriting for TRANSPOSE.

— Function: TRANSPOSE! X Y

Sets Y to the transpose of X.

— Function: UINT-VEC &REST COMPS

Returns a uint-vec with the entries in comps.

— Type: UINT-VEC

Uniform uint vector.

— Function: UNIT-VECTOR DIM I

Returns a freshly created copy of the i-th carthesian unit vector in dimension dim.

— Function: VECTOR-SLICE VEC OFFSET SIZE

Extract a subvector of size size out of x starting from position offset.

— Function: VLENGTH MAT

Length of vector.

— Function: VREF SVEC KEY

Reader for x_i.

— Function: X<-0 X

X <- 0 X. Uses SCAL!.