Sandia Home Sandia Home
Main Page | Publications | Downloads | Configuration | Running the Code | Solver Parameters | FAQ | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

example5.cpp File Reference


Detailed Description

Example with linear equality and inequality constraints.

Example 5 function evaluation progam. This function evaluation expects its input to come from a text file, and it writes its output to to a text file.

The test problem is:

\[ \begin{array}{ll} {\rm min} & (x_1 - 10)^2 + (x_2 - 10)^2 + (x_3 - 10)^2 + (x_4 - 10)^2\\ \mbox{s.t.} & -10 \le -x_1 - x_2 - x_3 -x_4 \\ & x_1 - x_2 + x_3 - x_4 \le -1 \\ & 2x_1 + 2x_3 \le 9 \\ & 2x_1 + 2x_3 - 7x_4 = 3 \\ & -10 \le x_1 \\ & -10 \le x_2,x_4 \le 10 \\ & x_3 \le 10 \\ \end{array} \]

All of the linear inequality, linear equality, and bound constraints are defined in the file example4.apps, where we also define the scaling and initial point as:

\[ s = \begin{bmatrix}1\\1\\1\\1 \end{bmatrix}, \quad x^{(0)} = \begin{bmatrix}-1\\1\\-1\\-1 \end{bmatrix} \]

Definition in file example5.cpp.

#include <iostream>
#include <fstream>
#include <vector>

Include dependency graph for example5.cpp:

Include dependency graph

Go to the source code of this file.

Functions

double feval (const vector< double > &x)
 Function Evaluation.
int main (int argc, char *argv[])
 Main.


Function Documentation

double feval const vector< double > &  x  ) 
 

Function Evaluation.

Definition at line 78 of file example5.cpp.

int main int  argc,
char *  argv[]
 

Main.

Definition at line 88 of file example5.cpp.

References feval().

 

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Fri Feb 16 10:33:35 2007 for APPSPACK 5.0.1 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2002