diff --git a/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h b/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h index a06072a54..70a6d30c3 100644 --- a/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h +++ b/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h @@ -18,28 +18,18 @@ void ei_r1mpyq(int m, int n, Scalar *a, int a -= a_offset; /* Function Body */ + nm1 = n - 1; + if (nm1 < 1) + return; /* apply the first set of givens rotations to a. */ - - nm1 = n - 1; - if (nm1 < 1) { - /* goto L50; */ - return; - } for (nmj = 1; nmj <= nm1; ++nmj) { j = n - nmj; if (ei_abs(v[j]) > 1.) { cos__ = 1. / v[j]; - } - if (ei_abs(v[j]) > 1.) { - /* Computing 2nd power */ sin__ = ei_sqrt(1. - ei_abs2(cos__)); - } - if (ei_abs(v[j]) <= 1.) { + } else { sin__ = v[j]; - } - if (ei_abs(v[j]) <= 1.) { - /* Computing 2nd power */ cos__ = ei_sqrt(1. - ei_abs2(sin__)); } for (i = 1; i <= m; ++i) { @@ -47,26 +37,15 @@ void ei_r1mpyq(int m, int n, Scalar *a, int a[i + n * a_dim1] = sin__ * a[i + j * a_dim1] + cos__ * a[ i + n * a_dim1]; a[i + j * a_dim1] = temp; - /* L10: */ } - /* L20: */ } - /* apply the second set of givens rotations to a. */ - for (j = 1; j <= nm1; ++j) { if (ei_abs(w[j]) > 1.) { cos__ = 1. / w[j]; - } - if (ei_abs(w[j]) > 1.) { - /* Computing 2nd power */ sin__ = ei_sqrt(1. - ei_abs2(cos__)); - } - if (ei_abs(w[j]) <= 1.) { + } else { sin__ = w[j]; - } - if (ei_abs(w[j]) <= 1.) { - /* Computing 2nd power */ cos__ = ei_sqrt(1. - ei_abs2(sin__)); } for (i = 1; i <= m; ++i) { @@ -74,14 +53,8 @@ void ei_r1mpyq(int m, int n, Scalar *a, int a[i + n * a_dim1] = -sin__ * a[i + j * a_dim1] + cos__ * a[ i + n * a_dim1]; a[i + j * a_dim1] = temp; - /* L30: */ } - /* L40: */ } - /* L50: */ return; - - /* last card of subroutine r1mpyq. */ - } /* r1mpyq_ */