/*
 * $Id: solvopt.h,v 1.1 2007/03/16 21:58:45 gfuer Exp $
 *
 * SOLVOPT version 1.1 (June, 1997)
 * by Alexei Kuntsevich and Franz Kappel
 * University of Graz, Austria
 *
 * http://www.uni-graz.at/imawww/kuntsevich/solvopt
 *
 * Modified by Gerhard Fuernkranz for use in lprof
 *
 * With the kind permisson of the authors, SolvOpt is distributed
 * as part of lprof under the terms of the GNU GPL.
 *
 *	Lieber Herr Fürnkranz,
 *	Ihre Frage bezüglich der Nutzung von SolvOpt kann ich mit "ja"
 *	beantworten. Wir haben den Begriff "freeware" in diesem Sinne
 *	verstanden.
 *
 *	Mit freundlichen Grüßen,
 *	F. Kappel 
 *
 *	-----Ursprüngliche Nachricht-----
 *	Von: gfuer@web.de [mailto:gfuer@web.de] 
 *	Gesendet: Dienstag, 13. März 2007 23:10
 *	An: Kappel, Franz (franz.kappel@uni-graz.at)
 *	Betreff: Frage zur SolvOpt-Nutzung
 *
 *	Sehr geehrter Herr Kappel,
 *
 *	auf der Solvopt-Home-Page schreiben Sie "SolvOpt is a freeware...". Da
 *	"Freeware" jedoch kein genau definierter, rechtsgültiger Begriff ist,
 *	und ich auch in den Sourcen keine Copyright-Vermerke und/oder
 *	Nutzungsbedingungen finde, möchte ich gerne bei Ihnen explizit anfragen,
 *	ob Sie zustimmen würden, dass der SolvOpt-Quellcode unter den
 *	Bedingungen der GNU GPL benutzt und weiterverteilt werden darf, sodass
 *	eine Integration mit anderen freien Softwareprogrammen, die ebenfalls
 *	der GNU GPL untestellt oder GLP-kompatibel sind, ermöglicht wird.
 *
 *	Mit freundlichen Grüßen,
 *	Gerhard Fürnkranz
 *
 * THIS SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 *
 * IN NO EVENT SHALL MARTI MARIA BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
 * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
 * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
 * OF THIS SOFTWARE.
 *
 * This file is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __solvopt_H
#define __solvopt_H

typedef double SOLVOPTOPTIONS[13];

extern double
cmsxSolvOpt(unsigned short n, double x[],
            double fun(void *, double[]), void grad(void *, double[], double[]),
            SOLVOPTOPTIONS options,
            double func(void *, double[]), void gradc(void *, double[], double[]),
            void *cargo);

extern void
cmsxApprGrdn(void *cargo, unsigned short n,
             double g[], double x[], double f,
             double fun (void *, double[]),
             double deltax[], unsigned obj);

void
cmsxSolvOptInitOptions(SOLVOPTOPTIONS options);

/*
   options[0]= H, where sign(H)=-1 resp. sign(H)=+1 means minimize
               resp. maximize FUN (valid only for unconstrained problem)
               and H itself is a factor for the initial trial step size 
               (options[0]=-1.e0 by default),
   options[1]= relative error for the argument
               in terms of the max-norm (1.e-4 by default),
   options[2]= relative error for the function value (1.e-6 by default),
   options[3]= limit for the number of iterations (15000 by default),
   options[4]= control of the display of intermediate results and
               error resp. warning messages (default value is 0,
               i.e., no intermediate output but error and warning
               messages),
   options[5]= admissible maximal residual for a set of constraints
               (options[5]=1.e-8 by default),
  @options[6]= the coefficient of space dilation (2.5 by default),
  @options[7]= the lower bound for the stepsize used for the finite
               difference approximation of gradients (1.e-11 by default).
   (@ ... changes should be done with care)

  Returned optional values:

   options[8], the number of iterations, options[8]<0 means 
               an error occured,
   options[9], the number of objective function evaluations,
   options[10],the number of gradients evaluations,
*/

#endif /* __solvopt_H */

