DenseMatrix<T, TSlice, TStorage2D>.CloneData Method

Definition

Namespace: Numerics.NET.LinearAlgebra
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3

Overload List

CloneData() Gives this instance its own copy of its elements.
CloneData(MatrixElementOrder) Gives this instance its own copy of its elements.

CloneData

Gives this instance its own copy of its elements.
C#
public override void CloneData()

Remarks

Objects derived from Vector<T> or Matrix<T> may share an underlying storage structure. For example, the GetSubmatrix(Int32, Int32, Int32, Int32) method of the Matrix<T> class returns a MatrixView<T> that is a view on a part of a matrix. Changing an element in the sub-matrix changes the corresponding element in the original matrix.

This method ensures that this instance has its own copy of the values. After a call to this method, any changes to the elements of this matrix will only affect this instance. Moreover, the elements are guaranteed to be in one contiguous block of memory.

This overload of the CloneData(MatrixElementOrder) method stores elements in ColumnMajor elementOrder.

CloneData(MatrixElementOrder)

Gives this instance its own copy of its elements.
C#
public override void CloneData(
	MatrixElementOrder elementOrder
)

Parameters

elementOrder  MatrixElementOrder
A MatrixElementOrder value that specifies whether to store the elements in column-major or row-major elementOrder.

Remarks

Objects derived from Vector<T> or Matrix<T> may share an underlying storage structure. For example, the GetSubmatrix(Int32, Int32, Int32, Int32) method of the Matrix<T> class returns a MatrixView<T> that is a view on a part of a matrix. Changing an element in the sub-matrix changes the corresponding element in the original matrix.

This method ensures that this instance has its own copy of the values. After a call to this method, any changes to the elements of this matrix will only affect this instance. Moreover, the elements are guaranteed to be in one contiguous block of memory, in the elementOrder specified by the elementOrder parameter.

See Also