/home/coin/SVN-release/OS-2.2.0/Couenne/src/readnl/readASLfg.cpp

Go to the documentation of this file.
00001 /* $Id: readASLfg.cpp 154 2009-06-16 18:52:53Z pbelotti $ */
00002 /*
00003  * Name:    readASLfg.cpp
00004  * Author:  Pietro Belotti
00005  * Purpose: re-read .nl file into a simpler ASL structure
00006  *
00007  * (C) Carnegie-Mellon University, 2006. 
00008  * This file is licensed under the Common Public License (CPL)
00009  */
00010 
00011 #include "asl.h"
00012 #include "nlp.h"
00013 #include "getstub.h"
00014 #include "r_opn.hd" /* for N_OPS */
00015 
00016 #define CHR (char*)
00017 
00018 fint timing = 0;
00019 
00020 keyword keywds[] = { // must be alphabetical
00021    KW(CHR"timing", L_val, &timing, CHR"display timings for the run"),
00022 };
00023 
00024 Option_Info Oinfo = { CHR"testampl", CHR"ANALYSIS TEST",
00025                       CHR"concert_options", keywds, nkeywds, 0, CHR"ANALYSIS TEST" };
00026 
00027 
00028 ASL *readASLfg (char **argv) {
00029 
00030   // read .nl file from first argument //////////////////////////
00031 
00032   char *stub;
00033 
00034   // Create the ASL structure
00035   ASL* asl = (ASL*) ASL_alloc (ASL_read_fg);
00036   FILE *nl = NULL;
00037   stub = getstub (&argv, &Oinfo);
00038 
00039   // Although very intuitive, we shall explain why the second argument
00040   // is passed with a minus sign: it is to tell the ASL to retrieve
00041   // the nonlinear information too.
00042   nl = jac0dim (stub, - (fint) strlen (stub));
00043 
00044   // Set options in the asl structure
00045   want_xpi0 = 1 | 2;  // allocate initial values for primal and dual if available
00046   obj_no = 0;         // always want to work with the first (and only?) objective
00047 
00048   // allocate space for initial values
00049   X0      = new real [n_var];
00050   havex0  = new char [n_var];
00051   pi0     = new real [n_con];
00052   havepi0 = new char [n_con];
00053 
00054   // read the rest of the nl file
00055   fg_read (nl, ASL_return_read_err | ASL_findgroups);
00056 
00057   return asl;
00058 }

Generated on Thu Aug 5 03:02:57 2010 by  doxygen 1.4.7