C# 클래스 YAMP.MatrixValue

The class for representing a matrix value.
상속: NumericValue, IFunction, ISetFunction
파일 보기 프로젝트 열기: FlorianRappl/YAMP 1 사용 예제들

공개 메소드들

메소드 설명
Abs ( ) : ScalarValue

Computes the L2-Norm of the matrix (seen as a vector).

AddColumn ( Value value ) : MatrixValue

Adds a column specified by the type of the value to add-in. If it is a scalar value, then it is quite simple. For a matrix the geometry is important.

AddMM ( Value left, Value right ) : MatrixValue

Matrix + Matrix

AddMS ( Value left, Value right ) : MatrixValue

Matrix + Scalar

AddRow ( Value value ) : MatrixValue

Creates a new matrix with another row. The row is either simply a number (in this case the value is just inserted) or a matrix (then the geometry is important).

AddSM ( Value left, Value right ) : MatrixValue

Scalar + Matrix

Adjungate ( ) : MatrixValue

Computes the adjungated (transposed + c.c.) matrix.

Clear ( ) : void

Clears all entries.

Clone ( ) : MatrixValue

Creates a deep copy of the matrix.

ComplexDot ( MatrixValue w ) : ScalarValue

Produces a complex dot (this operand is c.c.) product of the given instance (seen as a vector) with another vector.

ComputeLargestStringContent ( ParseContext context ) : Int32

Gets the maximum length of any cell of the matrix by considering the given context.

Copy ( ) : Value

Creates a deep copy of the matrix.

Create ( Value value ) : MatrixValue

Creates a new matrix with the help of a specified value.

DeleteColumns ( int index, int count = 1 ) : void

Deletes the specified number of columns of the matrix.

DeleteRows ( int index, int count = 1 ) : void

Deletes the specified number of rows of the matrix.

Deserialize ( Byte content ) : Value

Creates a new matrix instance from the given content.

Det ( ) : ScalarValue

Computes the determinant of the matrix.

DivideMM ( Value left, Value right ) : MatrixValue

Matrix / Matrix

DivideMS ( Value left, Value right ) : MatrixValue

Matrix / Scalar

DivideSM ( Value left, Value right ) : MatrixValue

Scalar / Matrix

Dot ( MatrixValue w ) : ScalarValue

Produces a dot product of the given instance (seen as a vector) with another vector.

Equals ( object obj ) : bool

Takes a close look if two matrices are equivalent.

ForEach ( ScalarValue>.Func f ) : MatrixValue

Performs the operation f on each element of the matrix, creating a new matrix B where each entry is given by B_jk = f(A_jk).

FrobeniusNorm ( ) : double

Computes the Frobenius-norm of the matrix.

The Frobenius-norm of a matrix the square root of the sum of the squares of all the elements. In the case of a row or column vector, this reduces to the Euclidean vector norm.

GetColumnVector ( int i ) : MatrixValue

Gets the i-th column vector, i.e. a vector which is spanned over all rows of one column.

GetComplexMatrix ( ) : YAMP.ScalarValue[][]

Gets a real matrix of the complete matrix.

GetHashCode ( ) : int

Gives a first hint if two matrices can be equivalent.

GetRealMatrix ( ) : double[][]

Gets a real matrix of the complete matrix.

GetRealVector ( ) : double[]

Gets a real vector of the complete matrix.

GetRealVector ( int yoffset, int ylength, int xoffset, int xlength ) : double[]

Gets a real vector of a submatrix.

GetRowVector ( int j ) : MatrixValue

Gets the j-th row vector, i.e. a vector which is spanned over all columns of one row.

GetSubMatrix ( int y, int xoffset, int xfinal ) : MatrixValue

Creates a sub matrix of the given instance.

GetSubMatrix ( int yoffset, int yfinal, int xoffset, int xfinal ) : MatrixValue

Creates a sub matrix of the given instance.

InfinityNorm ( ) : double

Computes the ∞-norm of the matrix.

The ∞-norm of a matrix is the largest row sum.

Inverse ( ) : MatrixValue

Computes the inverse (if it exists).

MatrixValue ( ) : System

Constructs a new matrix.

