# forum.alglib.net

ALGLIB forum
 It is currently Fri Aug 09, 2024 6:43 pm

 All times are UTC

### Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Integer programing for non-smooth nonlinear functionsPosted: Mon Nov 21, 2022 6:17 pm

Joined: Mon Nov 21, 2022 4:40 pm
Posts: 1
How can I apply integer programming to minns?

I have variables that are integers and not real numbers.

Code:
FILE *fostate = freopen("../logs/optimization/execution.log", "w", stdout);
FILE *festate = freopen("../logs/optimization/error.log", "w", stderr);

alglib::real_1d_array x = "[1, 1, 1]";
alglib::real_1d_array s = "[1, 1, 1]";
alglib::real_1d_array bndl = "[+0.1, 1, 0.1]";
alglib::real_1d_array bndu = "[18, 3, 5]";
alglib::ae_int_t maxits = 0;
double epsx = 0.001;
double diffstep = 0.01;
double radius = 0.1;
double rho = 0.0;

alglib::minnsstate state;
alglib::minnsreport rep;

alglib::minnscreatef(3, x, diffstep, state);
std::cout << "successfully created objective variables\n";

std::cout << "successfully sat goals\n";

minnssetbc(state, bndl, bndu);
std::cout << "successfully created cinstraints boudries\n";

alglib::minnssetcond(state, epsx, maxits);
std::cout << "successfully sat algorithm conditions\n";

alglib::minnssetscale(state, s);
std::cout << "successfully sat scale\n";

try
{
std::cout << "optimization is starting ..............\n";
std::cout << "-----------------------------------------------\n";
alglib::minnsoptimize(state, nnetwork);

alglib::minnsresults(state, x, rep);
std::cout << "solved the optimization problem\n";
}
catch (alglib::ap_error e)
{
std::cerr << "error msg: %s\n" << e.msg.c_str();
}

std::cout << "x = " << x.tostring(3) << std::endl;

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 77 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ ALGLIB forum    ALGLIB-discuss
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group