Matrix and its operations (i): Creating a Matrix Class

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.