MatrixValue ( ScalarValue>.Dictionary values, Int32 rows, Int32 cols ) : System

Constructs a new matrix with the provided values and dimension.

MatrixValue ( Double values ) : System

Constructs a new matrix based on the given two dimensional array.

MatrixValue ( Double values, Int32 rows, Int32 cols ) : System

Constructs a new matrix based on the jagged double array.

MatrixValue ( Int32 rows, Int32 cols ) : System

Constructs a new matrix with the given dimension.

MatrixValue ( Int32 rows, Int32 cols, ScalarValue filling ) : System

Constructs a new matrix with the given dimension and sets each entry to the given value.

MatrixValue ( ScalarValue values, Int32 rows, Int32 cols ) : System

Constructs a new matrix based on the jagged double array.

Max ( ) : MatrixIndex

Gets the index for the maximum entry in the matrix.

Min ( ) : MatrixIndex

Gets the index for the minimum entry in the matrix.

ModuloMS ( Value left, Value right ) : MatrixValue

Matrix % Scalar

ModuloSM ( Value left, Value right ) : MatrixValue

Scalar % Matrix

MultiplyMM ( Value left, Value right ) : Value

Matrix * Matrix

MultiplyMS ( Value left, Value right ) : MatrixValue

Matrix * Scalar

MultiplySM ( Value left, Value right ) : MatrixValue

Scalar * Matrix

One ( int dimension ) : MatrixValue

Creates a new identity matrix of the given dimension.

One ( int rows, int columns ) : MatrixValue

Creates a new identity matrix of the given dimension.

OneNorm ( ) : double

Computes the 1-norm of the matrix.

The 1-norm of a matrix is the largest column sum.

Ones ( int rows, int cols ) : MatrixValue

Creates a matrix containing only ones.

Perform ( ParseContext context, Value argument ) : Value

The method used by YAMP to get values from a matrix.

Perform ( ParseContext context, Value argument, Value values ) : Value

Method used by YAMP to set values in a matrix.

PowMS ( Value basis, Value exponent ) : MatrixValue

Matrix ^ Scalar

PowSM ( Value basis, Value exponent ) : MatrixValue

Scalar ^ Matrix

Randomize ( ) : void

Goes over all rows and columns and randomizes the values.

Serialize ( ) : Byte[]

Serializes the current instance.

SetColumnVector ( int i, MatrixValue m ) : MatrixValue

Sets the i-th column vector to be of the given matrix.

SetRowVector ( int j, MatrixValue m ) : MatrixValue

Sets the j-th row vector to be of the given matrix.

SubtractMM ( Value left, Value right ) : Value

Matrix - Matrix

SubtractMS ( Value left, Value right ) : MatrixValue

Matrix - Scalar

SubtractSM ( Value left, Value right ) : MatrixValue

Scalar - Matrix

Sum ( ) : ScalarValue

Computes the sum of all entries.

ToArray ( ) : YAMP.ScalarValue[]

Copies the internal scalar values to a 1-dim. complex array.

ToString ( ParseContext context ) : String

Creates a standard string representation of the matrix.

ToString ( ParseContext context, Int32 exponent ) : String

Creates a standard string representation of the matrix.

Trace ( ) : ScalarValue

Computes the trace (sum over all elements on the diagonal) of the matrix.

Transpose ( ) : MatrixValue

Computes the transposed matrix.

VectorSort ( ) : MatrixValue

Sorts the values of the matrix and outputs the values in a new vector.

operator ( ) : System.Boolean

Inequality.

operator ( ) : MatrixValue

Multiplication.

this ( int i ) : ScalarValue

Gets or sets the i-th element of the matrix (counted rows-first).

this ( int j, int i ) : ScalarValue

Gets the element of the j-th row and i-th column.

보호된 메소드들

메소드 설명
ContainsIndex ( MatrixIndex index ) : bool

Does the matrix contain this index? If not then the value is zero.

GetIndex ( int i ) : MatrixIndex

Gets the matrix-index (row, column) of the 1-based 1-dim. index i.

GetIndex ( MatrixIndex index ) : ScalarValue

Gets the entry of the specified matrix-index entry in the dictionary. Please check if the element is in the dictionary anyway (ContainsIndex).

