Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AMPLSOLVERCALLS_H
00018 #define AMPLSOLVERCALLS_H
00019
00020 #include "ExpandedModel.h"
00021 #include <map>
00022 #include <string>
00023
00024
00025
00026
00027
00028
00029 class IndexListValue {
00030 public:
00031 int nvar;
00032 int *lvar;
00033 int count;
00034
00036 IndexListValue(int new_nvar = -1, int *new_lvar = NULL, int new_count = -1) :
00037 nvar(new_nvar), lvar(new_lvar), count(new_count) {}
00038
00040 ~IndexListValue() {
00041 delete[] lvar;
00042 }
00043
00044 };
00045
00046
00047 class ASL_pfgh;
00048 class ASL;
00049
00065 class NlFile {
00066 friend class ExpandedModel;
00067
00069 std::string nlfilename;
00070
00072 int ncol;
00073
00075 int nrow;
00076
00078 int nzH;
00079
00081 int nzA;
00082
00084 ASL_pfgh *asl_pfgh_ptr;
00085
00087 ASL *asl_ptr;
00088
00113 std::map<ExpandedModel*, IndexListValue*> indexList;
00114
00115 public:
00116
00118 NlFile(const std::string& name);
00119
00121 ~NlFile();
00122
00123 private:
00124
00126 int getNoConstraints();
00127
00129 void readNlFile();
00130
00132 void readNlFile_f();
00133
00134 int getNoNonzerosAMPL(int nvar, const int *lvar);
00135
00136 void fillSparseAMPL(int nvar, const int *lvar,
00137 int *colbeg, int *collen, int *rownbs, double *el);
00138 void getRowBoundsAMPL(double *lower, double *upper) const;
00139 void getObjAMPL(int nvar, int *lvar, double *elts);
00140 void getColLowBoundsAMPL(int nvar, int *lvar, double *elts);
00141 void getColUpBoundsAMPL(int nvar, int *lvar, double *elts);
00142 int findIxOfLocalVarsInNlFile(ExpandedModel *em, int *lvar);
00143
00144
00145
00146 public:
00147
00149 int getNoVariables();
00150
00152 int getNoHessianEntries();
00153
00157 void getHessianStructure(int *colbeg, int *rownbs);
00158
00162 void getHessianEntries(int *colbeg, int *rownbs, double *el);
00163
00164 };
00165
00166 #endif