Table of Contents

Class Matrix3x3C

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

This class defines a 3x3 Matrix of complex numbers.
Operators (\(a+b\), \(a-b\)). Operator (\(a*b\)) supports \(b\) as complex or Vector3C as well.

[Serializable]
public class Matrix3x3C
Inheritance
Matrix3x3C
Inherited Members

Constructors

Matrix3x3C()

Standard constructor, creates an empty (all zero values) matrix.

public Matrix3x3C()

Matrix3x3C(Complex)

Constructor to get a diagonal matrix having constant value \(c\) on all diagonal elements.

public Matrix3x3C(Complex c)

Parameters

c Complex

Value \(c\) used to initialize diagonal elements.

Matrix3x3C(Complex, Complex, Complex, Complex, Complex, Complex, Complex, Complex, Complex)

Constructor taking nine complex values to initialize a Matrix3x3C.

public Matrix3x3C(Complex m11, Complex m21, Complex m31, Complex m12, Complex m22, Complex m32, Complex m13, Complex m23, Complex m33)

Parameters

m11 Complex

First element of first column.

m21 Complex

Second element of first column.

m31 Complex

Third element of first column.

m12 Complex

First element of second column.

m22 Complex

Second element of second column.

m32 Complex

Third element of second column.

m13 Complex

First element of third column.

m23 Complex

Second element of third column.

m33 Complex

Third element of third column.

Matrix3x3C(Matrix3x3C)

Copy constructor.

public Matrix3x3C(Matrix3x3C matC)

Parameters

matC Matrix3x3C

Matrix3x3C to be copied.

Matrix3x3C(Vector3C, Vector3C, Vector3C)

Constructor taking three Vector3C to initialize the Matrix3x3C.

public Matrix3x3C(Vector3C firstCol, Vector3C secondCol, Vector3C thirdCol)

Parameters

firstCol Vector3C

First column.

secondCol Vector3C

Second column.

thirdCol Vector3C

Third column.

Fields

_elements

The field in which the complex elements are stored. Note that indices [1..9] are interpreted mathematical. [0] exists but contains no information. Mapping of rows [1..3] and columns [1..3] to one-dimensional index \(i\) is defined by: \(i := row + 3 * (column-1)\).

public Complex[] _elements

Field Value

Complex[]

Properties

this[int, int]

Gets or sets a certain matrix element.

public Complex this[int row, int col] { get; set; }

Parameters

row int

The zero-based row index.

col int

The zero-based column index.

Property Value

Complex

The selected matrix element.

Exceptions

ArgumentOutOfRangeException

At least one of the two given indices is out of range.

Methods

Determinant()

Calculates the determinant of this matrix.

public Complex Determinant()

Returns

Complex

The determinant of this matrix.

Equals(object)

Compares two matrices for equality.

public override bool Equals(object matrix)

Parameters

matrix object

Matrix to compare with.

Returns

bool

True if the two matrices store the same values.

GetCol(int)

Returns the specified column of this Matrix3x3C as Vector3C.

public Vector3C GetCol(int index)

Parameters

index int

Column to return (index is one-based!).

Returns

Vector3C

Result of operation.

GetHashCode()

Returns a hash code for this instance.

public override int GetHashCode()

Returns

int

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

GetInverse()

Calculates the inverse matrix of this one.

public Matrix3x3C GetInverse()

Returns

Matrix3x3C

Result of operation.

InverseMatrix(Matrix3x3C)

Calculates inverse matrix of the given matrix.

public static Matrix3x3C InverseMatrix(Matrix3x3C mat)

Parameters

mat Matrix3x3C

Matrix3x3C to invert.

Returns

Matrix3x3C

Result of operation.

ToString()

Returns an output string representing this matrix.

public override string ToString()

Returns

string

A string representing this matrix.

Operators

operator +(Matrix3x3C, Matrix3x3C)

Adds the elements of two Matrix3x3C objects.

public static Matrix3x3C operator +(Matrix3x3C a, Matrix3x3C b)

Parameters

a Matrix3x3C

the first matrix

b Matrix3x3C

the second matrix

Returns

Matrix3x3C

The sum of the two matrices.

operator ==(Matrix3x3C, Matrix3x3C)

Compares two matrices. Two matrices are equal when they are equal in all elements.

public static bool operator ==(Matrix3x3C a, Matrix3x3C b)

Parameters

a Matrix3x3C

first matrix

b Matrix3x3C

second matrix

Returns

bool

true if they are equal, otherwise false.

operator !=(Matrix3x3C, Matrix3x3C)

Checks two matrices for inequality.

public static bool operator !=(Matrix3x3C a, Matrix3x3C b)

Parameters

a Matrix3x3C

first matrix

b Matrix3x3C

second matrix

Returns

bool

false if they are equal, otherwise true.

operator *(double, Matrix3x3C)

Multiplies a Matrix3x3C with a scalar.

public static Matrix3x3C operator *(double b, Matrix3x3C a)

Parameters

b double

scalar

a Matrix3x3C

matrix

Returns

Matrix3x3C

Result of operation.

operator *(Matrix3x3C, double)

Multiplies a Matrix3x3C with a scalar.

public static Matrix3x3C operator *(Matrix3x3C a, double b)

Parameters

a Matrix3x3C

matrix

b double

scalar

Returns

Matrix3x3C

Result of operation.

operator *(Matrix3x3C, Matrix3x3C)

Multiplies the elements of two Matrix3x3C objects.

public static Matrix3x3C operator *(Matrix3x3C a, Matrix3x3C b)

Parameters

a Matrix3x3C

the first matrix

b Matrix3x3C

the second matrix

Returns

Matrix3x3C

The product of the two matrices.

operator *(Matrix3x3C, Matrix3x3D)

Multiplies the elements of two 3x3 matrices.

public static Matrix3x3C operator *(Matrix3x3C a, Matrix3x3D b)

Parameters

a Matrix3x3C

the first matrix

b Matrix3x3D

the second matrix

Returns

Matrix3x3C

The product of the two matrices.

operator *(Matrix3x3C, Vector3C)

Multiplies a Matrix with an 3-dimensional complex Vector (A*Vec).

public static Vector3C operator *(Matrix3x3C a, Vector3C vec)

Parameters

a Matrix3x3C

3x3-Matrix

vec Vector3C

A complex vector.

Returns

Vector3C

Result of operation.

operator *(Matrix3x3D, Matrix3x3C)

Multiplies the elements of two 3x3 matrices objects.

public static Matrix3x3C operator *(Matrix3x3D a, Matrix3x3C b)

Parameters

a Matrix3x3D

the first matrix

b Matrix3x3C

the second matrix

Returns

Matrix3x3C

The product of the two matrices.

operator -(Matrix3x3C, Matrix3x3C)

Subtracts the elements of two Matrix3x3C objects.

public static Matrix3x3C operator -(Matrix3x3C a, Matrix3x3C b)

Parameters

a Matrix3x3C

the first matrix

b Matrix3x3C

the second matrix

Returns

Matrix3x3C

The Difference of the two matrices.