Constructs a FloatMatrix instance from a data block with the given row and column strides.

Namespace:  CenterSpace.NMath.Core
Assembly:  NMath (in NMath.dll) Version: 5.1.0.0

Syntax

C#
public FloatMatrix(
	int rows,
	int cols,
	FloatDataBlock data,
	int rowStride,
	int colStride
)
Visual Basic (Declaration)
Public Sub New ( _
	rows As Integer, _
	cols As Integer, _
	data As FloatDataBlock, _
	rowStride As Integer, _
	colStride As Integer _
)
Visual C++
public:
FloatMatrix(
	int rows, 
	int cols, 
	FloatDataBlock^ data, 
	int rowStride, 
	int colStride
)

Parameters

rows
Type: System..::.Int32
The number of rows.
cols
Type: System..::.Int32
The number of cols.
data
Type: CenterSpace.NMath.Core..::.FloatDataBlock
A data block.
rowStride
Type: System..::.Int32
The distance between consecutive row elements.
colStride
Type: System..::.Int32
The distance between consecutive column elements.

Remarks

No data is copied. The new matrix references the given data block. The data for the matrix is laid out in a linear array. Two common ways of doing this are: column major - matrix is laid out column by column. In this case the row stride would be equal to 1 and the column stride would be equal to the number of rows. row major - matrix is laid out row by row. In this case the column stride would be equal to 1 and the row stride would be equal to the number of columns. This constructor allows for the explicit specification of the strides. Useful if the layout is neither column nor row major.

Exceptions

ExceptionCondition
CenterSpace.NMath.Core..::.MismatchedSizeException Thrown if data.Length != rows * cols.

See Also