Table of Contents

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

int

IsSquare

Gets a value indicating whether matrix is square.

public bool IsSquare { get; }

Property Value

bool

this[int]

Gets the VectorValue at the specified index.

public VectorValue this[int index] { get; }

Parameters

index int

The index.

Property Value

VectorValue

The VectorValue.

Rows

Gets the count of rows.

public int Rows { get; }

Property Value

int

Methods

Add(MatrixValue, MatrixValue)

Adds the right matrix to the left matrix.

public static MatrixValue Add(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The left matrix.

right MatrixValue

The 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

value VectorValue

The item of a new matrix.

Returns

MatrixValue

The matrix.

Create(VectorValue[])

Creates a new instance of MatrixValue.

public static MatrixValue Create(VectorValue[] vectors)

Parameters

vectors VectorValue[]

The array.

Returns

MatrixValue

The matrix.

Create(NumberValue)

Creates a new instance of MatrixValue.

public static MatrixValue Create(NumberValue value)

Parameters

value NumberValue

The item of a new matrix.

Returns

MatrixValue

The matrix.

Create(NumberValue[][])

Creates a new instance of MatrixValue.

public static MatrixValue Create(NumberValue[][] values)

Parameters

values NumberValue[][]

The array.

Returns

MatrixValue

The matrix.

Determinant(MatrixValue)

Calculates a determinant of specified matrix.

public static NumberValue Determinant(MatrixValue matrix)

Parameters

matrix MatrixValue

The 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

obj object

The object to compare with the current instance.

Returns

bool

true if obj and 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

other MatrixValue

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Returns the hash code for this instance.

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

matrix MatrixValue

The 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

left MatrixValue

The left matrix.

right MatrixValue

The 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

left MatrixValue

The left matrix.

right VectorValue

The 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

matrix MatrixValue

The matrix.

number NumberValue

The 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

left VectorValue

The left vector.

right MatrixValue

The 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

left MatrixValue

The left matrix.

right MatrixValue

The 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

matrix MatrixValue

The matrix.

Returns

MatrixValue

The transposed matrix.

Operators

operator +(MatrixValue, MatrixValue)

Adds two objects of MatrixValue.

public static MatrixValue operator +(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The first object to add.

right MatrixValue

The second object to add.

Returns

MatrixValue

An object that is the sum of left and right.

operator ==(MatrixValue, MatrixValue)

Determines whether two specified instances of MatrixValue are equal.

public static bool operator ==(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The first object to compare.

right MatrixValue

The second object to compare.

Returns

bool

true if left is equal to right; otherwise, false.

operator !=(MatrixValue, MatrixValue)

Determines whether two specified instances of MatrixValue are not equal.

public static bool operator !=(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The first object to compare.

right MatrixValue

The second object to compare.

Returns

bool

true if left is not equal to right; otherwise, false.

operator *(MatrixValue, MatrixValue)

Multiplies two objects of MatrixValue.

public static MatrixValue operator *(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The first object to multiply.

right MatrixValue

The second object to multiply.

Returns

MatrixValue

An object that is the product of left and right.

operator *(MatrixValue, VectorValue)

Multiplies MatrixValue and VectorValue.

public static MatrixValue operator *(MatrixValue left, VectorValue right)

Parameters

left MatrixValue

The first object to multiply.

right VectorValue

The second object to multiply.

Returns

MatrixValue

An object that is the product of left and right.

operator *(MatrixValue, NumberValue)

Multiplies MatrixValue and NumberValue.

public static MatrixValue operator *(MatrixValue left, NumberValue right)

Parameters

left MatrixValue

The first object to multiply.

right NumberValue

The second object to multiply.

Returns

MatrixValue

An object that is the product of left and right.

operator *(VectorValue, MatrixValue)

Multiplies VectorValue and MatrixValue.

public static MatrixValue operator *(VectorValue left, MatrixValue right)

Parameters

left VectorValue

The first object to multiply.

right MatrixValue

The second object to multiply.

Returns

MatrixValue

An object that is the product of left and right.

operator -(MatrixValue, MatrixValue)

Subtracts two objects of MatrixValue.

public static MatrixValue operator -(MatrixValue left, MatrixValue right)

Parameters

left MatrixValue

The first object to sub.

right MatrixValue

The second object to sub.

Returns

MatrixValue

An object that is the difference of left and right.