smile.math.matrix

## Class FloatSymmMatrix

• All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

```public class FloatSymmMatrix
extends SMatrix```
They symmetric matrix in packed storage.
Serialized Form
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
`static class ` `FloatSymmMatrix.BunchKaufman`
The LU decomposition.
`static class ` `FloatSymmMatrix.Cholesky`
The Cholesky decomposition of a symmetric, positive-definite matrix.
• ### Constructor Summary

Constructors
Constructor and Description
```FloatSymmMatrix(UPLO uplo, float[][] AP)```
Constructor.
```FloatSymmMatrix(UPLO uplo, int n)```
Constructor.
• ### Method Summary

All Methods
Modifier and Type Method and Description
`FloatSymmMatrix.BunchKaufman` `bk()`
Bunch-Kaufman decomposition.
`FloatSymmMatrix.Cholesky` `cholesky()`
Cholesky decomposition for symmetric and positive definite matrix.
`FloatSymmMatrix` `clone()`
`boolean` ```equals(FloatSymmMatrix o, float eps)```
Returns if two matrices equals given an error margin.
`boolean` `equals(java.lang.Object o)`
`float` ```get(int i, int j)```
Returns A[i, j].
`Layout` `layout()`
Returns the matrix layout.
`void` ```mv(float[] work, int inputOffset, int outputOffset)```
Matrix-vector multiplication A * x.
`void` ```mv(Transpose trans, float alpha, float[] x, float beta, float[] y)```
Matrix-vector multiplication.
`int` `ncols()`
Returns the number of columns.
`int` `nrows()`
Returns the number of rows.
`FloatSymmMatrix` ```set(int i, int j, float x)```
Sets A[i,j] = x.
`long` `size()`
Returns the number of stored matrix elements.
`void` ```tv(float[] work, int inputOffset, int outputOffset)```
Matrix-vector multiplication A' * x.
`UPLO` `uplo()`
Gets the format of packed matrix.
• ### Methods inherited from class smile.math.matrix.SMatrix

`apply, diag, market, mv, mv, mv, trace, tv, tv, tv, update`
• ### Methods inherited from class smile.math.matrix.IMatrix

`colName, colNames, colNames, rowName, rowNames, rowNames, toString, toString, toString`
• ### Methods inherited from class java.lang.Object

`finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

• #### FloatSymmMatrix

```public FloatSymmMatrix(UPLO uplo,
int n)```
Constructor.
Parameters:
`uplo` - the symmetric matrix stores the upper or lower triangle.
`n` - the dimension of matrix.
• #### FloatSymmMatrix

```public FloatSymmMatrix(UPLO uplo,
float[][] AP)```
Constructor.
Parameters:
`uplo` - the symmetric matrix stores the upper or lower triangle.
`AP` - the symmetric matrix.
• ### Method Detail

• #### clone

`public FloatSymmMatrix clone()`
Overrides:
`clone` in class `java.lang.Object`
• #### nrows

`public int nrows()`
Description copied from class: `IMatrix`
Returns the number of rows.
Specified by:
`nrows` in class `IMatrix<float[]>`
• #### ncols

`public int ncols()`
Description copied from class: `IMatrix`
Returns the number of columns.
Specified by:
`ncols` in class `IMatrix<float[]>`
• #### size

`public long size()`
Description copied from class: `IMatrix`
Returns the number of stored matrix elements. For conventional matrix, it is simplify nrows * ncols. But it is usually much less for band, packed or sparse matrix.
Specified by:
`size` in class `IMatrix<float[]>`
• #### layout

`public Layout layout()`
Returns the matrix layout.
• #### uplo

`public UPLO uplo()`
Gets the format of packed matrix.
• #### equals

`public boolean equals(java.lang.Object o)`
Overrides:
`equals` in class `java.lang.Object`
• #### equals

```public boolean equals(FloatSymmMatrix o,
float eps)```
Returns if two matrices equals given an error margin.
Parameters:
`o` - the other matrix.
`eps` - the error margin.
• #### get

```public float get(int i,
int j)```
Description copied from class: `SMatrix`
Returns A[i, j].
Specified by:
`get` in class `SMatrix`
• #### set

```public FloatSymmMatrix set(int i,
int j,
float x)```
Description copied from class: `SMatrix`
Sets A[i,j] = x.
Specified by:
`set` in class `SMatrix`
• #### mv

```public void mv(Transpose trans,
float alpha,
float[] x,
float beta,
float[] y)```
Description copied from class: `SMatrix`
Matrix-vector multiplication.
``````
y = alpha * op(A) * x + beta * y
``````
where op is the transpose operation.
Specified by:
`mv` in class `SMatrix`
• #### mv

```public void mv(float[] work,
int inputOffset,
int outputOffset)```
Description copied from class: `IMatrix`
Matrix-vector multiplication A * x.
Specified by:
`mv` in class `IMatrix<float[]>`
Parameters:
`work` - the workspace for both input and output vector.
`inputOffset` - the offset of input vector in workspace.
`outputOffset` - the offset of output vector in workspace.
• #### tv

```public void tv(float[] work,
int inputOffset,
int outputOffset)```
Description copied from class: `IMatrix`
Matrix-vector multiplication A' * x.
Specified by:
`tv` in class `IMatrix<float[]>`
Parameters:
`work` - the workspace for both input and output vector.
`inputOffset` - the offset of input vector in workspace.
`outputOffset` - the offset of output vector in workspace.
• #### bk

`public FloatSymmMatrix.BunchKaufman bk()`
Bunch-Kaufman decomposition.
• #### cholesky

`public FloatSymmMatrix.Cholesky cholesky()`
Cholesky decomposition for symmetric and positive definite matrix.
Throws:
`java.lang.ArithmeticException` - if the matrix is not positive definite.