Table of Contents

Class Matrix2x2C

Namespace
VirtualLabAPI.Core.Numerics
Assembly
VirtualLabAPI.dll

A 2 × 2 matrix with complex-valued entries.

[Serializable]
public class Matrix2x2C : SerializableObjectBase, IEquatable<IObjectBase>, ICloneable
Inheritance
ObjectBase
SerializableObjectBase
Matrix2x2C
Implements
IEquatable<IObjectBase>
Inherited Members

Constructors

Matrix2x2C()

Constructor which creates an empty (all zero values) 2×2 matrix.

public Matrix2x2C()

Matrix2x2C(Complex)

Constructor for a diagonal matrix with a constant on the diagonal.

public Matrix2x2C(Complex c)

Parameters

c Complex

Constant diagonal value.

Matrix2x2C(Complex, Complex, Complex, Complex)

Initialize Matrix2x2C with 4 complex values.

public Matrix2x2C(Complex a11, Complex a12, Complex a21, Complex a22)

Parameters

a11 Complex

Matrix entry 11 in a 2×2 matrix: {{11,12},{21,22}}.

a12 Complex

Matrix entry 12 in a 2×2 matrix: {{11,12},{21,22}}.

a21 Complex

Matrix entry 21 in a 2×2 matrix: {{11,12},{21,22}}.

a22 Complex

Matrix entry 22 in a 2×2 matrix: {{11,12},{21,22}}.

Matrix2x2C(Matrix2x2C)

Copy constructor.

public Matrix2x2C(Matrix2x2C matC)

Parameters

matC Matrix2x2C

Matrix2x2C to be copied.

Properties

IsUndefined

Gets whether a least one component of the matrix is undefined.

public bool IsUndefined { get; }

Property Value

bool

true if at least one component of the vector is NaN.

MEntry11

Matrix entry 11 in a 2×2 matrix: {{11,12},{21,22}}.

public Complex MEntry11 { get; set; }

Property Value

Complex

MEntry12

Matrix entry 21 in a 2×2 matrix: {{11,12},{21,22}}.

public Complex MEntry12 { get; set; }

Property Value

Complex

MEntry21

Matrix entry 12 in a 2×2 matrix: {{11,12},{21,22}}.

public Complex MEntry21 { get; set; }

Property Value

Complex

MEntry22

Matrix entry 22 in a 2×2 matrix: {{11,12},{21,22}}.

public Complex MEntry22 { get; set; }

Property Value

Complex

Methods

Clone()

Creates a new object that is a copy of the current instance.

public override object Clone()

Returns

object

A new object that is a copy of this instance.

Determinant()

Calculates the determinant of the given Matrix2x2C-object.

public Complex Determinant()

Returns

Complex

Determinant of this matrix

Equals(object, EqualityIntent)

Determines whether the specified object is equal to this instance.

public override bool Equals(object otherObject, EqualityIntent equalityIntent)

Parameters

otherObject object

The object to compare with this instance.

equalityIntent EqualityIntent

Defines what kind of equality you want to check when comparing two objects, for example all values or physical equality.

Returns

bool

true if the specified object is equal to this instance; otherwise, false.

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 matrix.

public Matrix2x2C GetInverse()

Returns

Matrix2x2C

The inverse matrix of this matrix.

InverseMatrix2x2C(Matrix2x2C)

Inverts the given matrix.

public static Matrix2x2C InverseMatrix2x2C(Matrix2x2C mat)

Parameters

mat Matrix2x2C

Returns

Matrix2x2C

The inverse matrix.

IsEveryEntryZero()

Tests if every entry of the matrix is 0.

public bool IsEveryEntryZero()

Returns

bool

true if every entry of the matrix is 0, otherwise false.

IsHermitian()

Is the matrix Hermitian (self-adjoint), i.e. is it a square matrix which is equal to its own conjugate transpose (adjoint)?

public bool IsHermitian()

Returns

bool

true if matrix is Hermitian.

IsUnitary()

