SparseMatrix<T>.ComponentwiseMultiply Method

Definition

Namespace: Numerics.NET.LinearAlgebra
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4

Overload List

ComponentwiseMultiply(Matrix<T>, SparseMatrix<T>) Multiplies the components of a matrix by the corresponding components of a sparse matrix.
ComponentwiseMultiply(SparseMatrix<T>, Matrix<T>) Multiplies the components of a matrix by the corresponding components of a sparse matrix.

ComponentwiseMultiply(Matrix<T>, SparseMatrix<T>)

Multiplies the components of a matrix by the corresponding components of a sparse matrix.
C#
public static Matrix<T> ComponentwiseMultiply(
	Matrix<T> matrix,
	SparseMatrix<T> sparseMatrix
)

Parameters

matrix  Matrix<T>
A Matrix<T>.
sparseMatrix  SparseMatrix<T>
A SparseMatrix<T>.

Return Value

Matrix<T>
A new SparseMatrix<T> whose elements are equal to the products of the components of matrix and sparseMatrix .

Exceptions

ArgumentNullException

matrix is null.

-or-

sparseMatrix is null.

DimensionMismatchException

The number of rows of matrix does not equal the number of rows of sparseMatrix.

-or-

The number of columns of matrix does not equal the number of columns of sparseMatrix.

ComponentwiseMultiply(SparseMatrix<T>, Matrix<T>)

Multiplies the components of a matrix by the corresponding components of a sparse matrix.
C#
public static Matrix<T> ComponentwiseMultiply(
	SparseMatrix<T> sparseMatrix,
	Matrix<T> matrix
)

Parameters

sparseMatrix  SparseMatrix<T>
A SparseMatrix<T>.
matrix  Matrix<T>
A Matrix<T>.

Return Value

Matrix<T>
A new SparseMatrix<T> whose elements are equal to the products of the components of sparseMatrix and matrix .

Exceptions

ArgumentNullException

matrix is null.

-or-

sparseMatrix is null.

DimensionMismatchException

The number of rows of matrix does not equal the number of rows of sparseMatrix.

-or-

The number of columns of matrix does not equal the number of columns of sparseMatrix.

See Also