#include "stack-c.h"Include dependency graph for intdgeesx.c:

Go to the source code of this file.
Defines | |
| #define | MAX(x, y) (((x)>(y))?(x):(y)) |
| #define | MIN(x, y) (((x)<(y))?(x):(y)) |
Functions | |
| int | intdgeesx (char *fname) |
| int intdgeesx | ( | char* | fname | ) |
Definition at line 20 of file intdgeesx.c.
References A, C2F, CheckLhs, CheckRhs, CheckSquare, CreateCVar, CreateVar, Errorinfo, GetRhsVar, it, Lhs, LhsVar, M, MAX, Maxvol, N, stk, and WORK.
00022 { 00023 int A = 1, W = 2, VS = 3, WORK; 00024 int M, N, lA, lVS; 00025 int NLHS, it=1; 00026 int un=1, lWORK, LWORKMIN, LWORK, IWORK, LIWORK; 00027 int LDA, LDVS, lWR, lWI; 00028 int INFO, SDIM, BWORK; 00029 double RCONDE,RCONDV; 00030 char *JOBVS, *SORT, *SENSE; 00031 00032 #ifndef WIN32 00033 extern select(); 00034 #endif 00035 00036 CheckRhs(1,1) ; 00037 CheckLhs(1,3) ; 00038 00039 /*--------------------A---------------------------*/ 00040 GetRhsVar(A, "d", &M, &N, &lA); 00041 CheckSquare(A, M, N); 00042 00043 /*--------------------W---------------------------*/ 00044 CreateCVar(W, "d", &it, &N, &un, &lWR, &lWI); 00045 00046 NLHS=Lhs; 00047 LDA = MAX(1,N); 00048 LDVS=MAX(1,N); 00049 SORT="N"; 00050 SENSE="N"; 00051 00052 switch ( NLHS ){ 00053 case 3: /* [W,VS,A]=dgeesx(A) */ 00054 case 2: /* [W,VS]=dgeesx(A) */ 00055 printf("== 2 ==\r\n"); 00056 JOBVS="V"; 00057 /*--------------------VS---------------------------*/ 00058 CreateVar(VS, "d", &N, &N, &lVS); 00059 /*--------------------WORK---------------------------*/ 00060 WORK=4; LWORKMIN = MAX(1, 3*N); 00061 LWORK=Maxvol(WORK,"d"); /* max memory currently available */ 00062 if (LWORK < LWORKMIN) Scierror(999,"%s: not enough memory (use stacksize) \r\n",fname); 00063 00064 LIWORK = 1; 00065 00066 CreateVar(WORK, "d", &LWORK, &un, &lWORK); 00067 C2F(dgeesx)(JOBVS, SORT, select, SENSE, &N, stk(lA), &LDA, &SDIM, 00068 stk(lWR), stk(lWI), 00069 stk(lVS), &LDVS, &RCONDE, &RCONDV, stk(lWORK), 00070 &LWORK, &IWORK, &LIWORK, BWORK, &INFO); 00071 00072 if (INFO != 0) Errorinfo("DGEESX ", INFO); 00073 LhsVar(1)=W; LhsVar(2)=VS; LhsVar(3)=A; 00074 break; 00075 case 1: /* [W]=dgeesx(A) */ 00076 JOBVS="N"; 00077 /*--------------------WORK---------------------------*/ 00078 WORK=3; LWORKMIN = MAX(1, 3*N); 00079 LWORK=Maxvol(WORK, "d"); /* max memory currently available */ 00080 if (LWORK < LWORKMIN) Scierror(999,"%s: not enough memory (use stacksize) \r\n",fname); 00081 CreateVar(WORK, "d", &LWORK, &un, &lWORK); 00082 00083 C2F(dgeesx)(JOBVS, SORT, select, SENSE, &N, stk(lA), &LDA, &SDIM, 00084 stk(lWR), stk(lWI), 00085 VS, &LDVS, &RCONDE, &RCONDV, stk(lWORK), 00086 &LWORK, IWORK, LIWORK, BWORK, &INFO); 00087 if (INFO != 0) Errorinfo("DGEESX ", INFO); 00088 LhsVar(1)=W; 00089 break; 00090 default: 00091 return 0; 00092 } 00093 00094 return 0; 00095 }
1.5.1