14#include <OpenMEEG_Export.h>
25 for (
unsigned i = 0;
i < m.nlin(); ++
i) {
26 J(
i,
i) = 1.0 / m(
i,
i);
48 }
else if (std::abs(
dy) > std::abs(
dx)) {
71 for (
int i =
k;
i >= 0;
i--) {
73 for (
int j =
i - 1;
j >= 0;
j--)
74 y(
j) -=
h(
j,
i) * y(
i);
76 for (
int j = 0;
j <=
k;
j++) {
82 template<
class T,
class P>
95 double beta =
r.norm();
107 while (
j <= max_iter) {
112 for (
i = 0;
i < m &&
j <= max_iter;
i++,
j++) {
114 for (
k = 0;
k <=
i;
k++) {
118 H(
i+1,
i) =
w.norm();
121 for (
k = 0;
k <
i;
k++)
Vector operator()(const Vector &g) const
Matrix class Matrix class.
void GeneratePlaneRotation(double &dx, double &dy, double &cs, double &sn)
unsigned GMRes(const T &A, const P &M, Vector &x, const Vector &b, int max_iter, double tol, unsigned m)
void ApplyPlaneRotation(double &dx, double &dy, double &cs, double &sn)
void Update(Vector &x, int k, T &h, Vector &s, Vector v[])