稠密矩阵类,提供矩阵存储和基本操作 采用列优先存储方式,便于与BLAS/LAPACK风格的操作兼容
DenseMatrix
01 Syntax
Microsoft.VisualBasic.Math.Sundials.CVODE.DenseMatrix
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| .ctor | 3 | 复制构造函数 |
| Identity | 1 | 创建单位矩阵 |
| Zeros | 1 | 创建零矩阵 |
| Ones | 1 | 创建全1矩阵 |
| Diagonal | 1 | 创建对角矩阵 |
| Add | 1 | 矩阵加法 |
| Subtract | 1 | 矩阵减法 |
| Scale | 1 | 标量乘法 |
| Multiply | 1 | 矩阵乘法 |
| MultiplyVector | 1 | 矩阵-向量乘法:y = A * x |
| Transpose | 1 | 矩阵转置 |
| AddInPlace | 1 | 原地加法 |
| ScaleInPlace | 1 | 原地标量乘法 |
| SetConstant | 1 | 设置所有元素为指定值 |
| CopyFrom | 1 | 复制另一个矩阵的值 |
| SetDiagonal | 1 | 设置对角线元素 |
| SetColumn | 1 | 设置指定列 |
| GetColumn | 1 | 获取指定列 |
| SetRow | 1 | 设置指定行 |
| GetRow | 1 | 获取指定行 |
| FrobeniusNorm | 1 | Frobenius范数 |
| Norm1 | 1 | 1-范数(列和的最大值) |
| InfinityNorm | 1 | 无穷范数(行和的最大值) |
| Clone | 1 | |
| ToString | 1 |
03 Properties
04 Members
#ctor(
Int32, Int32)创建指定大小的矩阵,元素初始化为0
Parameters
| Name | Type | Description |
|---|---|---|
rows | Int32 | 行数 |
cols | Int32 | 列数 |
#ctor(
Double[0:,0:])从二维数组创建矩阵
Parameters
| Name | Type | Description |
|---|---|---|
data | Double[0:,0:] | 数据数组(行优先格式) |
#ctor(DenseMatrix)
复制构造函数
Identity(
Int32)创建单位矩阵
Zeros(
Int32, Int32)创建零矩阵
Ones(
Int32, Int32)创建全1矩阵
Diagonal(NVector)
创建对角矩阵
Add(DenseMatrix, DenseMatrix)
矩阵加法
Subtract(DenseMatrix, DenseMatrix)
矩阵减法
Scale(
Double, DenseMatrix)标量乘法
Multiply(DenseMatrix, DenseMatrix)
矩阵乘法
MultiplyVector(DenseMatrix, NVector)
矩阵-向量乘法:y = A * x
Transpose
矩阵转置
AddInPlace(DenseMatrix)
原地加法
ScaleInPlace(
Double)原地标量乘法
SetConstant(
Double)设置所有元素为指定值
CopyFrom(DenseMatrix)
复制另一个矩阵的值
SetDiagonal(
Double)设置对角线元素
SetColumn(
Int32, NVector)设置指定列
GetColumn(
Int32)获取指定列
SetRow(
Int32, NVector)设置指定行
GetRow(
Int32)获取指定行
FrobeniusNorm
Frobenius范数
Norm1
1-范数(列和的最大值)
InfinityNorm
无穷范数(行和的最大值)
Rows
获取行数
Columns
获取列数
IsSquare
判断是否为方阵
Item(
Int32, Int32)获取或设置指定位置的元素
Data
获取内部数据数组的引用
Clone()
ToString()