RegisterOperators ( ) : void

Registers all operators that are associated with the matrix.

비공개 메소드들

메소드 설명
DeleteFullColumns ( List indices ) : void
DeleteFullRows ( List indices ) : void
LogicalSubscripting ( MatrixValue m ) : MatrixValue
LogicalSubscripting ( MatrixValue m, List indices ) : void

메소드 상세

Abs() 공개 메소드

Computes the L2-Norm of the matrix (seen as a vector).
public Abs ( ) : ScalarValue
리턴 ScalarValue

AddColumn() 공개 메소드

Adds a column specified by the type of the value to add-in. If it is a scalar value, then it is quite simple. For a matrix the geometry is important.
public AddColumn ( Value value ) : MatrixValue
value Value The value to add in another column.
리턴 MatrixValue

AddMM() 공개 정적인 메소드

Matrix + Matrix
public static AddMM ( Value left, Value right ) : MatrixValue
left Value Must be a matrix.
right Value Must be a matrix.
리턴 MatrixValue

AddMS() 공개 정적인 메소드

Matrix + Scalar
public static AddMS ( Value left, Value right ) : MatrixValue
left Value Must be a matr.
right Value Must be a scalar.
리턴 MatrixValue

AddRow() 공개 메소드

Creates a new matrix with another row. The row is either simply a number (in this case the value is just inserted) or a matrix (then the geometry is important).
public AddRow ( Value value ) : MatrixValue
value Value The value to append as a row.
리턴 MatrixValue

AddSM() 공개 정적인 메소드

Scalar + Matrix
public static AddSM ( Value left, Value right ) : MatrixValue
left Value Must be a scalar.
right Value Must be a matrix.
리턴 MatrixValue

Adjungate() 공개 메소드

Computes the adjungated (transposed + c.c.) matrix.
public Adjungate ( ) : MatrixValue
리턴 MatrixValue

Clear() 공개 메소드

Clears all entries.
public Clear ( ) : void
리턴 void

Clone() 공개 메소드

Creates a deep copy of the matrix.
public Clone ( ) : MatrixValue
리턴 MatrixValue

ComplexDot() 공개 메소드

Produces a complex dot (this operand is c.c.) product of the given instance (seen as a vector) with another vector.
public ComplexDot ( MatrixValue w ) : ScalarValue
w MatrixValue The second operand of the complex dot-product.
리턴 ScalarValue

ComputeLargestStringContent() 공개 메소드

Gets the maximum length of any cell of the matrix by considering the given context.
public ComputeLargestStringContent ( ParseContext context ) : Int32
context ParseContext The parse context which holds the state information.
리턴 System.Int32

ContainsIndex() 보호된 메소드

Does the matrix contain this index? If not then the value is zero.
protected ContainsIndex ( MatrixIndex index ) : bool
index MatrixIndex The matrix-index (row, column).
리턴 bool

Copy() 공개 메소드

Creates a deep copy of the matrix.
public Copy ( ) : Value
리턴 Value

Create() 공개 정적인 메소드

Creates a new matrix with the help of a specified value.
public static Create ( Value value ) : MatrixValue
value Value The value to initialize the matrix with.
리턴 MatrixValue

DeleteColumns() 공개 메소드

Deletes the specified number of columns of the matrix.
public DeleteColumns ( int index, int count = 1 ) : void
index int The column index to start (1-based).
count int The number of columns to remove.
리턴 void

DeleteRows() 공개 메소드

Deletes the specified number of rows of the matrix.
public DeleteRows ( int index, int count = 1 ) : void
index int The row index to start (1-based).
count int The number of rows to remove.
리턴 void

Deserialize() 공개 메소드

Creates a new matrix instance from the given content.
public Deserialize ( Byte content ) : Value
content Byte The binary content.
리턴 Value

Det() 공개 메소드

Computes the determinant of the matrix.
public Det ( ) : ScalarValue
리턴 ScalarValue

DivideMM() 공개 정적인 메소드

Matrix / Matrix
public static DivideMM ( Value left, Value right ) : MatrixValue
left Value Must be a matrix.
right Value Must be a matrix.
리턴 MatrixValue

DivideMS() 공개 정적인 메소드

