Hello,
I am using AMPL's ASL as a part of a polynomial programming optimization tool to read and write .sol files, and I have run into a problem when reading the .sol files generated by multiple non linear solvers, such as Ipopt, Knitro or Minos. This problem arises when the problem I am trying to solve has no contraints, apparently no matter how simple it may be, and is provided in a .nl binary file. For instance, I have modelled the following problem using AMPL:
var x <=10, >= 0;
minimize f: x;
option presolve 0;
write gproblem_asl_hex;
write bproblem_asl_binary;
I have attached a zip file where I've included a small program which will attempt to read a .sol file in the same way it's trying to be read in the bigger tool I'm working on. I've also included the .nl files generated by AMPL from the previous model, namely
as well as the .sol files generated in both the hexadecimal and binary cases by the non linear solvers mentioned above. The files are the following:
problem_asl_binary_ipopt.sol
problem_asl_binary_knitro.sol
problem_asl_binary_minos.sol
problem_asl_hex_ipopt.sol
problem_asl_hex_knitro.sol
problem_asl_hex_minos.sol
Should the program need to be compiled again, I've included all the necessary header files and possibly more. When compiled, a bunch of warnings arise because of the redefinition of variables, but from what I've seen they don't seem relevant to the process of reading the .sol file. Running the program to read one of the .sol files generated from the hexadecimal problem, for instance:
shouldn't cause any issues, but reading the .sol file generated from the binary problem by the same or any other or the non linear solvers provided:
returns "bad binary file problem_asl_binary_ipopt.sol", which I've tracked to some part of readsol.c in the GitHub, but I haven't been able to see where the issue is coming from. When I came across the problem for the first time, I wasn't using the newest version of the ASL library, but I've tested that the problem persists in the most recent commit (
594e911). In fact, the compiled library libasl.a I've attached was generated from this latest version.
Could you please point me to the problem? I've initially assumed it has to be caused on my end, somewhere in the source code I've attached, but I haven't been able to find a solution for it.
Best regards,
Samuel.