﻿FloatSymmetricMatrix Class

# FloatSymmetricMatrix Class

Class FloatSymmetricMatrix represents a symmetric matrix of float-precision floating point values.
Inheritance Hierarchy
SystemObject
CenterSpace.NMath.CoreFloatSymmetricMatrix

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
```[SerializableAttribute]
public class FloatSymmetricMatrix : ICloneable```

The FloatSymmetricMatrix type exposes the following members.

Constructors
NameDescription
FloatSymmetricMatrix(FloatMatrix) Constructs a square FloatSymmetricMatrix instance by extracting the upper triangular part of a square general matrix.
FloatSymmetricMatrix(FloatVector) Constructs a FloatSymmetricMatrix instance using the data in the given vector.
FloatSymmetricMatrix(Int32) Constructs a FloatSymmetricMatrix instance with the specified size.
FloatSymmetricMatrix(FloatVector, Int32) Constructs a FloatSymmetricMatrix instance with the specified size, and using the data in the given vector.
Top
Properties
NameDescription
Cols Gets the number of columns in the matrix.
DataVector Gets the data vector referenced by this matrix.
Item Gets and sets the value at the specified position. Symmetry is maintained.
Order Gets the order of the matrix.
Rows Gets the number of rows in the matrix.
Top
Methods
NameDescription
Apply(FuncFloatVector, Single) Returns a new vector containing an element for each column or row in this matrix. The elements are the results of applying a function that takes a vector and returns a single-precision number.
Apply(FuncSingle, Single) Returns a new matrix with the same size as this matrix, whose values are the result of applying the given unary function to each element of this matrix.
Apply(FuncSingle, Int32, Single, Int32) Returns a new matrix with the same size as this matrix, whose values are the result of applying the given binary function to each element of this matrix. The first parameter to the binary function is the matrix element; the second parameter is the passed integer value.
Apply(FuncSingle, Single, Single, FloatSymmetricMatrix) Returns a new matrix with the same size as this matrix, whose values are the result of applying the given binary function to each element of this matrix. The first parameter to the binary function is the matrix element; the second parameter is the corresponding element of the passed matrix.
Apply(FuncSingle, Single, Single, Single) Returns a new matrix with the same size as this matrix, whose values are the result of applying the given binary function to each element of this matrix. The first parameter to the binary function is the matrix element; the second parameter is the passed float-precision value.
Clone Creates a deep copy of this matrix.
DeepenThisCopy Guarantees that there is only one reference to the underlying data and that this data is in contiguous storage.
Divide(FloatSymmetricMatrix, FloatSymmetricMatrix) Divide a symmetric matrix by another.
Divide(FloatSymmetricMatrix, Single) Divide a symmetric matrix by a scalar.
Divide(Single, FloatSymmetricMatrix) Divide a scalar by a symmetric matrix.
Equals Tests for equality of this matrix and another matrix. Two matrices are equal if they have the same dimensions and all values are equal.
(Overrides ObjectEquals(Object))
GetHashCode Returns an integer hash code for this matrix.
(Overrides ObjectGetHashCode)
LeadingSubmatrix Returns the k by k upper left corner of the matrix. The matrix and the submatrix share the same data.
Multiply(FloatSymmetricMatrix, FloatSymmetricMatrix) Multiply two lower symmetric matrices.
Multiply(FloatSymmetricMatrix, Single) Multiply a symmetric matrix and a scalar.
Multiply(Single, FloatSymmetricMatrix) Multiply a scalar and a symmetric matrix.
Negate Negation operator.
OnDeserialized Checks that the matrix is square following deserialization
Resize Changes the order of this matrix to that specified, adding zeros or truncating as necessary.
ShallowCopy Creates a shallow copy of this matrix.
Subtract(FloatSymmetricMatrix, FloatSymmetricMatrix) Subtracts one symmetric matrix from another.
Subtract(FloatSymmetricMatrix, Single) Subtracts a scalar from a symmetric matrix.
Subtract(Single, FloatSymmetricMatrix) Subtracts a symmetric matrix from a scalar.
ToCommaSeparated Returns a formatted string representation of this matrix using commas and newlines.
ToCommaSeparated(String) Returns a formatted string representation of this matrix using commas and newlines. Numbers are formatted using the specified format string.
ToGeneralMatrix Converts this sparse matrix to a general matrix.
ToString Returns a formatted string representation of this matrix.

