NMath Reference Guide

## Connectivity |

Class ConnectivityMatrix represents a symmetric matrix of double-precision
floating point values.

Inheritance Hierarchy

SystemObject

CenterSpace.NMath.CoreDoubleSymmetricMatrix

CenterSpace.NMath.CoreConnectivityMatrix

CenterSpace.NMath.CoreNMFConsensusMatrixAlg

CenterSpace.NMath.CoreOrderedConnectivityMatrix

CenterSpace.NMath.CoreDoubleSymmetricMatrix

CenterSpace.NMath.CoreConnectivityMatrix

CenterSpace.NMath.CoreNMFConsensusMatrixAlg

CenterSpace.NMath.CoreOrderedConnectivityMatrix

Syntax

The ConnectivityMatrix type exposes the following members.

Constructors

Name | Description | |
---|---|---|

ConnectivityMatrix(DoubleMatrix) | Constructs a square ConnectivityMatrix instance by extracting the upper triangular part of a square general matrix. | |

ConnectivityMatrix(DoubleVector) | Constructs a ConnectivityMatrix instance using the data in the given vector. | |

ConnectivityMatrix(Int32) | Constructs a ConnectivityMatrix instance with the specified size. | |

ConnectivityMatrix(DoubleMatrix, IEnumerableString) | Constructs a square ConnectivityMatrix instance by extracting the upper triangular part of a square general matrix. | |

ConnectivityMatrix(DoubleVector, IEnumerableString) | Constructs a ConnectivityMatrix instance from the specified data and lables for those items. | |

ConnectivityMatrix(DoubleVector, Int32) | Constructs a ConnectivityMatrix instance with the specified size, and using the data in the given vector. | |

ConnectivityMatrix(Int32, IEnumerableString) | Constructs a ConnectivityMatrix instance with the specified number of items and lables for those items. | |

ConnectivityMatrix(DoubleVector, Int32, Boolean) | Constructs a ConnectivityMatrix instance from the given data. | |

ConnectivityMatrix(DoubleVector, Int32, IEnumerableString) | Constructs a ConnectivityMatrix instance from the specified data and lables for those items. |

Properties

Name | Description | |
---|---|---|

Cols |
Gets the number of columns in the matrix.
(Inherited from DoubleSymmetricMatrix) | |

DataVector |
Gets the data vector referenced by this matrix.
(Inherited from DoubleSymmetricMatrix) | |

Item |
Gets and sets the value at the specified position. Symmetry is maintained.
(Inherited from DoubleSymmetricMatrix) | |

Labels | Gets and sets the labels for the rows/columns of the connectivity matrix. | |

NumberOfLabels | Gets the number of row/column labels. | |

Order |
Gets the order of the matrix.
(Inherited from DoubleSymmetricMatrix) | |

Rows |
Gets the number of rows in the matrix.
(Inherited from DoubleSymmetricMatrix) |

Methods

Name | Description | |
---|---|---|

Apply(FuncDoubleVector, Double) |
Returns a new vector containing an element for each column or row in
this matrix. The elements are the results of applying a function that
takes a vector and returns a single-precision number.
(Inherited from DoubleSymmetricMatrix) | |

Apply(FuncDouble, Double) |
Returns a new matrix with the same size as this matrix, whose values are
the result of applying the given unary function to each element of this matrix.
(Inherited from DoubleSymmetricMatrix) | |

Apply(FuncDouble, Double, Double, DoubleSymmetricMatrix) |
Returns a new matrix with the same size as this matrix, whose values are
the result of applying the given binary function to each element of this matrix.
The first parameter to the binary function is the matrix element; the
second parameter is the corresponding element of the passed matrix.
(Inherited from DoubleSymmetricMatrix) | |

Apply(FuncDouble, Double, Double, Double) |
Returns a new matrix with the same size as this matrix, whose values are
the result of applying the given binary function to each element of this matrix.
The first parameter to the binary function is the matrix element; the second
parameter is the passed float-precision value.
(Inherited from DoubleSymmetricMatrix) | |

Apply(FuncDouble, Int32, Double, Int32) |
Returns a new matrix with the same size as this matrix, whose values are
the result of applying the given binary function to each element of this matrix.
The first parameter to the binary function is the matrix element; the second
parameter is the passed integer value.
(Inherited from DoubleSymmetricMatrix) | |

Clone | Constructs a deep copy of self. | |

DeepenThisCopy |
Guarantees that there is only one reference to the underlying
data and that this data is in contiguous storage.
(Inherited from DoubleSymmetricMatrix) | |

Equals |
Tests for equality of this connectivity matrix and another
connectivity matrix.
Two connectivity matrices are equal if they have the same dimensions
and all values are equal.
(Overrides DoubleSymmetricMatrixEquals(Object)) | |

GetHashCode |
Computes hash code.
(Overrides DoubleSymmetricMatrixGetHashCode) | |

LeadingSubmatrix |
Returns the k by k upper left corner of the matrix. The
matrix and the submatrix share the same data.
(Inherited from DoubleSymmetricMatrix) | |

Resize |
Changes the order of this matrix to that specified, adding zeros or truncating as
necessary.
(Inherited from DoubleSymmetricMatrix) | |

SetLabels | Sets the labels to the input values filling in with default values if there order is greater than the number of input labels. | |

ShallowCopy |
Creates a shallow copy of this matrix.
(Inherited from DoubleSymmetricMatrix) | |

