I am trying to organize my code since it is becoming too big!!
My simplified main.cpp is:
int main(int argc, char **argv)
Then I have a setAMPL.h file with
#include “ampl/ampl.h” *
extern ampl::Parameter iP_tSwi;
void readData(ampl::AMPL &in_ampl);
and a setAMPL.cpp where I would like to set the parameter and function:
void setAMPL::readData(ampl::AMPL &in_ampl)
setAMPL::iP_tSwi = in_ampl.getParameter(“t_swi”);
I’d like to do this since I might need to modify iP_tSwi in another function after solving…however I get an error
setAMPL.cpp:7:26: error: no matching function for call to ‘ampl::Parameter::Parameter()’
7 | ampl::Parameter setAMPL::iP_tSwi;
What am I doing wrong?? Can use an ampl::Parameter with extern as I would do with a double??
Thank you in advance
Have a nice day