forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 6:59 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.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: minbleicoptimize slower in commercial version
PostPosted: Fri Jun 20, 2014 9:36 pm 
Offline

Joined: Fri Jun 20, 2014 9:28 pm
Posts: 1
Hello,

I tested both free and commercial versions of Alglib in C#.

My test works properly with the free version ~700 optimizations with N=500. But when I switch to Managed or Native version it becomes really really slow when N>150, I cannot even finish my test.
I am running this on a 64bit - 4 cores - 8G windows 2008 server.

Is there any extra parameter to define in the comercial version which is not required in the free version?
With the free version I was calling the following method: alglib.minbleicsetoutercond(state, _epso, _epsi).
This method does not exist in the commercial version, could it explain the difference?

With the free version all my optimization ends with return code=4.

I would really appreciate your help. Thank you

Code with free version:
private int OptimizeWithGradient(alglib.ndimensional_grad grad)
{
alglib.minbleicstate state;
alglib.minbleicreport rep;
alglib.minbleiccreate(_x0, out state);
alglib.minbleicsetbc(state, _l, _u);
if (_constraints != null)
{
alglib.minbleicsetlc(state, _constraints, _constraintsSide);
}

alglib.minbleicsetinnercond(state, _epsg, _epsf, _epsx);
alglib.minbleicsetoutercond(state, _epso, _epsi);
alglib.minbleicoptimize(state, grad, null, null);
alglib.minbleicresults(state, out _s, out rep);

return rep.terminationtype;
}

Code with commercial version:
private int OptimizeWithGradient(alglib.ndimensional_grad grad)
{
alglib.minbleicstate state;
alglib.minbleicreport rep;

alglib.minbleiccreate(_x0, out state);

alglib.minbleicsetbc(state, _l, _u);

if (_constraints != null)
{
alglib.minbleicsetlc(state, _constraints, _constraintsSide);
}

alglib.minbleicsetcond(state, _epsg, _epsf, _epsx,_maxIts);
alglib.minbleicoptimize(state, grad, null, null);
alglib.minbleicresults(state, out _s, out rep);

return rep.terminationtype;
}


Top
 Profile  
 
 Post subject: Re: minbleicoptimize slower in commercial version
PostPosted: Mon Jun 23, 2014 6:26 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hello! I replied to you by e-mail, answer is duplicated here for other ALGLIB users.

That's because you compared different versions of ALGLIB - most recent commercial edition (3.8.2) with older release of free edition (3.6.0 or earlier). BLEIC algorithm was changed in ALGLIB 3.7.0, and although this change generally resulted in better convergence, in your situation old algorithm is far more better. I.e., is it not "free-vs-commercial", it is "3.8.2-vs-3.6.0" question.

Old versions of ALGLIB used Augmented Lagrangian algorithm (AUL) to solve linearly constrained problem, in ALGLIB 3.7.0 it was changed to active sets method. AUL algorithm has lesser precision (constraints are satisfied only approximately, usually with relative error as large as 0.0001), and in most cases it required far more iterations than active sets method. Furthermore, it requires some manual tweaking (tuning barrier width and outer stopping criteria). Active sets method is more robust and does not require such tweaking.

It turned out after your report that in some cases AUL method gives better results. I think that I will reintroduce AUL method in 3.9.0... As for your situation, in my e-mail I offered two possible solutions.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 28 guests


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

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group