The kmatrix library (libkmatrix.a) contains matrix operators that are based on the LAPACK library. Function operations include extracting rows, columns, and diagonals, computing eigenvectors and eigenvalues, computing the inverse matrix, computing the least-squares solution to a set of linear equations, LU decomposition, computing the matrix product, and singular value decomposition. All kmatrix functions are written to operate on width-height planes of the polymorphic data model. If the depth, time, or elements dimensions of data object are greater than one, the operation is repeated for each width-height plane. These functions operate only on the value segment, and do not check for any other data segments. The kmatrix operators are implemented using the polymorphic data services, which is a part of the Khoros 2.0 kappserv library.
LAPACK Libraries & Fortran Dependency The kmatrix library depends on the LAPACK libraries lzlapack, ldlapack, and lblas, which are included in the Matrix toolbox.
This section is incomplete and will be completed as we learn more about Fortran dependency and portability issues.
Side Effects The function calls in kmatrix should have no side effects on the source objects passed into them, and should only affect those segments and attributes of the destination object that the operation needs to modify. For example, if a destination object is passed in that already has value, mask, and geometry data, and a multiplication operation is performed on the source value data, the destination mask and geometry data will not be modified, and will remain intact.
Each function call frees all memory that has been allocated within the call, and closes all temporary objects that were opened within the call. The function call will not free memory or close objects that were passed into it.
DISCLAIMER \(em WARNING The kmatrix library is in its first prototype stage, therefore, the behavior and API of these functions may change in the future.
ALL programs that utilize these function calls MUST include the statement:
#include <matrix.h>
$MATRIX/objects/library/kmatrix/src
$MATRIX/include/kmatrix/kmatrix.h
#include <matrix.h>