8.0.3. Linear Algebra
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
This provides such things as linear system solving , matrix inverse , eigenvalues of symmetric matrices , and singular value decomposition for real and complex matrices.

8.0.3.0. (eigen-symm m)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
Compute eigenvalues of symmetric real matrix m . A vector of sorted eigenvalues is returned. The input matrix is destroyed. to call non-destructively , do (eigen-symm (idx-copy m)) .

8.0.3.1. (eigen-symmv m)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
Compute eigenvectors and eigenvalues of symmetric matrix m . The eigenvectors are written into m (each column is an eigenvector). The eigenvalues are returned in an idx1. Eigenvalues and eigenvectors are sorted in descending order.

8.0.3.2. (eigen-herm m)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
Compute eigenvalues of Hermitian complex matrix m (NxMx2 matrix). Vector of sorted eigenvalues is returned. Input matrix is destroyed. to call non-destructively , do (eigen-herm (idx-copy m)) .

8.0.3.3. (eigen-hermv m)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
Compute eigenvalues and eigenvectors of Hermitian complex matrix m . The vector of eigenvalues is returned. The input matrix is filled with eigenvectors on exit (each column is an eigenvector).

8.0.3.4. (svd A V S)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
[from the GSL manual]: This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T. On output the matrix A is replaced by U. The diagonal elements of the singular value matrix S are stored in the vector S. The singular values are non-negative and form a non-increasing sequence from S_1 to S_N. The matrix V contains the elements of V in untransposed form. To form the product U S V^T it is necessary to take the transpose of V. This routine uses the Golub-Reinsch SVD algorithm. Example:
  (setq a [[1 2][3 4][5 6]])
  (setq v (double-matrix 2 2))
  (setq s (double-matrix 2))
  (svd a v s)


8.0.3.5. (solve-hh a b)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
This function solves the system A x = b in-place using Householder transformations. On input b should contain the right-hand side , which is replaced by the solution on output. The matrix a is destroyed by the Householder transformations. Example:
(setq a [[1 2][3 4]])
= [[ 1.00  2.00 ]
   [ 3.00  4.00 ]]
? (setq b [4 4])
= [ 4.00  4.00 ]
? (lin-solve a b)
= 0
? b
= [-4.00  4.00 ]


8.0.3.6. (solve-lu a b)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
This function solves the system A*x=b using LU decomposition. the result is put in b on output. Matrix a is also destroyed in the process.

8.0.3.7. (solve-lu-complex a b)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
This function solves the complex system A*x=b using LU decomposition. the result is put in b on output. Matrix a is also destroyed in the process.

8.0.3.8. (solve-sv a b)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
[adapted from the GSL manual]: This function solves the linear system A*x=b using singular value decomposition. the result is put in b on output. Matrix a is also destroyed in the process. Only non-zero singular values are used in computing the solution. The parts of the solution corresponding to singular values of zero are ignored. In the over-determined case where A has more rows than columns the system is solved in the least squares sense , returning the solution x which minimizes the square norm of (A*x-b).

8.0.3.9. (inverse-lu a i)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
This function computes the inverse of a matrix a using LU decomposition , storing the result in the matrix i . The inverse is computed by solving the system A*x=b for each column of the identity matrix. It is preferable to avoid direct computation of the inverse whenever possible.

8.0.3.10. (determinant a)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
compute the determinant of a matrix a using LU decomposition. Matrix a is destroyed in the process.

8.0.3.11. (determinant-log a)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
compute the log of the absolute value of the determinant of real matrix a using LU decomposition. This function should be used when the regular determinant function would cause an overflow or underflow. Matrix a is destroyed in the process.

8.0.3.12. (determinant-sign a)
(packages/libnum/linalgebra.lsh)

Last Modified: 2002-12-20 02:32:43
compute the sign the determinant of real matrix a using LU decomposition. Matrix a is destroyed in the process.