Matrix / Scalar
public static DivideMS ( Value left, Value right ) : MatrixValue
left Value Must be a matr.
right Value Must be a scalar.
리턴 MatrixValue

DivideSM() 공개 정적인 메소드

Scalar / Matrix
public static DivideSM ( Value left, Value right ) : MatrixValue
left Value Must be a scalar.
right Value Must be a matrix.
리턴 MatrixValue

Dot() 공개 메소드

Produces a dot product of the given instance (seen as a vector) with another vector.
public Dot ( MatrixValue w ) : ScalarValue
w MatrixValue The second operand of the dot-product.
리턴 ScalarValue

Equals() 공개 메소드

Takes a close look if two matrices are equivalent.
public Equals ( object obj ) : bool
obj object The other matrix (otherwise it is false).
리턴 bool

ForEach() 공개 메소드

Performs the operation f on each element of the matrix, creating a new matrix B where each entry is given by B_jk = f(A_jk).
public ForEach ( ScalarValue>.Func f ) : MatrixValue
f ScalarValue>.Func The function to use.
리턴 MatrixValue

FrobeniusNorm() 공개 메소드

Computes the Frobenius-norm of the matrix.

The Frobenius-norm of a matrix the square root of the sum of the squares of all the elements. In the case of a row or column vector, this reduces to the Euclidean vector norm.

public FrobeniusNorm ( ) : double
리턴 double

GetColumnVector() 공개 메소드

Gets the i-th column vector, i.e. a vector which is spanned over all rows of one column.
public GetColumnVector ( int i ) : MatrixValue
i int The index of the column to get the vector from.
리턴 MatrixValue

GetComplexMatrix() 공개 메소드

Gets a real matrix of the complete matrix.
public GetComplexMatrix ( ) : YAMP.ScalarValue[][]
리턴 YAMP.ScalarValue[][]

GetHashCode() 공개 메소드

Gives a first hint if two matrices can be equivalent.
public GetHashCode ( ) : int
리턴 int

GetIndex() 보호된 메소드

Gets the matrix-index (row, column) of the 1-based 1-dim. index i.
protected GetIndex ( int i ) : MatrixIndex
i int The 1-based index. The i-th element is requested.
리턴 MatrixIndex

GetIndex() 보호된 메소드

Gets the entry of the specified matrix-index entry in the dictionary. Please check if the element is in the dictionary anyway (ContainsIndex).
protected GetIndex ( MatrixIndex index ) : ScalarValue
index MatrixIndex The matrix-index (row, column).
리턴 ScalarValue

GetRealMatrix() 공개 메소드

Gets a real matrix of the complete matrix.
public GetRealMatrix ( ) : double[][]
리턴 double[][]

GetRealVector() 공개 메소드

Gets a real vector of the complete matrix.
public GetRealVector ( ) : double[]
리턴 double[]

GetRealVector() 공개 메소드

Gets a real vector of a submatrix.
public GetRealVector ( int yoffset, int ylength, int xoffset, int xlength ) : double[]
yoffset int The offset in rows.
ylength int The length in rows.
xoffset int The offset in columns.
xlength int The length in columns.
리턴 double[]

GetRowVector() 공개 메소드

Gets the j-th row vector, i.e. a vector which is spanned over all columns of one row.
public GetRowVector ( int j ) : MatrixValue
j int The index of the row to get the vector from.
리턴 MatrixValue

GetSubMatrix() 공개 메소드

Creates a sub matrix of the given instance.
public GetSubMatrix ( int y, int xoffset, int xfinal ) : MatrixValue
y int Row-indices to consider.
xoffset int Horizontal offset in columns.
xfinal int Final column-index.
리턴 MatrixValue

GetSubMatrix() 공개 메소드

Creates a sub matrix of the given instance.
public GetSubMatrix ( int yoffset, int yfinal, int xoffset, int xfinal ) : MatrixValue
yoffset int Vertical offset in rows.
yfinal int Final row-index.
xoffset int Horizontal offset in columns.
xfinal int Final column-index.
리턴 MatrixValue

InfinityNorm() 공개 메소드

Computes the ∞-norm of the matrix.

The ∞-norm of a matrix is the largest row sum.

public InfinityNorm ( ) : double
리턴 double

