Table of Contents

Enum MatrixType

Namespace
AiDotNet.Enums
Assembly
AiDotNet.dll

Defines the different types of matrices that can be used in mathematical operations.

public enum MatrixType

Fields

Adjacency = 29

A matrix that represents connections in a graph or network.

For Beginners: An adjacency matrix represents connections in a network or graph. If element (i,j) is 1, it means there's a connection from node i to node j. These matrices are used in social networks, transportation systems, and computer networks to show how elements are connected.

Band = 14

A matrix with non-zero elements only on a band centered on the main diagonal.

For Beginners: A band matrix has non-zero values only within a certain "band" around the diagonal, with zeros everywhere else. It's a generalization of tridiagonal matrices to include more diagonals.

Example of a band matrix with bandwidth 2: [5 8 2 0 0] [1 6 9 3 0] [0 2 7 1 4] [0 0 3 8 2] [0 0 0 4 9]

Block = 35

A matrix divided into submatrices (blocks) that are treated as single elements.

For Beginners: A block matrix is divided into rectangular sections called blocks or submatrices. This structure makes it easier to work with large matrices by treating each block as a single element. Block matrices are useful in parallel computing and when dealing with matrices that have a natural block structure.

Cauchy = 42

A matrix where each element is 1 divided by the sum of two values from separate arrays.

For Beginners: A Cauchy matrix is formed from two sets of numbers [x1, x2, ...] and [y1, y2, ...]. Each element (i,j) equals 1/(x? + y?). These matrices appear in interpolation problems and numerical analysis.

Example: If x = [1, 2, 3] and y = [4, 5, 6], the Cauchy matrix would be: [1/5 1/6 1/7 ] [1/6 1/7 1/8 ] [1/7 1/8 1/9 ]

Circulant = 34

A special Toeplitz matrix where each row is a cyclic shift of the row above it.

For Beginners: A circulant matrix is created by taking the first row and shifting it to the right in each subsequent row. It's like a circular pattern where elements wrap around. These matrices are used in signal processing, especially in dealing with periodic signals.

Example: [a b c d] [d a b c] [c d a b] [b c d a]

Companion = 39

A special matrix used in polynomial calculations and control theory.

For Beginners: A companion matrix is a special form that represents a polynomial in matrix form. It's used to find polynomial roots and in control systems. The matrix has a specific pattern with 1s along the first subdiagonal and the coefficients of a polynomial in the last column.

Example for polynomial x³ + 4x² + 5x + 2: [0 0 -2] [1 0 -5] [0 1 -4]

Dense = 37

A matrix where most elements are non-zero.

For Beginners: A dense matrix has most of its elements filled with non-zero values. Unlike sparse matrices, dense matrices don't have a special storage format since most elements need to be stored anyway. These matrices typically represent fully connected systems or relationships.

Diagonal = 2

A matrix where all non-diagonal elements are zero.

For Beginners: A diagonal matrix has numbers only along the diagonal from top-left to bottom-right, with zeros everywhere else.

Example: [5 0 0] [0 7 0] [0 0 2]

DoublyStochastic = 27

A matrix where all elements are non-negative and both rows and columns sum to 1.

For Beginners: A doubly stochastic matrix has non-negative entries where both every row and every column sum to 1. These matrices are used in assignment problems and represent balanced distributions.

Hankel = 33

A matrix where each anti-diagonal (running from bottom-left to top-right) has constant values.

For Beginners: A Hankel matrix has constant values along anti-diagonals (diagonals that run from bottom-left to top-right). These matrices appear in control theory and signal processing applications.

Example: [a b c d] [b c d e] [c d e f] [d e f g]

Hermitian = 15

A complex square matrix that equals its own conjugate transpose.

For Beginners: A Hermitian matrix is the complex number equivalent of a symmetric matrix. For real matrices, Hermitian and symmetric are the same thing. For complex matrices, the elements across the diagonal are complex conjugates of each other (same real part, opposite imaginary part).

If position (row 1, column 2) has value 3+4i, then position (row 2, column 1) has value 3-4i.

Hilbert = 41

A special matrix where each element is 1 divided by the sum of its row and column indices.

For Beginners: A Hilbert matrix has elements defined by the formula 1/(i+j-1), where i is the row number and j is the column number. For example, a 3×3 Hilbert matrix looks like: [1 1/2 1/3] [1/2 1/3 1/4] [1/3 1/4 1/5] These matrices are famous for being "ill-conditioned," which means small changes in input can cause large changes in output, making them challenging for numerical calculations.

Idempotent = 24

A matrix that, when multiplied by itself, gives the same matrix.

