A simple example of a function evaluation that takes its input from a text file, and it writes a single objective value or an error message to an output file.
In this case, the two-dimensional example function is:
And there is also a constraint:
If the constraint is violated, then an error message is printed to the output file rather than the function value.
The input file example2.apps, to be used with example2.cpp, includes the following lower and upper bounds and initial point:
Definition in file example2.cpp.
#include <iostream>
#include <fstream>
#include <vector>
Include dependency graph for example2.cpp:

Go to the source code of this file.
Functions | |
| double | feval (const vector< double > &x) |
| Function Evaluation. | |
| bool | constraint (vector< double > &x) |
| Nonlinear Constraint. | |
| int | main (int argc, char *argv[]) |
| Main. | |
|
|
Function Evaluation.
Definition at line 81 of file example2.cpp. |
|
|
Nonlinear Constraint.
Definition at line 93 of file example2.cpp. |
|
||||||||||||
|
Main.
Definition at line 105 of file example2.cpp. References constraint(), and feval(). |
![]()
© Sandia Corporation | Site Contact | Privacy and Security
![]()
Generated on Fri Feb 16 10:33:35 2007 for APPSPACK 5.0.1 by
1.3.9.1 written by Dimitri van Heesch,
© 1997-2002