Matrix.Wrap Symmetric Method
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.0.0
Overload List
| Wrap | Creates a new SymmetricMatrix<T> by wrapping an existing Array2D<T> without copying. |
| Wrap | Creates a new SymmetricMatrix<T> by wrapping an existing one-dimensional array without copying. |
| Wrap | Creates a new SymmetricMatrix<T> by wrapping an existing Memory2D<T> without copying. |
WrapSymmetric<T>(Array2D<T>, Int32, MatrixTriangle, MatrixElementOrder, ArrayMutability)
Creates a new SymmetricMatrix<T> by wrapping an existing Array2D<T>
without copying.
public static SymmetricMatrix<T> WrapSymmetric<T>(
Array2D<T> source,
int dimension,
MatrixTriangle storedTriangle = MatrixTriangle.Upper,
MatrixElementOrder elementOrder = MatrixElementOrder.ColumnMajor,
ArrayMutability mutability = ArrayMutability.MutableValues
)
Parameters
- source Array2D<T>
- An Array2D<T> to wrap.
- dimension Int32
- The number of rows and columns in the symmetric matrix.
- storedTriangle MatrixTriangle (Optional)
- Specifies whether the upper or lower triangle is stored.
- elementOrder MatrixElementOrder (Optional)
- A MatrixElementOrder value that indicates whether the elements are stored in column-major or row-major order.
- mutability ArrayMutability (Optional)
- Specifies how the matrix's values may be changed. The default is mutable values.
Type Parameters
- T
- The element type of the matrix.
Return Value
SymmetricMatrix<T>A new SymmetricMatrix<T> that wraps the source storage.
Remarks
Changes to the matrix will affect the original storage, and vice versa.
Exceptions
| Argument | source is null. |
WrapSymmetric<T>(T[], Int32, MatrixTriangle, MatrixElementOrder, ArrayMutability)
Creates a new SymmetricMatrix<T> by wrapping an existing one-dimensional array
without copying.
public static SymmetricMatrix<T> WrapSymmetric<T>(
T[] source,
int dimension,
MatrixTriangle storedTriangle = MatrixTriangle.Upper,
MatrixElementOrder elementOrder = MatrixElementOrder.ColumnMajor,
ArrayMutability mutability = ArrayMutability.MutableValues
)
Parameters
- source T[]
- A one-dimensional array to wrap.
- dimension Int32
- The number of rows and columns in the symmetric matrix.
- storedTriangle MatrixTriangle (Optional)
- Specifies whether the upper or lower triangle is stored in source.
- elementOrder MatrixElementOrder (Optional)
- A MatrixElementOrder value that indicates whether the elements in source are stored in column-major or row-major order.
- mutability ArrayMutability (Optional)
- Specifies how the matrix's values may be changed. The default is mutable values.
Type Parameters
- T
- The element type of the matrix.
Return Value
SymmetricMatrix<T>A new SymmetricMatrix<T> that wraps the source array.
Remarks
Changes to the matrix will affect the original array, and vice versa.
Exceptions
| Argument | source is null. |
| Argument | The length of source is less than dimension * dimension. |
WrapSymmetric<T>(Memory2D<T>, Int32, MatrixTriangle, MatrixElementOrder, ArrayMutability)
Creates a new SymmetricMatrix<T> by wrapping an existing Memory2D<T>
without copying.
public static SymmetricMatrix<T> WrapSymmetric<T>(
Memory2D<T> source,
int dimension,
MatrixTriangle storedTriangle = MatrixTriangle.Upper,
MatrixElementOrder elementOrder = MatrixElementOrder.ColumnMajor,
ArrayMutability mutability = ArrayMutability.MutableValues
)
Parameters
- source Memory2D<T>
- A Memory2D<T> to wrap.
- dimension Int32
- The number of rows and columns in the symmetric matrix.
- storedTriangle MatrixTriangle (Optional)
- Specifies whether the upper or lower triangle is stored.
- elementOrder MatrixElementOrder (Optional)
- A MatrixElementOrder value that indicates whether the elements are stored in column-major or row-major order.
- mutability ArrayMutability (Optional)
- Specifies how the matrix's values may be changed. The default is mutable values.
Type Parameters
- T
- The element type of the matrix.
Return Value
SymmetricMatrix<T>A new SymmetricMatrix<T> that wraps the source storage.
Remarks
Changes to the matrix will affect the original storage, and vice versa.