Inverse() 공개 메소드

Computes the inverse (if it exists).
public Inverse ( ) : MatrixValue
리턴 MatrixValue

MatrixValue() 공개 메소드

Constructs a new matrix.
public MatrixValue ( ) : System
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix with the provided values and dimension.
public MatrixValue ( ScalarValue>.Dictionary values, Int32 rows, Int32 cols ) : System
values ScalarValue>.Dictionary The values to assign.
rows System.Int32 The number of rows in the new matrix.
cols System.Int32 The number of columns in the matrix.
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix based on the given two dimensional array.
public MatrixValue ( Double values ) : System
values Double The values which set the dimensions and starting values of the matrix.
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix based on the jagged double array.
public MatrixValue ( Double values, Int32 rows, Int32 cols ) : System
values Double The values to use.
rows System.Int32 The number of rows in the new matrix.
cols System.Int32 The number of columns in the matrix.
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix with the given dimension.
public MatrixValue ( Int32 rows, Int32 cols ) : System
rows System.Int32 The number of rows.
cols System.Int32 The number of columns.
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix with the given dimension and sets each entry to the given value.
public MatrixValue ( Int32 rows, Int32 cols, ScalarValue filling ) : System
rows System.Int32
cols System.Int32
filling ScalarValue
리턴 System

MatrixValue() 공개 메소드

Constructs a new matrix based on the jagged double array.
public MatrixValue ( ScalarValue values, Int32 rows, Int32 cols ) : System
values ScalarValue The values to use.
rows System.Int32 The number of rows in the new matrix.
cols System.Int32 The number of columns in the matrix.
리턴 System

Max() 공개 메소드

Gets the index for the maximum entry in the matrix.
public Max ( ) : MatrixIndex
리턴 MatrixIndex

Min() 공개 메소드

Gets the index for the minimum entry in the matrix.
public Min ( ) : MatrixIndex
리턴 MatrixIndex

ModuloMS() 공개 정적인 메소드

Matrix % Scalar
public static ModuloMS ( Value left, Value right ) : MatrixValue
left Value Must be a matr.
right Value Must be a scalar.
리턴 MatrixValue

ModuloSM() 공개 정적인 메소드

Scalar % Matrix
public static ModuloSM ( Value left, Value right ) : MatrixValue
left Value Must be a scalar.
right Value Must be a matrix.
리턴 MatrixValue

MultiplyMM() 공개 정적인 메소드

Matrix * Matrix
public static MultiplyMM ( Value left, Value right ) : Value
left Value Must be a matrix.
right Value Must be a matrix.
리턴 Value

MultiplyMS() 공개 정적인 메소드

Matrix * Scalar
public static MultiplyMS ( Value left, Value right ) : MatrixValue
left Value Must be a matr.
right Value Must be a scalar.
리턴 MatrixValue

MultiplySM() 공개 정적인 메소드

Scalar * Matrix
public static MultiplySM ( Value left, Value right ) : MatrixValue
left Value Must be a scalar.
right Value Must be a matrix.
리턴 MatrixValue

One() 공개 정적인 메소드

Creates a new identity matrix of the given dimension.
public static One ( int dimension ) : MatrixValue
dimension int The rank of the identity matrix.
리턴 MatrixValue

One() 공개 정적인 메소드

Creates a new identity matrix of the given dimension.
public static One ( int rows, int columns ) : MatrixValue
rows int The number of rows of the identity matrix.
columns int The number of columns of the identity matrix.
리턴 MatrixValue

OneNorm() 공개 메소드

Computes the 1-norm of the matrix.

The 1-norm of a matrix is the largest column sum.

public OneNorm ( ) : double
리턴 double

Ones() 공개 정적인 메소드

Creates a matrix containing only ones.
public static Ones ( int rows, int cols ) : MatrixValue
rows int The number of rows in the new matrix.
cols int The number of columns in the new matrix.
리턴 MatrixValue

Perform() 공개 메소드

The method used by YAMP to get values from a matrix.
public Perform ( ParseContext context, Value argument ) : Value
context ParseContext The context where this is happening.
argument Value The 1-dim or 2-dim indices.
리턴 Value

