Skip to content

Commit

Permalink
add option to disable binary form
Browse files Browse the repository at this point in the history
  • Loading branch information
svigerske committed May 3, 2022
1 parent 4b8ba1e commit d1013c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/amplsolver/amplsolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ typedef struct
/* length of nl filename without extension */
int stublen;
char solver[GMS_SSSIZE];
int nlbinary;

} amplsolver;

Expand Down Expand Up @@ -161,6 +162,8 @@ int processOptions(
gevLogStatPChar(as->gev, "Warning: Failed to pass solver options.\n");
}

as->nlbinary = optGetIntStr(opt, "nlbinary");

rc = 0;

TERMINATE:
Expand All @@ -187,7 +190,7 @@ void writeNL(
as->stublen = strlen(as->filename) - 3;

writeopts.filename = as->filename;
writeopts.binary = 1;
writeopts.binary = as->nlbinary;

if( convertWriteNL(as->gmo, writeopts) == RETURN_ERROR )
{
Expand Down
2 changes: 2 additions & 0 deletions src/amplsolver/optamplsolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ int main(int argc, char** argv)
"", -2);
gmsopt.collect("options", "Options string to pass to solver", "", "", -2);

gmsopt.collect("nlbinary", "Whether .nl file should be written in binary form", "", true);

gmsopt.finalize();

gmsopt.writeDef();
Expand Down

0 comments on commit d1013c7

Please sign in to comment.