For Beginners: An idempotent matrix has the property that multiplying it by itself gives the same matrix. That is, A² = A. This is like a light switch that's already on - flipping it again doesn't change anything. Projection matrices are examples of idempotent matrices.

Identity = 3

A diagonal matrix where all diagonal elements are 1.

For Beginners: An identity matrix is a special diagonal matrix with 1s along the diagonal and 0s everywhere else. It works like the number 1 in multiplication - multiplying any matrix by the identity matrix leaves it unchanged.

Example: [1 0 0] [0 1 0] [0 0 1]

Incidence = 30

A matrix that shows relationships between two types of objects in a graph.

For Beginners: An incidence matrix shows how objects of one type (like people) relate to objects of another type (like events). In graph theory, it shows how edges connect to vertices. For example, if row i has a 1 in column j, it means vertex i is connected to edge j.

Involutory = 25

A matrix that, when multiplied by itself, gives the identity matrix.

For Beginners: An involutory matrix is its own inverse. When you multiply it by itself, you get the identity matrix. It's like applying a transformation and then applying it again to get back to where you started. Reflection matrices are common examples.

Laplacian = 31

A matrix that represents a graph's connectivity and is used in spectral graph theory.

For Beginners: A Laplacian matrix combines information about connections and degrees (number of connections) in a graph. It's used to find important properties of networks, like how well-connected they are or how information flows through them. These matrices are used in image processing, clustering, and network analysis.

LowerBidiagonal = 12

A matrix with non-zero elements only on the main diagonal and the diagonal below it.

For Beginners: A lower bidiagonal matrix has values only on the main diagonal and the diagonal immediately below it, with zeros everywhere else.

Example: [4 0 0] [7 2 0] [0 5 9]

LowerTriangular = 7

A matrix where all elements above the main diagonal are zero.

For Beginners: A lower triangular matrix has values on or below the diagonal, with all values above the diagonal being zero. It forms a triangle shape in the lower part of the matrix.

Example: [4 0 0] [2 7 0] [1 3 5]

NonSingular = 20

A square matrix that has an inverse.

For Beginners: A non-singular matrix can be inverted (has an inverse). This means any transformation performed by this matrix can be undone. It's like being able to trace your steps backward after a journey. Non-singular matrices have non-zero determinants.

Orthogonal = 17

A real square matrix whose transpose equals its inverse.

For Beginners: An orthogonal matrix preserves lengths and angles when it multiplies a vector. It represents rotations and reflections in space. The columns (and rows) of an orthogonal matrix form a set of perpendicular unit vectors.

A key property: multiplying an orthogonal matrix by its transpose gives the identity matrix.

OrthogonalProjection = 23

A square matrix that represents a projection onto a subspace.

For Beginners: An orthogonal projection matrix "projects" vectors onto a specific subspace. Think of it like a shadow cast by an object onto a wall - the projection matrix represents this shadow-casting process. These matrices are used in data analysis to reduce dimensions while preserving important information.

Partitioned = 38

A matrix that has been divided into sections for specific mathematical operations.

For Beginners: A partitioned matrix is divided into sections to make certain calculations easier. Unlike block matrices (which are about storage and structure), partitioning is about breaking down a problem into smaller parts. This approach is used in solving systems of equations and in matrix decomposition methods.

Permutation = 28

A matrix that has exactly one 1 in each row and each column, with all other elements being 0.

For Beginners: A permutation matrix rearranges the order of elements in a vector when multiplied with it. It's like shuffling a deck of cards in a specific way. Each row and column has exactly one 1, with the rest being 0s.

PositiveDefinite = 21

A symmetric matrix where all eigenvalues are positive.

For Beginners: A positive definite matrix has special properties that make it useful in optimization and statistics. A key characteristic is that when you multiply this matrix with any non-zero vector, the result is always positive. These matrices represent "bowl-shaped" surfaces that have a clear minimum point.

PositiveSemiDefinite = 22

A symmetric matrix where all eigenvalues are non-negative (zero or positive).

For Beginners: A positive semi-definite matrix is similar to a positive definite matrix, but allows for some eigenvalues to be zero. When multiplied with any vector, the result is always non-negative. These matrices are common in statistics and machine learning, especially in covariance matrices.

Rectangular = 8

A matrix with a different number of rows and columns.

For Beginners: A rectangular matrix has a different number of rows and columns, like a rectangle. Example: A 2×3 matrix has 2 rows and 3 columns.

Scalar = 10

A diagonal matrix where all diagonal elements are the same value.

For Beginners: A scalar matrix is a diagonal matrix where all the diagonal values are the same number.

