[med-svn] [Git][med-team/gjh-asl-json][upstream] New upstream version 0.0+git20210628.867c5da

Andreas Tille (@tille) gitlab at salsa.debian.org
Sun Jan 16 17:52:03 GMT 2022



Andreas Tille pushed to branch upstream at Debian Med / gjh-asl-json


Commits:
064f5c53 by Andreas Tille at 2022-01-16T18:20:43+01:00
New upstream version 0.0+git20210628.867c5da
- - - - -


3 changed files:

- src/AmplInterface.cpp
- src/AmplInterface.hpp
- src/gjh_asl_json.cpp


Changes:

=====================================
src/AmplInterface.cpp
=====================================
@@ -21,6 +21,7 @@ AmplInterface::AmplInterface(int argc, char**& argv)
    primal_assumed_(1.0),
    dual_assumed_(1.0),
    stubname_(""),
+   jsonname_(""),
    objn_(-1),
    obj_sense_(0),
    nnz_hes_lag_(-1)
@@ -46,7 +47,7 @@ AmplInterface::AmplInterface(int argc, char**& argv)
    Oinfo_ptr_->sname = new char[strlen(sname)+1];
    strcpy(Oinfo_ptr_->sname, sname);
 
-   char bsname[] = "gjh_asl_json: Version 1.0.0";
+   char bsname[] = "gjh_asl_json: Version 1.1.0";
    Oinfo_ptr_->bsname = new char[strlen(bsname)+1];
    strcpy(Oinfo_ptr_->bsname, bsname);
 
@@ -57,6 +58,7 @@ AmplInterface::AmplInterface(int argc, char**& argv)
    int options_count = 5;
    char* rows_res(NULL);
    char* cols_res(NULL);
+   char* json_res(NULL);
    keyword keywords[] = {/* must be alphabetical */
       /* one may notice that I'm going overboard here to shut up warnings
 	 about 'deprecated conversion from string const to char*' */
@@ -72,6 +74,10 @@ AmplInterface::AmplInterface(int argc, char**& argv)
          C_val,
          &cols_res,
          const_cast<char*>("Map of variable names to variable ids")),
+      KW(const_cast<char*>("json"),
+         C_val,
+         &json_res,
+         const_cast<char*>("Name of output JSON file")),
       KW(const_cast<char*>("rows"),
          C_val,
          &rows_res,
@@ -141,6 +147,11 @@ AmplInterface::AmplInterface(int argc, char**& argv)
 
    _ASSERT_(stub != NULL, "ASL Error: nl filename pointer is NULL");
    stubname_ = std::string(stub);
+   if (json_res) {
+      jsonname_ = std::string(json_res);
+   } else {
+      jsonname_ = stubname_ + ".json";
+   }
 
    FILE* nl = NULL;
    nl = jac0dim(stub, (int)strlen(stub));


=====================================
src/AmplInterface.hpp
=====================================
@@ -39,6 +39,9 @@ public:
    // get the nl file stub name
    std::string get_stubname() const {return stubname_;}
 
+   // get the output json file name
+   std::string get_jsonname() const {return jsonname_;}
+
    // write a sol file
    void write_solution_file();
 
@@ -126,6 +129,9 @@ private:
    // stub file name
    std::string stubname_;
 
+   // json file name
+   std::string jsonname_;
+
    // keep track if which objective is being used
    int objn_;
 


=====================================
src/gjh_asl_json.cpp
=====================================
@@ -7,7 +7,7 @@ int main(int argc, char** argv)
 {
    AmplInterface solver(argc, argv);
 
-   std::string output_name = solver.get_stubname()+".json";
+   std::string output_name = solver.get_jsonname();
 
    std::ofstream out;
    out.open(output_name.c_str(), std::ios::out | std::ios::trunc);



View it on GitLab: https://salsa.debian.org/med-team/gjh-asl-json/-/commit/064f5c538c68db0daff031d8a036fe554d9c0818

-- 
View it on GitLab: https://salsa.debian.org/med-team/gjh-asl-json/-/commit/064f5c538c68db0daff031d8a036fe554d9c0818
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220116/1ce4dedd/attachment-0001.htm>


More information about the debian-med-commit mailing list