ToCommaSeparated |
Returns a formatted string representation of this matrix using commas
and newlines.
(Inherited from DoubleSymmetricMatrix) | |

ToCommaSeparated(String) |
Returns a formatted string representation of this matrix using commas
and newlines. Numbers are formatted using the specified format string.
(Inherited from DoubleSymmetricMatrix) | |

ToGeneralMatrix |
Converts this sparse matrix to a general matrix.
(Inherited from DoubleSymmetricMatrix) | |

ToString |
Returns a formatted string representation of this matrix.
(Inherited from DoubleSymmetricMatrix) | |

ToString(String) |
Returns a formatted string representation of this matrix. Numbers are displayed
using the specified format.
(Inherited from DoubleSymmetricMatrix) | |

ToTabDelimited |
Returns a formatted string representation of this matrix using tabs
and newlines.
(Inherited from DoubleSymmetricMatrix) | |

ToTabDelimited(String) |
Returns a formatted string representation of this matrix using tabs
and newlines. Numbers are formatted using the specified format string.
(Inherited from DoubleSymmetricMatrix) | |

Transform(FuncDouble, Double) |
Modifies the elements of this matrix by applying the given unary function to
each element.
(Inherited from DoubleSymmetricMatrix) | |

Transform(FuncDouble, Double, Double, DoubleSymmetricMatrix) |
Modifies the contents of this matrix by applying the given binary function
to each element. The first parameter to the binary function is the matrix
element; the second parameter is the corresponding element of the passed matrix.
(Inherited from DoubleSymmetricMatrix) | |

Transform(FuncDouble, Double, Double, Double) |
Modifies the contents of this matrix by applying the given binary function
to each element. The first parameter to the binary function is
the matrix element; the second parameter is the passed float-precision value.
(Inherited from DoubleSymmetricMatrix) | |

Transform(FuncDouble, Int32, Double, Int32) |
Modifies the contents of this matrix by applying the given binary function
to each element. The first parameter to the binary function is
the matrix element; the second parameter is the passed integer value.
(Inherited from DoubleSymmetricMatrix) | |

Transpose |
Returns this matrix.
(Inherited from DoubleSymmetricMatrix) |

Operators

Name | Description | |
---|---|---|

Addition(ConnectivityMatrix, ConnectivityMatrix) | Adds two connectivity matrices. | |

Addition(ConnectivityMatrix, Double) | Adds a connectivity matrix and a scalar. | |

Addition(Double, ConnectivityMatrix) | Adds a scalar and a connectivity matrix. | |

Decrement(ConnectivityMatrix) | Decrements each element of the given matrix. | |

Division(ConnectivityMatrix, ConnectivityMatrix) | Divide a connectivity matrix by another. | |

Division(ConnectivityMatrix, Double) | Divide a connectivity matrix by a scalar. | |

Division(Double, ConnectivityMatrix) | Divide a scalar by a connectivity matrix. | |

Equality(ConnectivityMatrix, ConnectivityMatrix) | Tests for equality of two connectivity matrices. Two matrices are equal if they have the same order and all values are equal. | |

Increment(ConnectivityMatrix) | Increments each element of the given matrix. | |

Inequality(ConnectivityMatrix, ConnectivityMatrix) | Tests for inequality of two connectivity matrices. Two matrices are equal if they have the same order and all values are equal. | |

Multiply(ConnectivityMatrix, ConnectivityMatrix) | Multiply two lower connectivity matrices. Multiply two lower connectivity matrices. | |

Multiply(ConnectivityMatrix, Double) | Multiply a connectivity matrix and a scalar. | |

Multiply(Double, ConnectivityMatrix) | Multiply a scalar and a connectivity matrix. | |

Subtraction(ConnectivityMatrix, ConnectivityMatrix) | Subtracts one connectivity matrix from another. | |

Subtraction(ConnectivityMatrix, Double) | Subtracts a scalar from a connectivity matrix. | |

Subtraction(Double, ConnectivityMatrix) | Subtracts a connectivity matrix from a scalar. | |

UnaryNegation(ConnectivityMatrix) | Negation operator. | |

UnaryPlus(ConnectivityMatrix) | Unary + operator. Just returns the input matrix. |

Fields

Name | Description | |
---|---|---|

DEFAULT_LABEL_FORMAT | Default label format for the items represented in a ConnectivityMatrix instance. If the format string contains the symbol '{0}' it will be replaced by the items zero-based index. | |

labels_ | Lables for the items being connected. |

Remarks

The i, j entry represents the strength of connectivity between the variables i and j.

A symmetric matrix is equal to its transpose. In other words, A[i,j] = A[j,i] for all elements i,j in matrix A.

The matrix is stored in a vector column by column. For efficiency, only the upper triangle is stored. For example, the following 5 by 5 symmetric matrix:

A symmetric matrix is equal to its transpose. In other words, A[i,j] = A[j,i] for all elements i,j in matrix A.

The matrix is stored in a vector column by column. For efficiency, only the upper triangle is stored. For example, the following 5 by 5 symmetric matrix:

| a00 a01 a02 a03 a04 | | a10 a11 a12 a13 a14 | A = | a20 a21 a22 a23 a24 | | a30 a31 a32 a33 a34 | | a40 a41 a42 a43 a44 |is stored in a data vector v as:

v = [a00 a01 a11 a02 a12 a22 a03 a13 a23 a33 a04 a14 a24 a34 a44 ]In general, A[i,j] = v[j(j+1)/2+i], i<=j v[i(i+1)/2+j], j<i

See Also