Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

npsol.h

Go to the documentation of this file.
00001 
00017 #ifndef __NPSOL_H__
00018 #define __NPSOL_H__
00019 
00020 /* Defines and typedefs */
00021 
00022 /* Declare C linkage conventions for external FORTRAN routines */
00023 #ifdef __cplusplus
00024 #define C_LINKAGE "C"
00025 #else
00026 #define C_LINKAGE 
00027 #endif
00028 
00029 
00030 /* These FORTRAN flavors are currently supported: */
00031 #define CRAY_FORTRAN 1
00032 #define F2C_FORTRAN  2
00033 /* For F2C, make sure to link lib f2c (-lf2c) */
00034 
00035 
00036 /* Guess the flavor for a particular platform */
00037 #ifdef USE_NPSOL
00038 #ifdef _CRAY
00039 #define FORTRAN_FLAVOR CRAY_FORTRAN
00040 #elif defined(__GNUC__)
00041 #define FORTRAN_FLAVOR F2C_FORTRAN
00042 #endif
00043 #endif
00044 
00045 
00046 /* Define FORTRAN datatypes */
00047 #ifndef FORTRAN_FLAVOR
00048 #define REAL    double
00049 #define INTEGER int
00050 typedef void    npsolfunreturn;
00051 #define npsolfunreturnval 
00052 
00053 #elif FORTRAN_FLAVOR==CRAY_FORTRAN
00054 #include <fortran.h>
00055 #define REAL    double
00056 #define INTEGER int
00057 typedef void    npsolfunreturn;
00058 #define npsolfunreturnval
00059 
00060 #elif FORTRAN_FLAVOR==F2C_FORTRAN
00061 #include <f2c.h>
00062 #define REAL    real
00063 #define INTEGER integer
00064 typedef INTEGER npsolfunreturn;
00065 #define npsolfunreturnval 0
00066 #endif
00067 
00068 /* Configuration params for NPSOL */
00069 typedef struct {                
00070   REAL    Bound;
00071   INTEGER Der_Level;
00072   INTEGER Verify_Level;
00073   INTEGER Major_Iter_Limit;
00074   REAL    Function_Precision;
00075   REAL    Lin_Srch_Tolerance;
00076   REAL    Optimality_Tolerance;
00077   INTEGER nb_params;            /* Solver specific params   */
00078   char    *param_table[1000];   /* Parameters added in this */
00079 } Conf;
00080 
00081 extern INTEGER No_of_variables;
00082 extern REAL    Lower_bounds[];
00083 extern REAL    Upper_bounds[]; 
00084 extern REAL    Gradient[];   
00085 extern REAL    Variables[];  
00086 extern INTEGER nPrints;
00087 extern Conf    Configuration;
00088 extern INTEGER Solver_Status;
00089 
00090 
00091 typedef npsolfunreturn
00092 (*confuntype)(INTEGER*, INTEGER*, INTEGER*, INTEGER*, INTEGER*,
00093               REAL*, REAL*, REAL*, INTEGER*); 
00094 
00095 typedef npsolfunreturn
00096 (*objfuntype)(INTEGER*, INTEGER*, REAL*, REAL*, REAL*, INTEGER*);  
00097 
00098 
00099 /* Provide NPOPTN and NPSOL calls */
00100 #if FORTRAN_FLAVOR==CRAY_FORTRAN
00101 #define NPSOL_FUN  NPSOL
00102 
00104 extern C_LINKAGE npsolfunreturn NPOPTN(_fcd);
00105 #define NPOPTN_FUN(string,len) NPOPTN(_cptofcd(str,len));
00106 
00107 #elif FORTRAN_FLAVOR==F2C_FORTRAN
00108 #define NPSOL_FUN  npsol_
00109 #define NPOPTN_FUN npoptn_
00110 extern C_LINKAGE npsolfunreturn NPOPTN_FUN(char *string, ftnlen string_len);
00111 #endif
00112 
00113 
00114 extern C_LINKAGE npsolfunreturn NPSOL_FUN(
00115   INTEGER *n,        INTEGER *nclin,    INTEGER *ncnln,
00116   INTEGER *lda,      INTEGER *ldcju,    INTEGER *ldr,
00117   REAL    *a,        REAL    *bl,       REAL    *bu,
00118   confuntype confun, objfuntype objfun, INTEGER *inform__, 
00119   INTEGER *iter,     INTEGER *istate,   REAL    *c__,         
00120   REAL    *cjacu,    REAL    *clamda,   REAL    *objf,        
00121   REAL    *gradu,    REAL    *r__,      REAL    *x,
00122   INTEGER *iw,       INTEGER *leniw,
00123   REAL    *w,        INTEGER *lenw   );
00124 
00125 
00126 #endif

Generated at Mon Aug 21 00:30:54 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000