mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
use a local variable for qrfac
This commit is contained in:
parent
dff5135026
commit
6e41f15fea
@ -104,7 +104,7 @@ L30:
|
|||||||
|
|
||||||
/* compute the qr factorization of the jacobian. */
|
/* compute the qr factorization of the jacobian. */
|
||||||
|
|
||||||
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data(), wa3.data());
|
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data());
|
||||||
|
|
||||||
/* on the first iteration and if mode is 1, scale according */
|
/* on the first iteration and if mode is 1, scale according */
|
||||||
/* to the norms of the columns of the initial jacobian. */
|
/* to the norms of the columns of the initial jacobian. */
|
||||||
|
@ -92,7 +92,7 @@ L30:
|
|||||||
|
|
||||||
/* compute the qr factorization of the jacobian. */
|
/* compute the qr factorization of the jacobian. */
|
||||||
|
|
||||||
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data(), wa3.data());
|
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), false, iwa, 1, wa1.data(), wa2.data());
|
||||||
|
|
||||||
/* on the first iteration and if mode is 1, scale according */
|
/* on the first iteration and if mode is 1, scale according */
|
||||||
/* to the norms of the columns of the initial jacobian. */
|
/* to the norms of the columns of the initial jacobian. */
|
||||||
|
@ -97,7 +97,7 @@ L40:
|
|||||||
|
|
||||||
/* compute the qr factorization of the jacobian. */
|
/* compute the qr factorization of the jacobian. */
|
||||||
|
|
||||||
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data(), wa3.data());
|
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data());
|
||||||
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
||||||
|
|
||||||
/* on the first iteration and if mode is 1, scale according */
|
/* on the first iteration and if mode is 1, scale according */
|
||||||
|
@ -96,7 +96,7 @@ L40:
|
|||||||
|
|
||||||
/* compute the qr factorization of the jacobian. */
|
/* compute the qr factorization of the jacobian. */
|
||||||
|
|
||||||
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data(), wa3.data());
|
ei_qrfac<Scalar>(m, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data());
|
||||||
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
||||||
|
|
||||||
/* on the first iteration and if mode is 1, scale according */
|
/* on the first iteration and if mode is 1, scale according */
|
||||||
|
@ -120,7 +120,7 @@ L40:
|
|||||||
if (! sing)
|
if (! sing)
|
||||||
goto L130;
|
goto L130;
|
||||||
ipvt.cwise()+=1;
|
ipvt.cwise()+=1;
|
||||||
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data(), wa3.data());
|
ei_qrfac<Scalar>(n, n, fjac.data(), fjac.rows(), true, ipvt.data(), n, wa1.data(), wa2.data());
|
||||||
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
ipvt.cwise()-=1; // qrfac() creates ipvt with fortran convetion (1->n), convert it to c (0->n-1)
|
||||||
for (j = 0; j < n; ++j) {
|
for (j = 0; j < n; ++j) {
|
||||||
if (fjac(j,j) == 0.)
|
if (fjac(j,j) == 0.)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
void ei_qrfac(int m, int n, Scalar *a, int
|
void ei_qrfac(int m, int n, Scalar *a, int
|
||||||
lda, int pivot, int *ipvt, int /* lipvt */, Scalar *rdiag,
|
lda, int pivot, int *ipvt, int /* lipvt */, Scalar *rdiag,
|
||||||
Scalar *acnorm, Scalar *wa)
|
Scalar *acnorm)
|
||||||
{
|
{
|
||||||
/* System generated locals */
|
/* System generated locals */
|
||||||
int a_dim1, a_offset;
|
int a_dim1, a_offset;
|
||||||
@ -15,8 +15,9 @@ void ei_qrfac(int m, int n, Scalar *a, int
|
|||||||
int minmn;
|
int minmn;
|
||||||
Scalar ajnorm;
|
Scalar ajnorm;
|
||||||
|
|
||||||
|
Matrix< Scalar, Dynamic, 1 > wa(n+1);
|
||||||
|
|
||||||
/* Parameter adjustments */
|
/* Parameter adjustments */
|
||||||
--wa;
|
|
||||||
--acnorm;
|
--acnorm;
|
||||||
--rdiag;
|
--rdiag;
|
||||||
a_dim1 = lda;
|
a_dim1 = lda;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user