C# 클래스 LitDev.LDMatrix

파일 보기 프로젝트 열기: litdev1/LitDev

공개 메소드들

메소드 설명
Add ( Primitive matrix1, Primitive matrix2, Primitive result ) : Primitive

Add two matrices, the number of rows and columns of the 3 matrices given must be the same. Alternatively, if the second matrix is a scalar number then it is added to each element of the first matrix.

Copy ( Primitive matrix1, Primitive matrix2 ) : Primitive

Copy one matrix to an existing matrix. The dimensions of the 2 matrices must be the same.

CopyNew ( Primitive matrix ) : Primitive

Copy one matrix to a new matrix.

CopyToSBArray ( Primitive matrix ) : Primitive

Copy LDMatrix type to SmallBasic array type. The reverse operation (SmallBasic to LDMatrix) isn't possible becuase the SmallBasic indexes are not necessarily contiguous integers.

Create ( Primitive rows, Primitive cols ) : Primitive

Create a matrix object. Row and column matrices can be defined with rows = 1 or cols = 1 respectively.

Delete ( Primitive matrix ) : Primitive

Delete an existing matrix (not generally required, but can save memory if lots of matrices are created).

GetValue ( Primitive matrix, Primitive row, Primitive col ) : Primitive

Get value in matrix.

Inverse ( Primitive matrix, Primitive inverse ) : Primitive

Calculate the inverse of a matrix (using Gaussian Elimination). The number of rows and columns of the matrix and inverse must be the same (square matrices). A singular matrix returns "SINGULAR" and the inverse matrix will be incorrect.

Multiply ( Primitive matrix1, Primitive matrix2, Primitive result ) : Primitive

Multiply two matrices, the number of columns of the first and rows of the second matrix must be the same. The number of rows and columns of the result matrix must be the rows of the first and columns of the second. Alternatively, if the second matrix is a scalar number then it is multiplied by each element of the first matrix and the dimensions of the first and result must be the same.

SetValue ( Primitive matrix, Primitive row, Primitive col, Primitive value ) : Primitive

Set value in matrix.

Transpose ( Primitive matrix, Primitive transpose ) : Primitive

Calculate the transpose of a matrix. The number of rows and columns of the matrix and transpose must be reversed (cols = rows and vice versa).

View ( Primitive matrix, Primitive modal ) : void

View a matrix for dubugging purposes.

비공개 메소드들

메소드 설명
getMatrix ( string name ) : Matrix
getNewNumber ( ) : int

메소드 상세

Add() 공개 정적인 메소드

Add two matrices, the number of rows and columns of the 3 matrices given must be the same. Alternatively, if the second matrix is a scalar number then it is added to each element of the first matrix.
public static Add ( Primitive matrix1, Primitive matrix2, Primitive result ) : Primitive
matrix1 Primitive The first matrix.
matrix2 Primitive The second matrix (or scalar value).
result Primitive The result matrix.
리턴 Primitive

Copy() 공개 정적인 메소드

Copy one matrix to an existing matrix. The dimensions of the 2 matrices must be the same.
public static Copy ( Primitive matrix1, Primitive matrix2 ) : Primitive
matrix1 Primitive /// The matrix to copy from. ///
matrix2 Primitive /// The matrix to copy to. ///
리턴 Primitive

CopyNew() 공개 정적인 메소드

Copy one matrix to a new matrix.
public static CopyNew ( Primitive matrix ) : Primitive
matrix Primitive /// The matrix to copy. ///
리턴 Primitive

CopyToSBArray() 공개 정적인 메소드

Copy LDMatrix type to SmallBasic array type. The reverse operation (SmallBasic to LDMatrix) isn't possible becuase the SmallBasic indexes are not necessarily contiguous integers.
public static CopyToSBArray ( Primitive matrix ) : Primitive
matrix Primitive /// The matrix name. ///
리턴 Primitive

Create() 공개 정적인 메소드

Create a matrix object. Row and column matrices can be defined with rows = 1 or cols = 1 respectively.
public static Create ( Primitive rows, Primitive cols ) : Primitive
rows Primitive The number of rows.
cols Primitive The number of columns.
리턴 Primitive

Delete() 공개 정적인 메소드

Delete an existing matrix (not generally required, but can save memory if lots of matrices are created).
public static Delete ( Primitive matrix ) : Primitive
matrix Primitive /// The matrix name. ///
리턴 Primitive

GetValue() 공개 정적인 메소드

Get value in matrix.
public static GetValue ( Primitive matrix, Primitive row, Primitive col ) : Primitive
matrix Primitive /// The matrix name. ///
row Primitive /// The row at which to get the value (indexed starting from 1). ///
col Primitive /// The column at which to get the value (indexed starting from 1). ///
리턴 Primitive

Inverse() 공개 정적인 메소드

Calculate the inverse of a matrix (using Gaussian Elimination). The number of rows and columns of the matrix and inverse must be the same (square matrices). A singular matrix returns "SINGULAR" and the inverse matrix will be incorrect.
public static Inverse ( Primitive matrix, Primitive inverse ) : Primitive
matrix Primitive The matrix to invert (unmodified by inversion).
inverse Primitive The inverse matrix.
리턴 Primitive

Multiply() 공개 정적인 메소드

Multiply two matrices, the number of columns of the first and rows of the second matrix must be the same. The number of rows and columns of the result matrix must be the rows of the first and columns of the second. Alternatively, if the second matrix is a scalar number then it is multiplied by each element of the first matrix and the dimensions of the first and result must be the same.
public static Multiply ( Primitive matrix1, Primitive matrix2, Primitive result ) : Primitive
matrix1 Primitive The first matrix.
matrix2 Primitive The second matrix (or scalar value).
result Primitive The result matrix.
리턴 Primitive

SetValue() 공개 정적인 메소드

Set value in matrix.
public static SetValue ( Primitive matrix, Primitive row, Primitive col, Primitive value ) : Primitive
matrix Primitive /// The matrix name. ///
row Primitive /// The row at which to add the value (indexed starting from 1). ///
col Primitive /// The column at which to add the value (indexed starting from 1). ///
value Primitive /// The value. ///
리턴 Primitive

Transpose() 공개 정적인 메소드

Calculate the transpose of a matrix. The number of rows and columns of the matrix and transpose must be reversed (cols = rows and vice versa).
public static Transpose ( Primitive matrix, Primitive transpose ) : Primitive
matrix Primitive The matrix to transpose.
transpose Primitive The resulting transposed matrix.
리턴 Primitive

View() 공개 정적인 메소드

View a matrix for dubugging purposes.
public static View ( Primitive matrix, Primitive modal ) : void
matrix Primitive The matrix to display.
modal Primitive The matrix display will pause all other actions until it is closed. ("True" or "False").
리턴 void