A Mathematica implementation of SolvOpt
- To: mathgroup at smc.vnet.net
- Subject: [mg88567] A Mathematica implementation of SolvOpt
- From: tommcd <TCMcDermott at gmail.com>
- Date: Fri, 9 May 2008 03:20:46 -0400 (EDT)
Hi, I recently uploaded a Mathematica implementation of SolvOpt (an implementation of Shor's r algorithm for the minimization of nonlinear, possibly non-smooth objective functions) to http://www.mathematica-users.org/webMathematica/wiki/wiki.jsp?pageName=Shor_Optimization The main package is SolvOpt.m, with shorTest.m and the notebook SolvOptTest.nb being for demonstration purposes. The original (Fortran, C, and other) implementations and documentation are available at http://www.uni-graz.at/imawww/kuntsevich/solvopt/ As this is my 1st mathematica package (I've only ever used notebooks interactively before) I'd appreciate any suggestions or constructive criticism, especially with regard to efficiency and style. For example I'd like a more efficient and elegant way to express Do[ deltax[[j]] = If[ g0[[j]] >= 0.0, h1*ddx, -h1*ddx] , {j,n} ]; which in Fortran 95 can be written very clearly as Where(g0 >= 0.0) g0 = h1*ddx ElseWhere g0 = -h1*ddx End Where where g0 can be any array of up to 7 dimensions, & any number of array assignments can appear in each section (not just the one shown here), moreover the 'Where' can itself be nested inside another where etc.. For now a construct which works for the 1D list above and avoids the do loop would be fine, though if there is a general method for masked array assignments in Mathematica I love to hear about it. Regards, Tom
- Follow-Ups:
- Re: A Mathematica implementation of SolvOpt
- From: Carl Woll <carlw@wolfram.com>
- Re: A Mathematica implementation of SolvOpt