Struct MatrixValue
- Namespace
 - xFunc.Maths.Expressions.Matrices
 
- Assembly
 - xFunc.Maths.dll
 
Represent the Matrix value.
public readonly struct MatrixValue : IEquatable<MatrixValue>
  - Implements
 
- Inherited Members
 
Properties
Columns
Gets the count of columns.
public int Columns { get; }
  Property Value
IsSquare
Gets a value indicating whether matrix is square.
public bool IsSquare { get; }
  Property Value
this[int]
Gets the VectorValue at the specified index.
public VectorValue this[int index] { get; }
  Parameters
indexintThe index.
Property Value
- VectorValue
 The VectorValue.
Rows
Gets the count of rows.
public int Rows { get; }
  Property Value
Methods
Add(MatrixValue, MatrixValue)
Adds the right matrix to the left matrix.
public static MatrixValue Add(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe left matrix.
rightMatrixValueThe right matrix.
Returns
- MatrixValue
 The sum of matrices.
Exceptions
- ArgumentException
 The size of matrices is invalid.
Create(VectorValue)
Creates a new instance of MatrixValue.
public static MatrixValue Create(VectorValue value)
  Parameters
valueVectorValueThe item of a new matrix.
Returns
- MatrixValue
 The matrix.
Create(VectorValue[])
Creates a new instance of MatrixValue.
public static MatrixValue Create(VectorValue[] vectors)
  Parameters
vectorsVectorValue[]The array.
Returns
- MatrixValue
 The matrix.
Create(NumberValue)
Creates a new instance of MatrixValue.
public static MatrixValue Create(NumberValue value)
  Parameters
valueNumberValueThe item of a new matrix.
Returns
- MatrixValue
 The matrix.
Create(NumberValue[][])
Creates a new instance of MatrixValue.
public static MatrixValue Create(NumberValue[][] values)
  Parameters
valuesNumberValue[][]The array.
Returns
- MatrixValue
 The matrix.
Determinant(MatrixValue)
Calculates a determinant of specified matrix.
public static NumberValue Determinant(MatrixValue matrix)
  Parameters
matrixMatrixValueThe matrix.
Returns
- NumberValue
 The determinant of matrix.
Exceptions
- ArgumentException
 The size of matrices is invalid.
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
  Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
 true if
objand this instance are the same type and represent the same value; otherwise, false.
Equals(MatrixValue)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MatrixValue other)
  Parameters
otherMatrixValueAn object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
[ExcludeFromCodeCoverage]
public override int GetHashCode()
  Returns
- int
 A 32-bit signed integer that is the hash code for this instance.
Inverse(MatrixValue)
Inverts a matrix.
public static MatrixValue Inverse(MatrixValue matrix)
  Parameters
matrixMatrixValueThe matrix.
Returns
- MatrixValue
 An inverse matrix.
Mul(MatrixValue, MatrixValue)
Multiplies the left matrix by the right matrix.
public static MatrixValue Mul(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe left matrix.
rightMatrixValueThe right matrix.
Returns
- MatrixValue
 The product of matrices.
Exceptions
- ArgumentException
 The size of matrices is invalid.
Mul(MatrixValue, VectorValue)
Multiplies the left matrix by the right vector.
public static MatrixValue Mul(MatrixValue left, VectorValue right)
  Parameters
leftMatrixValueThe left matrix.
rightVectorValueThe right vector.
Returns
- MatrixValue
 The product of matrices.
Exceptions
- ArgumentException
 The size of matrices is invalid.
Mul(MatrixValue, NumberValue)
Multiplies matrix by number.
public static MatrixValue Mul(MatrixValue matrix, NumberValue number)
  Parameters
matrixMatrixValueThe matrix.
numberNumberValueThe number.
Returns
- MatrixValue
 The product of matrix and number.
Mul(VectorValue, MatrixValue)
Multiplies the left vector by the right matrix.
public static MatrixValue Mul(VectorValue left, MatrixValue right)
  Parameters
leftVectorValueThe left vector.
rightMatrixValueThe right matrix.
Returns
- MatrixValue
 The product of matrices.
Exceptions
- ArgumentException
 The size of matrices is invalid.
Sub(MatrixValue, MatrixValue)
Subtracts the right matrix from the left matrix.
public static MatrixValue Sub(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe left matrix.
rightMatrixValueThe right matrix.
Returns
- MatrixValue
 The difference of matrices.
Exceptions
- ArgumentException
 The size of matrices is invalid.
ToArray()
Converts the current matrix to a two dimensional array.
public NumberValue[][] ToArray()
  Returns
- NumberValue[][]
 The array.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
  Returns
- string
 The fully qualified type name.
Transpose(MatrixValue)
Transposes the specified matrix.
public static MatrixValue Transpose(MatrixValue matrix)
  Parameters
matrixMatrixValueThe matrix.
Returns
- MatrixValue
 The transposed matrix.
Operators
operator +(MatrixValue, MatrixValue)
Adds two objects of MatrixValue.
public static MatrixValue operator +(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe first object to add.
rightMatrixValueThe second object to add.
Returns
- MatrixValue
 An object that is the sum of
leftandright.
operator ==(MatrixValue, MatrixValue)
Determines whether two specified instances of MatrixValue are equal.
public static bool operator ==(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe first object to compare.
rightMatrixValueThe second object to compare.
Returns
- bool
 trueifleftis equal toright; otherwise,false.
operator !=(MatrixValue, MatrixValue)
Determines whether two specified instances of MatrixValue are not equal.
public static bool operator !=(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe first object to compare.
rightMatrixValueThe second object to compare.
Returns
- bool
 trueifleftis not equal toright; otherwise,false.
operator *(MatrixValue, MatrixValue)
Multiplies two objects of MatrixValue.
public static MatrixValue operator *(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe first object to multiply.
rightMatrixValueThe second object to multiply.
Returns
- MatrixValue
 An object that is the product of
leftandright.
operator *(MatrixValue, VectorValue)
Multiplies MatrixValue and VectorValue.
public static MatrixValue operator *(MatrixValue left, VectorValue right)
  Parameters
leftMatrixValueThe first object to multiply.
rightVectorValueThe second object to multiply.
Returns
- MatrixValue
 An object that is the product of
leftandright.
operator *(MatrixValue, NumberValue)
Multiplies MatrixValue and NumberValue.
public static MatrixValue operator *(MatrixValue left, NumberValue right)
  Parameters
leftMatrixValueThe first object to multiply.
rightNumberValueThe second object to multiply.
Returns
- MatrixValue
 An object that is the product of
leftandright.
operator *(VectorValue, MatrixValue)
Multiplies VectorValue and MatrixValue.
public static MatrixValue operator *(VectorValue left, MatrixValue right)
  Parameters
leftVectorValueThe first object to multiply.
rightMatrixValueThe second object to multiply.
Returns
- MatrixValue
 An object that is the product of
leftandright.
operator -(MatrixValue, MatrixValue)
Subtracts two objects of MatrixValue.
public static MatrixValue operator -(MatrixValue left, MatrixValue right)
  Parameters
leftMatrixValueThe first object to sub.
rightMatrixValueThe second object to sub.
Returns
- MatrixValue
 An object that is the difference of
leftandright.