Example: [5 0 0] [0 5 0] [0 0 5]

Singular = 19

A square matrix that doesn't have an inverse.

For Beginners: A singular matrix cannot be inverted (no inverse exists). This happens when the determinant is zero, which means the matrix equations don't have unique solutions.

Think of it as a transformation that "flattens" space in at least one dimension, losing information in the process, making it impossible to reverse the transformation completely.

SkewHermitian = 16

A complex square matrix whose conjugate transpose equals its negative.

For Beginners: A skew-Hermitian matrix is the complex number equivalent of a skew-symmetric matrix. The diagonal elements are purely imaginary (or zero), and elements across the diagonal are negative complex conjugates of each other.

If position (row 1, column 2) has value 3+4i, then position (row 2, column 1) has value -3+4i.

SkewSymmetric = 5

A square matrix whose transpose equals its negative.

For Beginners: In a skew-symmetric matrix, the diagonal elements are always zero, and the elements on opposite sides of the diagonal are negatives of each other. If position (row 1, column 2) has value 5, then position (row 2, column 1) has value -5.

Example: [ 0 3 -1] [-3 0 4] [ 1 -4 0]

Sparse = 36

A matrix where most elements are zero.

For Beginners: A sparse matrix contains mostly zeros, with relatively few non-zero elements. These matrices are stored efficiently by only recording the positions and values of non-zero elements. Sparse matrices are common in large-scale problems like social networks, web links, or 3D simulations.

Square = 1

A matrix with the same number of rows and columns.

For Beginners: A square matrix has the same number of rows and columns, like a square. Example: A 3×3 matrix has 3 rows and 3 columns.

Stochastic = 26

A matrix where all elements are non-negative and each row sums to 1.

For Beginners: A stochastic matrix (also called a probability matrix) has non-negative entries with each row summing to 1. These matrices represent transition probabilities in Markov chains, where each row shows the probability of moving from one state to others.

Symmetric = 4

A square matrix that is equal to its transpose (mirror image across the diagonal).

For Beginners: A symmetric matrix is like a mirror image across its diagonal. The value at position (row 2, column 5) equals the value at (row 5, column 2).

Example: [3 7 2] [7 4 9] [2 9 5]

Toeplitz = 32

A matrix where each descending diagonal from left to right has constant values.

For Beginners: A Toeplitz matrix has the same value along each diagonal. The value depends only on how far the diagonal is from the main diagonal. These matrices appear in signal processing and when solving certain differential equations.

Example: [a b c d] [e a b c] [f e a b] [g f e a]

Tridiagonal = 13

A matrix with non-zero elements only on the main diagonal and the diagonals immediately above and below it.

For Beginners: A tridiagonal matrix has values only on the main diagonal and the diagonals immediately above and below it, with zeros everywhere else.

Example: [4 7 0] [2 5 8] [0 3 9]

Unitary = 18

A complex square matrix whose conjugate transpose equals its inverse.

For Beginners: A unitary matrix is the complex number equivalent of an orthogonal matrix. It preserves lengths and angles in complex vector spaces. For real matrices, unitary and orthogonal are the same thing.

A key property: multiplying a unitary matrix by its conjugate transpose gives the identity matrix.

Unknown = 0

Matrix type has not been determined or specified.

UpperBidiagonal = 11

A matrix with non-zero elements only on the main diagonal and the diagonal above it.

For Beginners: An upper bidiagonal matrix has values only on the main diagonal and the diagonal immediately above it, with zeros everywhere else.

Example: [4 7 0] [0 2 5] [0 0 9]

UpperTriangular = 6

A matrix where all elements below the main diagonal are zero.

For Beginners: An upper triangular matrix has values on or above the diagonal, with all values below the diagonal being zero. It forms a triangle shape in the upper part of the matrix.

Example: [4 2 1] [0 7 3] [0 0 5]

Vandermonde = 40

A matrix where each row consists of consecutive powers of a value.

For Beginners: A Vandermonde matrix is created by taking a set of values and raising each value to different powers. For example, if we have values [a, b, c], the matrix would look like: [1 1 1 ] [a b c ] [a² b² c² ] These matrices are used in polynomial interpolation (finding a curve that passes through specific points) and in coding theory for error correction.

Zero = 9

A matrix where all elements are zero.

For Beginners: A zero matrix contains only zeros in all positions.

Example: [0 0 0] [0 0 0]

Remarks

For Beginners: A matrix is a rectangular array of numbers arranged in rows and columns. Different types of matrices have special properties that make them useful for specific calculations or applications. This enum lists the various matrix types supported by the library.