In vb.net, a matrix can be represented simply by an array , which can be represented by classes (Class) for more functionality.
Mathematical definition of matrices: number of M rows n columns by m*n
Public ClassMatrixPrivateTabledata (,) as Double PrivateRowlength, Collength as Integer 'the length of the matrix Public ReadOnly PropertyRow ()Get ReturnRowlengthEnd Get End Property 'The column length of the matrix Public ReadOnly PropertyCol ()Get ReturnCollengthEnd Get End Property 'element of IRow Row icol column of the Matrix Public PropertyItem (ByValIRow as Integer,ByValIcol as Integer) Get ReturnTabledata (IRow-1, Icol-1) End Get Set(ByValvalue) Tabledata (IRow-1, Icol-1) =valueEnd Set End Property Public Sub New(ByValNrow as Integer,ByValNcolumn as Integer) DimTemparray (Nrow-1, Ncolumn-1) as DoubleTabledata=Temparray rowlength=Nrow collength=NcolumnEnd SubEnd Class
Matrix and its operations (i): Creating a Matrix Class