mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-06 19:29:08 +08:00
clean r1mpyq: remove fortran leftovers
This commit is contained in:
parent
55f328b264
commit
c04a93df31
@ -360,8 +360,8 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveOneStep(
|
|||||||
|
|
||||||
/* compute the qr factorization of the updated jacobian. */
|
/* compute the qr factorization of the updated jacobian. */
|
||||||
ei_r1updt<Scalar>(n, n, R, wa1.data(), wa2.data(), wa3.data(), &sing);
|
ei_r1updt<Scalar>(n, n, R, wa1.data(), wa2.data(), wa3.data(), &sing);
|
||||||
ei_r1mpyq<Scalar>(n, n, fjac.data(), fjac.rows(), wa2.data(), wa3.data());
|
ei_r1mpyq<Scalar>(n, n, fjac.data(), wa2.data(), wa3.data());
|
||||||
ei_r1mpyq<Scalar>(1, n, qtf.data(), 1, wa2.data(), wa3.data());
|
ei_r1mpyq<Scalar>(1, n, qtf.data(), wa2.data(), wa3.data());
|
||||||
|
|
||||||
jeval = false;
|
jeval = false;
|
||||||
}
|
}
|
||||||
@ -609,8 +609,8 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiffOneStep(
|
|||||||
|
|
||||||
/* compute the qr factorization of the updated jacobian. */
|
/* compute the qr factorization of the updated jacobian. */
|
||||||
ei_r1updt<Scalar>(n, n, R, wa1.data(), wa2.data(), wa3.data(), &sing);
|
ei_r1updt<Scalar>(n, n, R, wa1.data(), wa2.data(), wa3.data(), &sing);
|
||||||
ei_r1mpyq<Scalar>(n, n, fjac.data(), fjac.rows(), wa2.data(), wa3.data());
|
ei_r1mpyq<Scalar>(n, n, fjac.data(), wa2.data(), wa3.data());
|
||||||
ei_r1mpyq<Scalar>(1, n, qtf.data(), 1, wa2.data(), wa3.data());
|
ei_r1mpyq<Scalar>(1, n, qtf.data(), wa2.data(), wa3.data());
|
||||||
|
|
||||||
jeval = false;
|
jeval = false;
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,19 @@
|
|||||||
|
|
||||||
|
// TODO : move this to GivensQR once there's such a thing in Eigen
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
void ei_r1mpyq(int m, int n, Scalar *a, int
|
void ei_r1mpyq(int m, int n, Scalar *a, const Scalar *v, const Scalar *w)
|
||||||
lda, const Scalar *v, const Scalar *w)
|
|
||||||
{
|
{
|
||||||
/* System generated locals */
|
|
||||||
int a_dim1, a_offset;
|
|
||||||
|
|
||||||
/* Local variables */
|
/* Local variables */
|
||||||
int i, j, nmj;
|
int i, j;
|
||||||
Scalar cos__=0., sin__=0., temp;
|
Scalar cos__=0., sin__=0., temp;
|
||||||
|
|
||||||
/* Parameter adjustments */
|
|
||||||
--w;
|
|
||||||
--v;
|
|
||||||
a_dim1 = lda;
|
|
||||||
a_offset = 1 + a_dim1 * 1;
|
|
||||||
a -= a_offset;
|
|
||||||
|
|
||||||
/* Function Body */
|
/* Function Body */
|
||||||
if (n<=1)
|
if (n<=1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* apply the first set of givens rotations to a. */
|
/* apply the first set of givens rotations to a. */
|
||||||
for (nmj = 1; nmj <= n-1; ++nmj) {
|
for (j = n-2; j>=0; --j) {
|
||||||
j = n - nmj;
|
|
||||||
if (ei_abs(v[j]) > 1.) {
|
if (ei_abs(v[j]) > 1.) {
|
||||||
cos__ = 1. / v[j];
|
cos__ = 1. / v[j];
|
||||||
sin__ = ei_sqrt(1. - ei_abs2(cos__));
|
sin__ = ei_sqrt(1. - ei_abs2(cos__));
|
||||||
@ -31,15 +21,14 @@ void ei_r1mpyq(int m, int n, Scalar *a, int
|
|||||||
sin__ = v[j];
|
sin__ = v[j];
|
||||||
cos__ = ei_sqrt(1. - ei_abs2(sin__));
|
cos__ = ei_sqrt(1. - ei_abs2(sin__));
|
||||||
}
|
}
|
||||||
for (i = 1; i <= m; ++i) {
|
for (i = 0; i<m; ++i) {
|
||||||
temp = cos__ * a[i + j * a_dim1] - sin__ * a[i + n * a_dim1];
|
temp = cos__ * a[i+m*j] - sin__ * a[i+m*(n-1)];
|
||||||
a[i + n * a_dim1] = sin__ * a[i + j * a_dim1] + cos__ * a[
|
a[i+m*(n-1)] = sin__ * a[i+m*j] + cos__ * a[i+m*(n-1)];
|
||||||
i + n * a_dim1];
|
a[i+m*j] = temp;
|
||||||
a[i + j * a_dim1] = temp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* apply the second set of givens rotations to a. */
|
/* apply the second set of givens rotations to a. */
|
||||||
for (j = 1; j <= n-1; ++j) {
|
for (j = 0; j<n-1; ++j) {
|
||||||
if (ei_abs(w[j]) > 1.) {
|
if (ei_abs(w[j]) > 1.) {
|
||||||
cos__ = 1. / w[j];
|
cos__ = 1. / w[j];
|
||||||
sin__ = ei_sqrt(1. - ei_abs2(cos__));
|
sin__ = ei_sqrt(1. - ei_abs2(cos__));
|
||||||
@ -47,11 +36,10 @@ void ei_r1mpyq(int m, int n, Scalar *a, int
|
|||||||
sin__ = w[j];
|
sin__ = w[j];
|
||||||
cos__ = ei_sqrt(1. - ei_abs2(sin__));
|
cos__ = ei_sqrt(1. - ei_abs2(sin__));
|
||||||
}
|
}
|
||||||
for (i = 1; i <= m; ++i) {
|
for (i = 0; i<m; ++i) {
|
||||||
temp = cos__ * a[i + j * a_dim1] + sin__ * a[i + n * a_dim1];
|
temp = cos__ * a[i+m*j] + sin__ * a[i+m*(n-1)];
|
||||||
a[i + n * a_dim1] = -sin__ * a[i + j * a_dim1] + cos__ * a[
|
a[i+m*(n-1)] = -sin__ * a[i+m*j] + cos__ * a[i+m*(n-1)];
|
||||||
i + n * a_dim1];
|
a[i+m*j] = temp;
|
||||||
a[i + j * a_dim1] = temp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user