fixed dependencies

This commit is contained in:
nuknal
2024-10-24 15:46:01 +08:00
parent d16a5bd9c0
commit 1161e8d054
2005 changed files with 690883 additions and 0 deletions

56
vendor/github.com/nuknal/goNum/NormInf.go generated vendored Normal file
View File

@@ -0,0 +1,56 @@
// NormInf
/*
------------------------------------------------------
作者 : Black Ghost
日期 : 2018-11-21
版本 : 0.0.0
------------------------------------------------------
求矩阵无穷范数
理论:
参考 李信真, 车刚明, 欧阳洁, 等. 计算方法. 西北工业大学
出版社, 2000, pp 65.
||A||Inf = Maxi(Sumj(|aij|))
------------------------------------------------------
输入 :
A 矩阵
输出 :
sol 范数值
err 解出标志false-未解出或达到步数上限;
true-全部解出
------------------------------------------------------
*/
package goNum
import "math"
// NormInf 求矩阵无穷范数
func NormInf(A Matrix) (float64, bool) {
/*
求矩阵无穷范数
输入 :
A 矩阵
输出 :
sol 范数值
err 解出标志false-未解出或达到步数上限;
true-全部解出
*/
var sol float64
var err bool = false
//求取行绝对值的和
row := make([]float64, A.Rows)
for i := 0; i < A.Rows; i++ {
thisRow := A.RowOfMatrix(i)
for j := 0; j < len(thisRow); j++ {
row[i] += math.Abs(thisRow[j])
}
}
//求取最大值
sol, _, _ = Max(row)
err = true
return sol, err
}