20 extern "C" void dgetrf_(int32 *
M, int32 *
N,
double *A, int32 *LDA, int32 *IPIV, int32 *INFO);
21 extern "C" void dgetrs_(
char *TRANS, int32 *
N, int32 *NRHS,
double *A, int32 *LDA, int32 *iPiv,
double *B,
22 int32 *LDB, int32 *INFO, int32 translen);
23 extern "C" void dgtsv_(int32 *n, int32 *nrhs,
double *dl,
double *d,
double *du,
double *b, int32 *ldb, int32 *info);
34 STATIC void DGETRF(int32,int32,
double*,int32,int32[],int32*);
37 STATIC void DGETRS(int32 TRANS,int32
N,int32 NRHS,
double *A,int32 LDA,int32 IPIV[],
double *B,int32 LDB,int32 *INFO);
51 int32 M_loc, N_loc, lda_loc;
61 dgetrf_(&M_loc, &N_loc, A , &lda_loc, ipiv, info);
64 DGETRF(M_loc, N_loc, A, lda_loc, ipiv, info);
69 void getrs_wrapper(
char trans,
long N,
long nrhs,
double *A,
long lda, int32 *ipiv,
70 double *B,
long ldb, int32 *info)
74 int32 N_loc, nrhs_loc, lda_loc, ldb_loc;
79 nrhs_loc = (int32)nrhs;
85 dgetrs_(&trans, &N_loc, &nrhs_loc, A, &lda_loc, ipiv, B, &ldb_loc, info,
sizeof(
char));
88 DGETRS(trans, N_loc, nrhs_loc, A, lda_loc, ipiv, B, ldb_loc, info);
94 void dgtsv_wrapper(
long N,
long nrhs,
double *dl,
double *d__,
double *du,
double *b,
long ldb, int32 *info)
96 printf(
"Inside dgtsv\n");
100 int32 N_loc, nrhs_loc, ldb_loc;
105 nrhs_loc = (int32)nrhs;
106 ldb_loc = (int32)ldb;
110 dgtsv_(&N_loc, &nrhs_loc, dl, d__, du, b, &ldb_loc, info);
114 (void)DGTSV(&N_loc, &nrhs_loc, dl, d__, du, b, &ldb_loc, info);
136 #define AA(I_,J_) (*(A+(I_)*(LDA)+(J_)))
137 #define BB(I_,J_) (*(B+(I_)*(LDB)+(J_)))
138 #define CC(I_,J_) (*(C+(I_)*(LDC)+(J_)))
289 fprintf(
ioQQQ,
" ** On entry to %6.6s parameter number %2ld had an illegal value\n",
290 SRNAME, (
long)INFO );
403 else if( LDA <
MAX2(1,M) )
415 if( M == 0 || N == 0 )
423 NB =
ILAENV(1,
"DGETRF",M,N,-1);
424 if( NB <= 1 || NB >=
MIN2(M,N) )
428 DGETF2(M,N,A,LDA,IPIV,INFO);
438 for( J=1; J<=limit; J += NB )
446 DGETF2(M-J+1,JB,&
AA(J_,J_),LDA,&IPIV[J_],&IINFO);
450 if( *INFO == 0 && IINFO > 0 )
451 *INFO = IINFO + J - 1;
452 limit2 =
MIN2(M,J+JB-1);
453 for( I=J; I <= limit2; I++ )
461 DLASWP(J-1,A,LDA,J,J+JB-1,IPIV,1);
468 DLASWP(N-J-JB+1,&
AA(J_+JB,0),LDA,J,J+JB-1,IPIV,1);
477 DTRSM(chL1,chL2,chL3,chL4,JB,N-J-JB+1,
ONE,&
AA(J_,J_),
478 LDA,&
AA(J_+JB,J_),LDA);
487 DGEMM(chL1,chL2,M-J-JB+1,N-J-JB+1,JB,-
ONE,&
AA(J_,J_+JB),
488 LDA,&
AA(J_+JB,J_),LDA,
ONE,&
AA(J_+JB,J_+JB),LDA);
626 NOTRAN =
LSAME(TRANS,
'N');
627 if( (!NOTRAN && !
LSAME(TRANS,
'T')) && !
LSAME(TRANS,
'C') )
639 else if( LDA <
MAX2(1,N) )
643 else if( LDB <
MAX2(1,N) )
655 if( N == 0 || NRHS == 0 )
667 DLASWP(NRHS,B,LDB,1,N,IPIV,1);
676 DTRSM(chL1,chL2,chL3,chL4,N,NRHS,
ONE,A,LDA,B,LDB);
685 DTRSM(chL1,chL2,chL3,chL4,N,NRHS,
ONE,A,LDA,B,LDB);
699 DTRSM(chL1,chL2,chL3,chL4,N,NRHS,
ONE,A,LDA,B,LDB);
708 DTRSM(chL1,chL2,chL3,chL4,N,NRHS,
ONE,A,LDA,B,LDB);
712 DLASWP(NRHS,B,LDB,1,N,IPIV,-1);
786 if( ZCODE == 90 || ZCODE == 122 )
792 if( INTA >= 97 && INTA <= 122 )
794 if( INTB >= 97 && INTB <= 122 )
798 else if( ZCODE == 233 || ZCODE == 169 )
804 if( ((INTA >= 129 && INTA <= 137) || (INTA >= 145 && INTA <=
805 153)) || (INTA >= 162 && INTA <= 169) )
807 if( ((INTB >= 129 && INTB <= 137) || (INTB >= 145 && INTB <=
808 153)) || (INTB >= 162 && INTB <= 169) )
812 else if( ZCODE == 218 || ZCODE == 250 )
818 if( INTA >= 225 && INTA <= 250 )
820 if( INTB >= 225 && INTB <= 250 )
823 LSAME_v = INTA == INTB;
854 if( n < 1 || incx <= 0 )
874 for( i=2; i <= n; i++ )
877 if( fabs(dx[ix-1]) > dmax )
880 dmax = fabs(dx[ix-1]);
890 for( i=1; i < n; i++ )
893 if( fabs(dx[i]) > dmax )
1062 LSIDE =
LSAME(SIDE,
'L');
1071 NOUNIT =
LSAME(DIAG,
'N');
1072 UPPER =
LSAME(UPLO,
'U');
1075 if( (!LSIDE) && (!
LSAME(SIDE,
'R')) )
1079 else if( (!UPPER) && (!
LSAME(UPLO,
'L')) )
1083 else if( ((!
LSAME(TRANSA,
'N')) && (!
LSAME(TRANSA,
'T'))) && (!
LSAME(TRANSA,
1088 else if( (!
LSAME(DIAG,
'U')) && (!
LSAME(DIAG,
'N')) )
1100 else if( LDA <
MAX2(1,NROWA) )
1104 else if( LDB <
MAX2(1,M) )
1124 for( J=1; J <=
N; J++ )
1127 for( I=1; I <=
M; I++ )
1140 if(
LSAME(TRANSA,
'N') )
1147 for( J=1; J <=
N; J++ )
1152 for( I=1; I <=
M; I++ )
1158 for( K=M; K >= 1; K-- )
1164 BB(J_,K_) /=
AA(K_,K_);
1166 for( I=0; I < K-1; I++ )
1168 BB(J_,I) += TEMP*
AA(K_,I);
1176 for( J=1; J <=
N; J++ )
1181 for( I=1; I <=
M; I++ )
1187 for( K=1; K <=
M; K++ )
1193 BB(J_,K_) /=
AA(K_,K_);
1195 for( I=K; I <
M; I++ )
1197 BB(J_,I) += TEMP*
AA(K_,I);
1211 for( J=1; J <=
N; J++ )
1214 for( I=1; I <=
M; I++ )
1217 TEMP = ALPHA*
BB(J_,I_);
1218 for( K=1; K <= (I - 1); K++ )
1221 TEMP += -
AA(I_,K_)*
BB(J_,K_);
1231 for( J=1; J <=
N; J++ )
1234 for( I=M; I >= 1; I-- )
1237 TEMP = ALPHA*
BB(J_,I_);
1238 for( K=I + 1; K <=
M; K++ )
1241 TEMP += -
AA(I_,K_)*
BB(J_,K_);
1253 if(
LSAME(TRANSA,
'N') )
1260 for( J=1; J <=
N; J++ )
1265 for( I=1; I <=
M; I++ )
1271 for( K=1; K <= (J - 1); K++ )
1276 for( I=1; I <=
M; I++ )
1279 BB(J_,I_) += -
AA(J_,K_)*
BB(K_,I_);
1285 TEMP =
ONE/
AA(J_,J_);
1286 for( I=1; I <=
M; I++ )
1296 for( J=N; J >= 1; J-- )
1301 for( I=1; I <=
M; I++ )
1307 for( K=J + 1; K <=
N; K++ )
1312 for( I=1; I <=
M; I++ )
1315 BB(J_,I_) += -
AA(J_,K_)*
BB(K_,I_);
1321 TEMP =
ONE/
AA(J_,J_);
1322 for( I=1; I <=
M; I++ )
1338 for( K=N; K >= 1; K-- )
1343 TEMP =
ONE/
AA(K_,K_);
1344 for( I=1; I <=
M; I++ )
1350 for( J=1; J <= (K - 1); J++ )
1356 for( I=1; I <=
M; I++ )
1359 BB(J_,I_) += -TEMP*
BB(K_,I_);
1365 for( I=1; I <=
M; I++ )
1375 for( K=1; K <=
N; K++ )
1380 TEMP =
ONE/
AA(K_,K_);
1381 for( I=1; I <=
M; I++ )
1387 for( J=K + 1; J <=
N; J++ )
1393 for( I=1; I <=
M; I++ )
1396 BB(J_,I_) += -TEMP*
BB(K_,I_);
1402 for( I=1; I <=
M; I++ )
1599 strncpy( SUBNAM, NAME, 6 );
1603 if( IZ == 90 || IZ == 122 )
1608 if( IC >= 97 && IC <= 122 )
1610 SUBNAM[0] = (char)(IC - 32);
1611 for( I=2; I <= 6; I++ )
1614 if( IC >= 97 && IC <= 122 )
1615 SUBNAM[I - 1] = (char)(IC - 32);
1620 else if( IZ == 233 || IZ == 169 )
1625 if( ((IC >= 129 && IC <= 137) || (IC >= 145 && IC <= 153)) ||
1626 (IC >= 162 && IC <= 169) )
1628 SUBNAM[0] = (char)(IC + 64);
1629 for( I=2; I <= 6; I++ )
1632 if( ((IC >= 129 && IC <= 137) || (IC >= 145 && IC <=
1633 153)) || (IC >= 162 && IC <= 169) )
1634 SUBNAM[I - 1] = (char)(IC + 64);
1639 else if( IZ == 218 || IZ == 250 )
1644 if( IC >= 225 && IC <= 250 )
1646 SUBNAM[0] = (char)(IC - 32);
1647 for( I=2; I <= 6; I++ )
1650 if( IC >= 225 && IC <= 250 )
1651 SUBNAM[I - 1] = (char)(IC - 32);
1657 SNAME = C1 ==
'S' || C1 ==
'D';
1658 CNAME = C1 ==
'C' || C1 ==
'Z';
1659 if( !(CNAME || SNAME) )
1665 strncpy( C2, SUBNAM+1, 2 );
1666 strncpy( C3, SUBNAM+3, 3 );
1667 strncpy( C4, C3+1, 2 );
1672 strncpy( C2, SUBNAM+1, 2 );
1674 strncpy( C3, SUBNAM+3, 3 );
1676 strncpy( C4, C3+1, 2 );
1696 if( strcmp(C2,
"GE") == 0 )
1698 if( strcmp(C3,
"TRF") == 0 )
1709 else if( ((strcmp(C3,
"QRF") == 0 || strcmp(C3,
"RQF") == 0) ||
1710 strcmp(C3,
"LQF") == 0) || strcmp(C3,
"QLF") == 0 )
1721 else if( strcmp(C3,
"HRD") == 0 )
1732 else if( strcmp(C3,
"BRD") == 0 )
1743 else if( strcmp(C3,
"TRI") == 0 )
1755 else if( strcmp(C2,
"PO") == 0 )
1757 if( strcmp(C3,
"TRF") == 0 )
1769 else if( strcmp(C2,
"SY") == 0 )
1771 if( strcmp(C3,
"TRF") == 0 )
1782 else if( SNAME && strcmp(C3,
"TRD") == 0 )
1786 else if( SNAME && strcmp(C3,
"GST") == 0 )
1791 else if( CNAME && strcmp(C2,
"HE") == 0 )
1793 if( strcmp(C3,
"TRF") == 0 )
1797 else if( strcmp(C3,
"TRD") == 0 )
1801 else if( strcmp(C3,
"GST") == 0 )
1806 else if( SNAME && strcmp(C2,
"OR") == 0 )
1810 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
1811 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
1812 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
1818 else if( C3[0] ==
'M' )
1820 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
1821 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
1822 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
1829 else if( CNAME && strcmp(C2,
"UN") == 0 )
1833 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
1834 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
1835 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
1841 else if( C3[0] ==
'M' )
1843 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
1844 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
1845 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
1852 else if( strcmp(C2,
"GB") == 0 )
1854 if( strcmp(C3,
"TRF") == 0 )
1880 else if( strcmp(C2,
"PB") == 0 )
1882 if( strcmp(C3,
"TRF") == 0 )
1908 else if( strcmp(C2,
"TR") == 0 )
1910 if( strcmp(C3,
"TRI") == 0 )
1922 else if( strcmp(C2,
"LA") == 0 )
1924 if( strcmp(C3,
"UUM") == 0 )
1936 else if( SNAME && strcmp(C2,
"ST") == 0 )
1938 if( strcmp(C3,
"EBZ") == 0 )
1951 if( strcmp(C2,
"GE") == 0 )
1953 if( ((strcmp(C3,
"QRF") == 0 || strcmp(C3,
"RQF") == 0) || strcmp(C3
1954 ,
"LQF") == 0) || strcmp(C3,
"QLF") == 0 )
1965 else if( strcmp(C3,
"HRD") == 0 )
1976 else if( strcmp(C3,
"BRD") == 0 )
1987 else if( strcmp(C3,
"TRI") == 0 )
1999 else if( strcmp(C2,
"SY") == 0 )
2001 if( strcmp(C3,
"TRF") == 0 )
2012 else if( SNAME && strcmp(C3,
"TRD") == 0 )
2017 else if( CNAME && strcmp(C2,
"HE") == 0 )
2019 if( strcmp(C3,
"TRD") == 0 )
2024 else if( SNAME && strcmp(C2,
"OR") == 0 )
2028 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2029 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2030 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2036 else if( C3[0] ==
'M' )
2038 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2039 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2040 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2047 else if( CNAME && strcmp(C2,
"UN") == 0 )
2051 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2052 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2053 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2059 else if( C3[0] ==
'M' )
2061 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2062 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2063 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2078 if( strcmp(C2,
"GE") == 0 )
2080 if( ((strcmp(C3,
"QRF") == 0 || strcmp(C3,
"RQF") == 0) || strcmp(C3
2081 ,
"LQF") == 0) || strcmp(C3,
"QLF") == 0 )
2092 else if( strcmp(C3,
"HRD") == 0 )
2103 else if( strcmp(C3,
"BRD") == 0 )
2115 else if( strcmp(C2,
"SY") == 0 )
2117 if( SNAME && strcmp(C3,
"TRD") == 0 )
2122 else if( CNAME && strcmp(C2,
"HE") == 0 )
2124 if( strcmp(C3,
"TRD") == 0 )
2129 else if( SNAME && strcmp(C2,
"OR") == 0 )
2133 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2134 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2135 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2142 else if( CNAME && strcmp(C2,
"UN") == 0 )
2146 if( (((((strcmp(C4,
"QR") == 0 || strcmp(C4,
"RQ") == 0) ||
2147 strcmp(C4,
"LQ") == 0) || strcmp(C4,
"QL") == 0) || strcmp(C4
2148 ,
"HR") == 0) || strcmp(C4,
"TR") == 0) || strcmp(C4,
"BR") ==
2222 if( incx == 1 && incy == 1 )
2232 ix = (-n + 1)*incx + 1;
2235 iy = (-n + 1)*incy + 1;
2237 for( i=0; i < n; i++ )
2240 dx[ix-1] = dy[iy-1];
2257 for( i=0; i < m; i++ )
2270 for( i=m; i < n; i += 3 )
2304 if( n <= 0 || incx <= 0 )
2314 for( i=0; i<nincx; i = i + incx)
2326 for( i=0; i < n; i++ )
2416 IX = 1 + (1 - K2)*INCX;
2420 for( I=K1; I <= K2; I++ )
2430 for( I=K1; I <= K2; I++ )
2441 for( I=K2; I >= K1; I-- )
2552 else if( LDA <
MAX2(1,M) )
2564 if( M == 0 || N == 0 )
2569 for( J=1; J <= limit; J++ )
2575 JP = J - 1 +
IDAMAX(M-J+1,&
AA(J_,J_),1);
2577 if(
AA(J_,JP-1) !=
ZERO )
2589 else if( *INFO == 0 )
2598 DGER(M-J,N-J,-
ONE,&
AA(J_,J_+1),1,&
AA(J_+1,J_),LDA,&
AA(J_+1,J_+1),
2724 else if( INCX == 0 )
2728 else if( INCY == 0 )
2732 else if( LDA <
MAX2(1,M) )
2744 if( ((M == 0) || (N == 0)) || (ALPHA ==
ZERO) )
2757 JY = 1 - (N - 1)*INCY;
2761 for( J=1; J <=
N; J++ )
2764 if( Y[JY-1] !=
ZERO )
2766 TEMP = ALPHA*Y[JY-1];
2767 for( I=0; I <
M; I++ )
2769 AA(J_,I) += X[I]*TEMP;
2783 KX = 1 - (M - 1)*INCX;
2785 for( J=1; J <=
N; J++ )
2788 if( Y[JY-1] !=
ZERO )
2790 TEMP = ALPHA*Y[JY-1];
2792 for( I=1; I <=
M; I++ )
2795 AA(J_,I_) += X[IX-1]*TEMP;
2973 NOTA =
LSAME(TRANSA,
'N');
2974 NOTB =
LSAME(TRANSB,
'N');
2997 if( ((!NOTA) && (!
LSAME(TRANSA,
'C'))) && (!
LSAME(TRANSA,
'T')) )
3002 ((!NOTB) && (!
LSAME(TRANSB,
'C'))) && (!
LSAME(TRANSB,
'T')) )
3022 else if( LDA <
MAX2(1,NROWA) )
3027 else if( LDB <
MAX2(1,NROWB) )
3032 else if( LDC <
MAX2(1,M) )
3045 if( ((M == 0) || (N == 0)) || (((ALPHA ==
ZERO) || (K == 0)) &&
3056 for( J=0; J <
N; J++ )
3058 for( I=0; I <
M; I++ )
3067 for( J=0; J <
N; J++ )
3069 for( I=0; I <
M; I++ )
3087 for( J=0; J <
N; J++ )
3091 for( I=0; I <
M; I++ )
3097 else if( BETA !=
ONE )
3099 for( I=0; I <
M; I++ )
3105 for( L=0; L < K; L++ )
3109 TEMP = ALPHA*
BB(J,L);
3110 for( I=0; I <
M; I++ )
3112 CC(J,I) += TEMP*
AA(L,I);
3122 for( J=0; J <
N; J++ )
3124 for( I=0; I <
M; I++ )
3127 for( L=0; L < K; L++ )
3129 TEMP +=
AA(I,L)*
BB(J,L);
3134 CC(J,I) = ALPHA*TEMP;
3138 CC(J,I) = ALPHA*TEMP + BETA*
CC(J,I);
3151 for( J=0; J <
N; J++ )
3155 for( I=0; I <
M; I++ )
3161 else if( BETA !=
ONE )
3163 for( I=0; I <
M; I++ )
3169 for( L=0; L < K; L++ )
3173 TEMP = ALPHA*
BB(L,J);
3174 for( I=0; I <
M; I++ )
3176 CC(J,I) += TEMP*
AA(L,I);
3187 for( J=0; J <
N; J++ )
3190 for( I=0; I <
M; I++ )
3194 for( L=0; L < K; L++ )
3196 TEMP +=
AA(I,L)*
BB(L,J);
3201 CC(J,I) = ALPHA*TEMP;
3205 CC(J,I) = ALPHA*TEMP + BETA*
CC(J,I);
3226 STATIC int32 DGTSV(int32 *n, int32 *nrhs,
double *dl,
3227 double *d__,
double *du,
double *b, int32 *ldb, int32
3231 int32 b_dim1, b_offset, i__1, i__2;
3238 #define b_ref(a_1,a_2) b[(a_2)*(b_dim1) + (a_1)]
3312 b_offset = 1 + b_dim1 * 1;
3319 }
else if(*nrhs < 0) {
3321 }
else if(*ldb < *n && *ldb < 1) {
3336 for(i__ = 1; i__ <= i__1; ++i__) {
3337 if(fabs(d__[i__]) >= fabs(dl[i__])) {
3341 if(d__[i__] != 0.) {
3342 fact = dl[i__] / d__[i__];
3343 d__[i__ + 1] -= fact * du[i__];
3344 b_ref(i__ + 1, 1) = b_ref(i__ + 1, 1) - fact * b_ref(i__,
3355 fact = d__[i__] / dl[i__];
3357 temp = d__[i__ + 1];
3358 d__[i__ + 1] = du[i__] - fact * temp;
3359 dl[i__] = du[i__ + 1];
3360 du[i__ + 1] = -fact * dl[i__];
3362 temp = b_ref(i__, 1);
3363 b_ref(i__, 1) = b_ref(i__ + 1, 1);
3364 b_ref(i__ + 1, 1) = temp - fact * b_ref(i__ + 1, 1);
3370 if(fabs(d__[i__]) >= fabs(dl[i__])) {
3371 if(d__[i__] != 0.) {
3372 fact = dl[i__] / d__[i__];
3373 d__[i__ + 1] -= fact * du[i__];
3374 b_ref(i__ + 1, 1) = b_ref(i__ + 1, 1) - fact * b_ref(i__,
3381 fact = d__[i__] / dl[i__];
3383 temp = d__[i__ + 1];
3384 d__[i__ + 1] = du[i__] - fact * temp;
3386 temp = b_ref(i__, 1);
3387 b_ref(i__, 1) = b_ref(i__ + 1, 1);
3388 b_ref(i__ + 1, 1) = temp - fact * b_ref(i__ + 1, 1);
3397 for(i__ = 1; i__ <= i__1; ++i__) {
3398 if(fabs(d__[i__]) >= fabs(dl[i__])) {
3402 if(d__[i__] != 0.) {
3403 fact = dl[i__] / d__[i__];
3404 d__[i__ + 1] -= fact * du[i__];
3406 for(j = 1; j <= i__2; ++j) {
3407 b_ref(i__ + 1, j) = b_ref(i__ + 1, j) - fact * b_ref(
3420 fact = d__[i__] / dl[i__];
3422 temp = d__[i__ + 1];
3423 d__[i__ + 1] = du[i__] - fact * temp;
3424 dl[i__] = du[i__ + 1];
3425 du[i__ + 1] = -fact * dl[i__];
3428 for(j = 1; j <= i__2; ++j) {
3429 temp = b_ref(i__, j);
3430 b_ref(i__, j) = b_ref(i__ + 1, j);
3431 b_ref(i__ + 1, j) = temp - fact * b_ref(i__ + 1, j);
3439 if( fabs(d__[i__]) >= fabs(dl[i__]))
3443 fact = dl[i__] / d__[i__];
3444 d__[i__ + 1] -= fact * du[i__];
3446 for(j = 1; j <= i__1; ++j) {
3447 b_ref(i__ + 1, j) = b_ref(i__ + 1, j) - fact * b_ref(
3458 fact = d__[i__] / dl[i__];
3460 temp = d__[i__ + 1];
3461 d__[i__ + 1] = du[i__] - fact * temp;
3464 for(j = 1; j <= i__1; ++j) {
3465 temp = b_ref(i__, j);
3466 b_ref(i__, j) = b_ref(i__ + 1, j);
3467 b_ref(i__ + 1, j) = temp - fact * b_ref(i__ + 1, j);
3483 b_ref(*n, j) = b_ref(*n, j) / d__[*n];
3485 b_ref(*n - 1, j) = (b_ref(*n - 1, j) - du[*n - 1] * b_ref(*n, j))
3488 for(i__ = *n - 2; i__ >= 1; --i__) {
3489 b_ref(i__, j) = (b_ref(i__, j) - du[i__] * b_ref(i__ + 1, j) - dl[
3490 i__] * b_ref(i__ + 2, j)) / d__[i__];
3499 for(j = 1; j <= i__1; ++j) {
3500 b_ref(*n, j) = b_ref(*n, j) / d__[*n];
3502 b_ref(*n - 1, j) = (b_ref(*n - 1, j) - du[*n - 1] * b_ref(*n,
3505 for(i__ = *n - 2; i__ >= 1; --i__) {
3506 b_ref(i__, j) = (b_ref(i__, j) - du[i__] * b_ref(i__ + 1, j)
3507 - dl[i__] * b_ref(i__ + 2, j)) / d__[i__];
STATIC void DLASWP(int32 N, double *A, int32 LDA, int32 K1, int32 K2, int32 IPIV[], int32 INCX)
STATIC void DGETRF(int32, int32, double *, int32, int32[], int32 *)
void getrs_wrapper(char trans, long N, long nrhs, double *A, long lda, int32 *ipiv, double *B, long ldb, int32 *info)
STATIC int32 ILAENV(int32 ISPEC, const char *NAME, int32 N1, int32 N2, int32 N4)
STATIC void DSWAP(int32 n, double dx[], int32 incx, double dy[], int32 incy)
STATIC int32 IDAMAX(int32 n, double dx[], int32 incx)
void getrf_wrapper(long M, long N, double *A, long lda, int32 *ipiv, int32 *info)
STATIC void DGER(int32 M, int32 N, double ALPHA, double X[], int32 INCX, double Y[], int32 INCY, double *A, int32 LDA)
STATIC double da(double z, double temp, double eden)
STATIC void DGEMM(int32 TRANSA, int32 TRANSB, int32 M, int32 N, int32 K, double ALPHA, double *A, int32 LDA, double *B, int32 LDB, double BETA, double *C, int32 LDC)
STATIC void DGETF2(int32 M, int32 N, double *A, int32 LDA, int32 IPIV[], int32 *INFO)
STATIC int32 LSAME(int32 CA, int32 CB)
#define DEBUG_ENTRY(funcname)
STATIC void DGETRS(int32 TRANS, int32 N, int32 NRHS, double *A, int32 LDA, int32 IPIV[], double *B, int32 LDB, int32 *INFO)
STATIC void XERBLA(const char *SRNAME, int32 INFO)
STATIC void DTRSM(int32 SIDE, int32 UPLO, int32 TRANSA, int32 DIAG, int32 M, int32 N, double ALPHA, double *A, int32 LDA, double *B, int32 LDB)
int fprintf(const Output &stream, const char *format,...)
STATIC void DSCAL(int32 n, double da, double dx[], int32 incx)