30. Defining Variables

In all of the optimization solvers, the application must provide a Vec object of appropriate dimension to represent the variables. This vector will be cloned by the solvers to create additional work space within the solver. If this vector is distributed over multiple processors, it should have a parallel distribution that allows for efficient scaling, inner products, and function evaluations. This vector can be passed to the application object using the routine
   TaoAppSetInitialSolutionVec(TAO_APPLICATION,Vec); 
When using this routine, the application should initialize the vector with an approximate solution of the optimization problem before calling the TAO solver. If you do not know of a solution that that can be used, the routine TaoAppSetDefaultSolutionVec(TAO_APPLICATION,Vec); can be used to declare variables that will in be set to zero or some other default solution.

This vector will be used by the TAO solver to store the solution. Elsewhere in the application, this solution vector can be retieved from the application object using the routine

   TaoAppGetSolutionVec(TAO_APPLICATION, Vec *); 
This routine takes the address of a Vec in the second argument and sets it to the solution vector used in the application.