计算系统的最小二乘解. (规范)
计算最小二乘解的子程序接口,即 2 范数最小化解。
此接口提供使用子程序计算线性矩阵系统最小二乘的方法。支持的数据类型包括 real
和 complex
。如果提供预分配的工作空间,则使用此接口时不会发生内部内存分配。
注意
该解决方案基于 LAPACK 的奇异值分解 *GELSD
方法。
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
complex(kind=sp), | intent(in) | :: | b(:,:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
complex(kind=sp), | intent(inout), | contiguous, target | :: | x(:,:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=sp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
complex(kind=sp), | intent(inout), | optional, | target | :: | cmpl_storage(:) |
[可选] 复数工作存储空间 |
real(kind=sp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=sp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
complex(kind=sp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
complex(kind=sp), | intent(in) | :: | b(:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
complex(kind=sp), | intent(inout), | contiguous, target | :: | x(:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=sp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
complex(kind=sp), | intent(inout), | optional, | target | :: | cmpl_storage(:) |
[可选] 复数工作存储空间 |
real(kind=sp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=sp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
real(kind=dp), | intent(in) | :: | b(:,:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
real(kind=dp), | intent(inout), | contiguous, target | :: | x(:,:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=dp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
real(kind=dp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=dp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
real(kind=dp), | intent(in) | :: | b(:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
real(kind=dp), | intent(inout), | contiguous, target | :: | x(:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=dp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
real(kind=dp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=dp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
real(kind=sp), | intent(in) | :: | b(:,:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
real(kind=sp), | intent(inout), | contiguous, target | :: | x(:,:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=sp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
real(kind=sp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=sp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
real(kind=sp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
real(kind=sp), | intent(in) | :: | b(:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
real(kind=sp), | intent(inout), | contiguous, target | :: | x(:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=sp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
real(kind=sp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=sp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
complex(kind=dp), | intent(in) | :: | b(:,:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
complex(kind=dp), | intent(inout), | contiguous, target | :: | x(:,:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=dp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
complex(kind=dp), | intent(inout), | optional, | target | :: | cmpl_storage(:) |
[可选] 复数工作存储空间 |
real(kind=dp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=dp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |
类型 | 意图 | 可选 | 属性 | 名称 | ||
---|---|---|---|---|---|---|
complex(kind=dp), | intent(inout), | target | :: | a(:,:) |
输入矩阵 a[n,n] |
|
complex(kind=dp), | intent(in) | :: | b(:) |
右侧向量或数组,b[n] 或 b[n,nrhs] |
||
complex(kind=dp), | intent(inout), | contiguous, target | :: | x(:) |
结果数组/矩阵 x[n] 或 x[n,nrhs] |
|
real(kind=dp), | intent(inout), | optional, | target | :: | real_storage(:) |
[可选] 实数工作存储空间 |
integer(kind=ilp), | intent(inout), | optional, | target | :: | int_storage(:) |
[可选] 整数工作存储空间 |
complex(kind=dp), | intent(inout), | optional, | target | :: | cmpl_storage(:) |
[可选] 复数工作存储空间 |
real(kind=dp), | intent(in), | optional | :: | cond |
[可选] 用于秩评估的截止值:奇异值 s(i)<=cond*maxval(s) 被视为 0。 |
|
real(kind=dp), | intent(out), | optional, | target | :: | singvals(:) |
[可选] 奇异值的列表 [min(m,n)],按降序排列,由 SVD 返回 |
logical(kind=lk), | intent(in), | optional | :: | overwrite_a |
[可选] 可以覆盖和销毁 A、b 数据吗? |
|
integer(kind=ilp), | intent(out), | optional | :: | rank |
[可选] 返回 A 的秩 |
|
type(linalg_state_type), | intent(out), | optional | :: | err |
[可选] 状态返回值。如果未请求错误,则代码将停止 |