C++实现共轭梯度算法
C++实现共轭梯度(CG)算法1.原理对多元函数极值求解2.针对A取正定矩阵3.代码#include<iostream>#include<vector>using namespace std;double C = 0;vector<double> B = { -4,0 };vector<double> X_0;vector<vector<double>> A = { {2.0,-2.0},{-2.0,4.0}
原创
2021-03-17 16:04:06 ·
2637 阅读 ·
0 评论