Perform() 공개 메소드

Method used by YAMP to set values in a matrix.
public Perform ( ParseContext context, Value argument, Value values ) : Value
context ParseContext The context where this is happening.
argument Value The indices (1-dim or 2-dim).
values Value The value(s) to set.
리턴 Value

PowMS() 공개 정적인 메소드

Matrix ^ Scalar
public static PowMS ( Value basis, Value exponent ) : MatrixValue
basis Value Must be a matr.
exponent Value Must be a scalar.
리턴 MatrixValue

PowSM() 공개 정적인 메소드

Scalar ^ Matrix
public static PowSM ( Value basis, Value exponent ) : MatrixValue
basis Value Must be a scalar.
exponent Value Must be a matrix.
리턴 MatrixValue

Randomize() 공개 메소드

Goes over all rows and columns and randomizes the values.
public Randomize ( ) : void
리턴 void

RegisterOperators() 보호된 메소드

Registers all operators that are associated with the matrix.
protected RegisterOperators ( ) : void
리턴 void

Serialize() 공개 메소드

Serializes the current instance.
public Serialize ( ) : Byte[]
리턴 Byte[]

SetColumnVector() 공개 메소드

Sets the i-th column vector to be of the given matrix.
public SetColumnVector ( int i, MatrixValue m ) : MatrixValue
i int The index of the column to set the vector to.
m MatrixValue The matrix with values to set the i-th column to.
리턴 MatrixValue

SetRowVector() 공개 메소드

Sets the j-th row vector to be of the given matrix.
public SetRowVector ( int j, MatrixValue m ) : MatrixValue
j int The index of the row to set the vector to.
m MatrixValue The matrix with values to set the j-th row to.
리턴 MatrixValue

SubtractMM() 공개 정적인 메소드

Matrix - Matrix
public static SubtractMM ( Value left, Value right ) : Value
left Value Must be a matrix.
right Value Must be a matrix.
리턴 Value

SubtractMS() 공개 정적인 메소드

Matrix - Scalar
public static SubtractMS ( Value left, Value right ) : MatrixValue
left Value Must be a matrix.
right Value Must be a scalar.
리턴 MatrixValue

SubtractSM() 공개 정적인 메소드

Scalar - Matrix
public static SubtractSM ( Value left, Value right ) : MatrixValue
left Value Must be a scalar.
right Value Must be a matrix.
리턴 MatrixValue

Sum() 공개 메소드

Computes the sum of all entries.
public Sum ( ) : ScalarValue
리턴 ScalarValue

ToArray() 공개 메소드

Copies the internal scalar values to a 1-dim. complex array.
public ToArray ( ) : YAMP.ScalarValue[]
리턴 YAMP.ScalarValue[]

ToString() 공개 메소드

Creates a standard string representation of the matrix.
public ToString ( ParseContext context ) : String
context ParseContext The parse content.
리턴 String

ToString() 공개 메소드

Creates a standard string representation of the matrix.
public ToString ( ParseContext context, Int32 exponent ) : String
context ParseContext The parse content.
exponent System.Int32 The global exponent that is in use.
리턴 String

Trace() 공개 메소드

Computes the trace (sum over all elements on the diagonal) of the matrix.
public Trace ( ) : ScalarValue
리턴 ScalarValue

Transpose() 공개 메소드

Computes the transposed matrix.
public Transpose ( ) : MatrixValue
리턴 MatrixValue

VectorSort() 공개 메소드

Sorts the values of the matrix and outputs the values in a new vector.
public VectorSort ( ) : MatrixValue
리턴 MatrixValue

operator() 공개 정적인 메소드

Inequality.
public static operator ( ) : System.Boolean
리턴 System.Boolean

operator() 공개 정적인 메소드

Multiplication.
public static operator ( ) : MatrixValue
리턴 MatrixValue

this() 공개 메소드

Gets or sets the i-th element of the matrix (counted rows-first).
public this ( int i ) : ScalarValue
i int The 1-based index.
리턴 ScalarValue

this() 공개 메소드

Gets the element of the j-th row and i-th column.
public this ( int j, int i ) : ScalarValue
j int The 1-based row index.
i int The 1-based column index.
리턴 ScalarValue