Is the matrix unitary, i.e. has it an inverse which is equal to its conjugate transpose (adjoint)?

public bool IsUnitary()

Returns

bool

true if matrix is unitary.

ToString()

Returns matrix as string.

public override string ToString()

Returns

string

matrix as string

ToString(int)

Gets a string representing this instance.

public string ToString(int numberOfSignificantDigits)

Parameters

numberOfSignificantDigits int

The number of digits used for formatting of the floating point numbers.

Returns

string

The formatted value.

isAnyEntryNull()

Tests if any entry of the matrix is null.

public bool isAnyEntryNull()

Returns

bool

false if any entry of the matrix is null, otherwise true.

Operators

operator +(Matrix2x2C, Matrix2x2C)

Adds the elements of two Matrix2x2C objects.

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

Parameters

a Matrix2x2C

The first matrix.

b Matrix2x2C

The second matrix.

Returns

Matrix2x2C

The sum of the two matrices.

operator ==(Matrix2x2C, Matrix2x2C)

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

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

Parameters

a Matrix2x2C

The first matrix.

b Matrix2x2C

The second matrix.

Returns

bool

true if they are equal, otherwise false.

implicit operator Matrix2x2C(Matrix2x2D)

Performs an implicit conversion from Matrix2x2D to Matrix2x2C.

public static implicit operator Matrix2x2C(Matrix2x2D doubleMatrix)

Parameters

doubleMatrix Matrix2x2D

The double matrix.

Returns

Matrix2x2C

The result of the conversion.

operator !=(Matrix2x2C, Matrix2x2C)

Checks to matrices for inequality.

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

Parameters

a Matrix2x2C

first matrix

b Matrix2x2C

second matrix

Returns

bool

false if they are equal, otherwise true.

operator *(Complex, Matrix2x2C)

Multiplies a scalar with a Matrix2x2C.

public static Matrix2x2C operator *(Complex b, Matrix2x2C a)

Parameters

b Complex

scalar

a Matrix2x2C

Matrix

Returns

Matrix2x2C

The product.

operator *(Matrix2x2C, Complex)

Multiplies a Matrix2x2C with a scalar.

public static Matrix2x2C operator *(Matrix2x2C a, Complex b)

Parameters

a Matrix2x2C

The matrix.

b Complex

The scalar.

Returns

Matrix2x2C

The product.

operator *(Matrix2x2C, Matrix2x2C)

Multiplies two Matrix2x2C objects.

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

Parameters

a Matrix2x2C

The first matrix.

b Matrix2x2C

The second matrix.

Returns

Matrix2x2C

The matrix product of the two matrices.

operator *(Matrix2x2C, Matrix2x2D)

Multiplies the elements of a Matrix2x2C and a Matrix2x2D object.

public static Matrix2x2C operator *(Matrix2x2C a, Matrix2x2D b)

Parameters

a Matrix2x2C

The first matrix.

b Matrix2x2D

The second matrix.

Returns

Matrix2x2C

The product of the two matrices.

operator *(Matrix2x2C, VectorC)

Multiplies a Matrix with a 2-dimensional Vector (AVec). Important: This is not identical to VecA!

public static VectorC operator *(Matrix2x2C a, VectorC vec)

Parameters

a Matrix2x2C

2×2 matrix.

vec VectorC

Vector

Returns

VectorC

The resulting vector.

operator *(Matrix2x2D, Matrix2x2C)

Multiplies the elements of a Matrix2x2D and a Matrix2x2C object.

public static Matrix2x2C operator *(Matrix2x2D a, Matrix2x2C b)

Parameters

a Matrix2x2D

The first matrix.

b Matrix2x2C

The second matrix.

Returns

Matrix2x2C

The product of the two matrices.

operator -(Matrix2x2C, Matrix2x2C)

Subtracts the elements of two Matrix2x2C objects.

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

Parameters

a Matrix2x2C

The first matrix.

b Matrix2x2C

The second matrix.

Returns

Matrix2x2C

The difference of the two matrices.