Documentation ¶
Index ¶
- type CholeskyDecomposition
- type EigenvalueDecomposition
- func (e *EigenvalueDecomposition) Cdiv(xr, xi, yr, yi float64)
- func (e *EigenvalueDecomposition) GetD() *Matrix
- func (e *EigenvalueDecomposition) GetImagEigenvalues() []float64
- func (e *EigenvalueDecomposition) GetRealEigenvalues() []float64
- func (e *EigenvalueDecomposition) GetV() *Matrix
- func (e *EigenvalueDecomposition) Getd() []float64
- func (e *EigenvalueDecomposition) Hqr2()
- func (e *EigenvalueDecomposition) Orthes()
- func (e *EigenvalueDecomposition) Tql2()
- func (e *EigenvalueDecomposition) Tred2()
- type LUDecomposition
- func (lud *LUDecomposition) Det() float64
- func (lud *LUDecomposition) GetDoublePivot() []float64
- func (lud *LUDecomposition) GetL() *Matrix
- func (lud *LUDecomposition) GetPivot() []int
- func (lud *LUDecomposition) GetU() *Matrix
- func (lud *LUDecomposition) IsNonsingular() bool
- func (lud *LUDecomposition) Solve(b *Matrix) *Matrix
- type Matrix
- func (m *Matrix) ColumnsDimension() int
- func (m *Matrix) Eig() *EigenvalueDecomposition
- func (m *Matrix) GetMatrix(r []int, j0, j1 int) *Matrix
- func (m *Matrix) GetMatrix2(i0, i1 int, c []int) *Matrix
- func (m *Matrix) GetMatrix3(i0, i1, j0, j1 int) *Matrix
- func (mat *Matrix) Identity(m, n int) *Matrix
- func (m *Matrix) Inverse() *Matrix
- func (m *Matrix) Minus(b *Matrix) *Matrix
- func (m *Matrix) Plus(b *Matrix) *Matrix
- func (m *Matrix) PlusEqual(b *Matrix)
- func (m *Matrix) RowsDimension() int
- func (m *Matrix) SetMatrix(i0, i1, j0, j1 int, x *Matrix)
- func (m *Matrix) Solve(b *Matrix) *Matrix
- func (m *Matrix) Times(s float64) *Matrix
- func (m *Matrix) TimesMatrix(b *Matrix) *Matrix
- func (m *Matrix) Tostring() string
- func (m *Matrix) Transpose() *Matrix
- func (mat *Matrix) UnVectorize(width, height int) *Matrix
- func (mat *Matrix) Vectorize() *Matrix
- type QRDecomposition
- type SingularValueDecomposition
- func (s *SingularValueDecomposition) Cond() float64
- func (s *SingularValueDecomposition) GetS() *Matrix
- func (s *SingularValueDecomposition) GetSingularValues() []float64
- func (s *SingularValueDecomposition) GetU() *Matrix
- func (s *SingularValueDecomposition) GetV() *Matrix
- func (s *SingularValueDecomposition) Norm2() float64
- func (s *SingularValueDecomposition) Rank() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CholeskyDecomposition ¶
type CholeskyDecomposition struct { L [][]float64 // Array for internal storage of decomposition. N int // Row and column dimension (square matrix). Isspd bool // Symmetric and positive definite flag. }
- Cholesky Decomposition. <P> For a symmetric, positive definite matrix A, the Cholesky decomposition is an lower triangular matrix L so that A = L*L'. <P> If the matrix is not symmetric or positive definite, the constructor returns a partial decomposition and sets an internal flag that may be queried by the isSPD() method.
func NewCholeskyDecomposition ¶
func NewCholeskyDecomposition(matrix *Matrix) *CholeskyDecomposition
func (*CholeskyDecomposition) GetL ¶
func (c *CholeskyDecomposition) GetL() *Matrix
func (*CholeskyDecomposition) Solve ¶
func (c *CholeskyDecomposition) Solve(B *Matrix) *Matrix
* Solve A*X = B @param B A Matrix with as many rows as A and any number of columns. @return X so that L*L'*X = B @exception IllegalArgumentException Matrix row dimensions must agree. @exception RuntimeException Matrix is not symmetric positive definite.
type EigenvalueDecomposition ¶
type EigenvalueDecomposition struct { N int // Row and column dimension (square matrix). IsSymmetric bool // Symmetry flag. D []float64 // Arrays for internal storage of eigenvalues. E []float64 // Array for internal storage of eigenvectors. V [][]float64 // Array for internal storage of eigenvectors. H [][]float64 // Array for internal storage of nonsymmetric Hessenberg form. Ort []float64 // Working storage for nonsymmetric algorithm. }
func NewEigenvalueDecomposition ¶
func NewEigenvalueDecomposition(matrix *Matrix) *EigenvalueDecomposition
func (*EigenvalueDecomposition) Cdiv ¶
func (e *EigenvalueDecomposition) Cdiv(xr, xi, yr, yi float64)
func (*EigenvalueDecomposition) GetD ¶
func (e *EigenvalueDecomposition) GetD() *Matrix
func (*EigenvalueDecomposition) GetImagEigenvalues ¶
func (e *EigenvalueDecomposition) GetImagEigenvalues() []float64
func (*EigenvalueDecomposition) GetRealEigenvalues ¶
func (e *EigenvalueDecomposition) GetRealEigenvalues() []float64
func (*EigenvalueDecomposition) GetV ¶
func (e *EigenvalueDecomposition) GetV() *Matrix
func (*EigenvalueDecomposition) Getd ¶
func (e *EigenvalueDecomposition) Getd() []float64
func (*EigenvalueDecomposition) Hqr2 ¶
func (e *EigenvalueDecomposition) Hqr2()
func (*EigenvalueDecomposition) Orthes ¶
func (e *EigenvalueDecomposition) Orthes()
Nonsymmetric reduction to Hessenberg form.
func (*EigenvalueDecomposition) Tql2 ¶
func (e *EigenvalueDecomposition) Tql2()
func (*EigenvalueDecomposition) Tred2 ¶
func (e *EigenvalueDecomposition) Tred2()
This is derived from the Algol procedures tred2 by Bowdler, Martin, Reinsch, and Wilkinson, Handbook for Auto. Comp., Vol.ii-Linear Algebra, and the corresponding Fortran subroutine in EISPACK.
type LUDecomposition ¶
type LUDecomposition struct { LU [][]float64 // Array for internal storage of decomposition. N int /** Row and column dimensions, and pivot sign. column dimension. l row dimension. pivot sign. */ M int Pivsign int Piv []int //Internal storage of pivot vector. }
func NewLUDecomposition ¶
func NewLUDecomposition(a *Matrix) *LUDecomposition
func (*LUDecomposition) Det ¶
func (lud *LUDecomposition) Det() float64
* Determinant @return det(A)
func (*LUDecomposition) GetDoublePivot ¶
func (lud *LUDecomposition) GetDoublePivot() []float64
* Return pivot permutation vector as a one-dimensional double array @return (double) piv
func (*LUDecomposition) GetL ¶
func (lud *LUDecomposition) GetL() *Matrix
* Return lower triangular factor @return L
func (*LUDecomposition) GetPivot ¶
func (lud *LUDecomposition) GetPivot() []int
func (*LUDecomposition) GetU ¶
func (lud *LUDecomposition) GetU() *Matrix
* Return upper triangular factor @return U
func (*LUDecomposition) IsNonsingular ¶
func (lud *LUDecomposition) IsNonsingular() bool
func (*LUDecomposition) Solve ¶
func (lud *LUDecomposition) Solve(b *Matrix) *Matrix
type Matrix ¶
*
Jama = Java Matrix class.
<P>
The Java Matrix Class provides the fundamental operations of numerical linear algebra. Various constructors create Matrices from two dimensional arrays of double precision floating point numbers. Various "gets" and "sets" provide access to submatrices and matrix elements. Several methods implement basic matrix arithmetic, including matrix addition and multiplication, matrix norms, and element-by-element array operations. Methods for reading and printing matrices are also included. All the operations in this version of the Matrix Class involve real matrices. Complex matrices may be handled in a future version.
<P>
Five fundamental matrix decompositions, which consist of pairs or triples of matrices, permutation vectors, and the like, produce results in five decomposition classes. These decompositions are accessed by the Matrix class to compute solutions of simultaneous linear equations, determinants, inverses and other matrix functions. The five decompositions are:
<P><UL>
<LI>Cholesky Decomposition of symmetric, positive definite matrices. <LI>LU Decomposition of rectangular matrices. <LI>QR Decomposition of rectangular matrices. <LI>Singular Value Decomposition of rectangular matrices. <LI>Eigenvalue Decomposition of both symmetric and nonsymmetric square matrices.
</UL> <DL> <DT><B>Example of use:</B></DT> <P> <DD>Solve a linear system A x = b and compute the residual norm, ||b - A x||. <P><PRE>
double[][] vals = {{1.,2.,3},{4.,5.,6.},{7.,8.,10.}}; Matrix A = new Matrix(vals); Matrix b = Matrix.random(3,1); Matrix x = A.solve(b); Matrix r = A.times(x).minus(b); double rnorm = r.normInf();
</PRE></DD> </DL>
@author The MathWorks, Inc. and the National Institute of Standards and Technology. @version 5 August 1998
func NewMatrixFilled ¶
func NewMatrixWithArrays ¶
func (*Matrix) ColumnsDimension ¶
func (*Matrix) Eig ¶
func (m *Matrix) Eig() *EigenvalueDecomposition
func (*Matrix) GetMatrix3 ¶
func (*Matrix) RowsDimension ¶
func (*Matrix) TimesMatrix ¶
func (*Matrix) UnVectorize ¶
type QRDecomposition ¶
type QRDecomposition struct { QR [][]float64 // Array for internal storage of decomposition. M int //column dimension. N int //row dimension. Rdiag []float64 //Array for internal storage of diagonal of R. }
func NewQRDecomposition ¶
func NewQRDecomposition(a *Matrix) *QRDecomposition
func (*QRDecomposition) IsFullRank ¶
func (q *QRDecomposition) IsFullRank() bool
func (*QRDecomposition) Solve ¶
func (q *QRDecomposition) Solve(b *Matrix) *Matrix
type SingularValueDecomposition ¶
type SingularValueDecomposition struct { /** Arrays for internal storage of U and V. @serial internal storage of U. @serial internal storage of V. */ U [][]float64 V [][]float64 /** Array for internal storage of singular values. @serial internal storage of singular values. */ S []float64 /** Row and column dimensions. @serial row dimension. @serial column dimension. */ M int N int }
func NewSingularValueDecomposition ¶
func NewSingularValueDecomposition(matrix *Matrix) *SingularValueDecomposition
func (*SingularValueDecomposition) Cond ¶
func (s *SingularValueDecomposition) Cond() float64
* Two norm condition number @return max(S)/min(S)
func (*SingularValueDecomposition) GetS ¶
func (s *SingularValueDecomposition) GetS() *Matrix
* Return the diagonal matrix of singular values @return S
func (*SingularValueDecomposition) GetSingularValues ¶
func (s *SingularValueDecomposition) GetSingularValues() []float64
func (*SingularValueDecomposition) GetU ¶
func (s *SingularValueDecomposition) GetU() *Matrix
* Return the left singular vectors @return U
func (*SingularValueDecomposition) GetV ¶
func (s *SingularValueDecomposition) GetV() *Matrix
* Return the right singular vectors @return V
func (*SingularValueDecomposition) Norm2 ¶
func (s *SingularValueDecomposition) Norm2() float64
* Two norm @return max(S)
func (*SingularValueDecomposition) Rank ¶
func (s *SingularValueDecomposition) Rank() int
* Effective numerical matrix rank @return Number of nonnegligible singular values.