Table of Contents

Struct Matrix

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents a matrix or table of numbers, within a fixed size of rows and columns.


public readonly struct Matrix : IEnumerable<double>, IEnumerable
Implements

Constructors

Matrix()

Creates a zero-initialized matrix.

public Matrix()

Matrix(in Matrix)

Creates a deep-copy from another matrix.

public Matrix(in Matrix a)

Parameters

a Matrix

Matrix(double[][])

Creates and initializes all matrix values.

public Matrix(double[][] values)

Parameters

values double[][]

Matrix(int, int)

Creates a matrix with the specified size.

public Matrix(int r, int c)

Parameters

r int
c int

Matrix(uint, uint)

Creates a matrix with the specified size.

public Matrix(uint r, uint c)

Parameters

r uint
c uint

Fields

Cols

The total number of columns.

public readonly uint Cols

Field Value

uint

Rows

The total number of rows.

public readonly uint Rows

Field Value

uint

Properties

Determinant

A number representing the determinant of a square matrix.

public double Determinant { get; }

Property Value

double

Inverse

Returns the inverse of the current matrix.

public Matrix Inverse { get; }

Property Value

Matrix

this[int, int]

public double this[int r, int c] { get; set; }

Parameters

r int
c int

Property Value

double

this[uint, uint]

public double this[uint r, uint c] { get; set; }

Parameters

r uint
c uint

Property Value

double

Size

The total number of elements.

public uint Size { get; }

Property Value

uint

Transpose

A matrix representing the transposition/flip of all matrix values by it's diagonal.

public Matrix Transpose { get; }

Property Value

Matrix

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(object, in double)

public bool Equals(object obj, in double precision)

Parameters

obj object

The object to compare.

precision double

The precision error.

Returns

bool

GetEnumerator()

public IEnumerator<double> GetEnumerator()

Returns

IEnumerator<double>

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

ToString(string)

public string ToString(string fmt)

Parameters

fmt string

A numeric format string.

Returns

string

Operators

operator +(in Matrix, in Matrix)

Returns the addition of a matrix with another matrix.

public static Matrix operator +(in Matrix a, in Matrix b)

Parameters

a Matrix
b Matrix

Returns

Matrix

operator +(in Matrix, in double)

Returns the addition of a matrix with a number.

public static Matrix operator +(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

Matrix

operator +(in double, in Matrix)

Returns the addition of a number with a matrix.

public static Matrix operator +(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

Matrix

operator /(in Matrix, in double)

Returns the division of a matrix with a number.

public static Matrix operator /(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

Matrix

operator /(in double, in Matrix)

Returns the division of a number with a matrix.

public static Matrix operator /(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

Matrix

operator ==(in Matrix, in Matrix)

Returns true if all values in a matrix are equal to another matrix.

public static bool operator ==(in Matrix a, in Matrix b)

Parameters

a Matrix
b Matrix

Returns

bool

operator ==(in Matrix, in double)

Returns true if all values in a matrix are equal to a number.

public static bool operator ==(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator ==(in double, in Matrix)

Returns true if a number is equal to all values in a matrix.

public static bool operator ==(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

explicit operator Matrix(Matrix2)

Returns the explicit conversion of a 'Matrix2' to a 'Matrix'

public static explicit operator Matrix(Matrix2 a)

Parameters

a Matrix2

Returns

Matrix

explicit operator Matrix(Matrix3)

Returns the explicit conversion of a 'Matrix3' to a 'Matrix'

public static explicit operator Matrix(Matrix3 a)

Parameters

a Matrix3

Returns

Matrix

explicit operator Matrix(Matrix4)

Returns the explicit conversion of a 'Matrix4' to a 'Matrix'

public static explicit operator Matrix(Matrix4 a)

Parameters

a Matrix4

Returns

Matrix

operator >(in Matrix, in double)

Returns true if all values in a matrix are greater than a number.

public static bool operator >(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator >(in double, in Matrix)

Returns true if a number is greater than all values in a matrix.

public static bool operator >(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

operator >=(in Matrix, in double)

Returns true if all values in a matrix are greater than or equal to a number.

public static bool operator >=(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator >=(in double, in Matrix)

Returns true if a number is greater than or equal to all values in a matrix.

public static bool operator >=(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

operator !=(in Matrix, in Matrix)

Returns true if all values in a matrix are not equal to another matrix.

public static bool operator !=(in Matrix a, in Matrix b)

Parameters

a Matrix
b Matrix

Returns

bool

operator !=(in Matrix, in double)

Returns true if all values in a matrix are not equal to a number.

public static bool operator !=(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator !=(in double, in Matrix)

Returns true if a number is not equal to all values in a matrix.

public static bool operator !=(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

operator <(in Matrix, in double)

Returns true if all values in a matrix are less than a number.

public static bool operator <(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator <(in double, in Matrix)

Returns true if a number is less than all values in a matrix.

public static bool operator <(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

operator <=(in Matrix, in double)

Returns true if all values in a matrix are less than or equal to a number.

public static bool operator <=(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

bool

operator <=(in double, in Matrix)

Returns true if a number is less than or equal to all values in a matrix.

public static bool operator <=(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

bool

operator *(in Matrix, in Matrix)

Returns the multiplication of a matrix with another matrix.

public static Matrix operator *(in Matrix a, in Matrix b)

Parameters

a Matrix
b Matrix

Returns

Matrix

operator *(in Matrix, in Vector)

Returns the multiplication of a matrix with a column vector.

public static Vector operator *(in Matrix a, in Vector b)

Parameters

a Matrix
b Vector

Returns

Vector

operator *(in Matrix, in double)

Returns the multiplication of a matrix with a number.

public static Matrix operator *(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

Matrix

operator *(in Vector, in Matrix)

Returns the multiplication of a row vector with a matrix.

public static Vector operator *(in Vector a, in Matrix b)

Parameters

a Vector
b Matrix

Returns

Vector

operator *(in double, in Matrix)

Returns the multiplication of a number with a matrix.

public static Matrix operator *(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

Matrix

operator -(in Matrix, in Matrix)

Returns the subtraction of a matrix with another matrix.

public static Matrix operator -(in Matrix a, in Matrix b)

Parameters

a Matrix
b Matrix

Returns

Matrix

operator -(in Matrix, in double)

Returns the subtraction of a matrix with a number.

public static Matrix operator -(in Matrix a, in double b)

Parameters

a Matrix
b double

Returns

Matrix

operator -(in double, in Matrix)

Returns the subtraction of a number with a matrix.

public static Matrix operator -(in double a, in Matrix b)

Parameters

a double
b Matrix

Returns

Matrix

operator -(in Matrix)

Returns the negation of all values in a matrix.

public static Matrix operator -(in Matrix a)

Parameters

a Matrix

Returns

Matrix