nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Math.Core / SparseMatrix

SparseMatrix

Full name Microsoft.VisualBasic.Math.LinearAlgebra.Matrix.SparseMatrix Assembly Microsoft.VisualBasic.Math.Core Members 7

01 Syntax

Microsoft.VisualBasic.Math.LinearAlgebra.Matrix.SparseMatrix

02 Methods

NameOverloadsSummary
.ctor 1
MultiplyTranspose 1 计算转置矩阵与向量的乘积:result = Aᵀ·y
Get 1
ArrayPack 1 convert to real [m,n] matrix
UnpackData 1

03 Properties

NameOverloadsSummary
nnz 1 非零元素个数(即内部字典存储的 (row, col, value) 三元组数量)。

04 Fields

NameOverloadsSummary
rows 1 just store the non-zero element index and the element value, all missing index is ZERO

05 Members

method .ctor #
#ctor(Int32, Int32)
Parameters
NameTypeDescription
mInt32

nrows

nInt32

ncols

method MultiplyTranspose #
MultiplyTranspose(Double())

计算转置矩阵与向量的乘积:result = Aᵀ·y

Remarks

直接遍历内部按行存储的非零元素字典完成计算,复杂度为 O(nnz), 不会将稀疏矩阵转置或稠密化。适用于随机化 SVD 等只依赖 稀疏矩阵-向量乘法黑盒接口的迭代算法。

Parameters
NameTypeDescription
yDouble()

长度必须等于矩阵行数 m 的输入向量

Returns

长度为 n(列数)的结果向量

method Get #
Get(UInt32, UInt32)
Parameters
NameTypeDescription
iUInt32

-

jUInt32

-

Returns

value of missing index is ZERO

method ArrayPack #
ArrayPack(Boolean)

convert to real [m,n] matrix

Parameters
NameTypeDescription
deepcopyBoolean

-

Returns

A dense matrix data

method UnpackData #
UnpackData(Single(), Int32(), Int32(), Int32)
Parameters
NameTypeDescription
xdataSingle()

-

xindicesInt32()

the corresponding index value of the xdata, this vector size of this parameter must be equals to the xdata!

xindptrInt32()

-

property nnz #
nnz

非零元素个数(即内部字典存储的 (row, col, value) 三元组数量)。

field rows #
rows

just store the non-zero element index and the element value, all missing index is ZERO