ToCommaSeparated

ToCommaSeparated(String)

ToTabDelimited

ToTabDelimited(String)

(Overrides ObjectToString)
ToString(String) Returns a formatted string representation of this matrix. Numbers are displayed using the specified format.

ToCommaSeparated

ToCommaSeparated(String)

ToTabDelimited

ToTabDelimited(String)

ToTabDelimited Returns a formatted string representation of this matrix using tabs and newlines.
ToTabDelimited(String) Returns a formatted string representation of this matrix using tabs and newlines. Numbers are formatted using the specified format string.
Transform(FuncSingle, Single) Modifies the elements of this matrix by applying the given unary function to each element.
Transform(FuncSingle, Int32, Single, Int32) Modifies the contents of this matrix by applying the given binary function to each element. The first parameter to the binary function is the matrix element; the second parameter is the passed integer value.
Transform(FuncSingle, Single, Single, FloatSymmetricMatrix) Modifies the contents of this matrix by applying the given binary function to each element. The first parameter to the binary function is the matrix element; the second parameter is the corresponding element of the passed matrix.
Transform(FuncSingle, Single, Single, Single) Modifies the contents of this matrix by applying the given binary function to each element. The first parameter to the binary function is the matrix element; the second parameter is the passed float-precision value.
Transpose Returns this matrix.
Top
Operators
NameDescription
Decrement(FloatSymmetricMatrix) Decrements each element of the given matrix.
Division(FloatSymmetricMatrix, FloatSymmetricMatrix) Divide a symmetric matrix by another.
Division(FloatSymmetricMatrix, Single) Divide a symmetric matrix by a scalar.
Division(Single, FloatSymmetricMatrix) Divide a scalar by a symmetric matrix.
Equality(FloatSymmetricMatrix, FloatSymmetricMatrix) Tests for equality of two symmetric matrices. Two matrices are equal if they have the same order and all values are equal.
Increment(FloatSymmetricMatrix) Increments each element of the given matrix.
Inequality(FloatSymmetricMatrix, FloatSymmetricMatrix) Tests for inequality of two symmetric matrices. Two matrices are equal if they have the same order and all values are equal.
Multiply(FloatSymmetricMatrix, FloatSymmetricMatrix) Multiply two lower symmetric matrices. Multiply two lower symmetric matrices.
Multiply(FloatSymmetricMatrix, Single) Multiply a symmetric matrix and a scalar.
Multiply(Single, FloatSymmetricMatrix) Multiply a scalar and a symmetric matrix.
Subtraction(FloatSymmetricMatrix, FloatSymmetricMatrix) Subtracts one symmetric matrix from another.
Subtraction(FloatSymmetricMatrix, Single) Subtracts a scalar from a symmetric matrix.
Subtraction(Single, FloatSymmetricMatrix) Subtracts a symmetric matrix from a scalar.
UnaryNegation(FloatSymmetricMatrix) Negation operator.
UnaryPlus(FloatSymmetricMatrix) Unary + operator. Just returns the input matrix.
Top
Remarks
A symmetric matrix is equal to its transpose. In other words, A[i,j] = A[j,i] for all elements i,j in matrix A.
The matrix is stored in a vector column by column. For efficiency, only the upper triangle is stored. For example, the following 5 by 5 symmetric matrix:
C#
```    | a00 a01 a02 a03 a04 |
| a10 a11 a12 a13 a14 |
A = | a20 a21 a22 a23 a24 |
| a30 a31 a32 a33 a34 |
| a40 a41 a42 a43 a44 |```
is stored in a data vector v as:
C#
`v = [a00 a01 a11 a02 a12 a22 a03 a13 a23 a33 a04 a14 a24 a34 a44 ]`
In general, A[i,j] = v[j(j+1)/2+i], i<=j v[i(i+1)/2+j], j<i