47.4. SetUp Routine

If this routine has been set by the initialization routine, TAO will call it during the TaoSetApplication(). This routine is optional, but is often a used to allocate the gradient vector, work vectors, and other data structures required by the solver. It should have the form
int TaoSetUp_CG(TAO_SOLVER,void*); 
{ 
  int    info; 
  TaoVec *xx; 
  TaoFunctionBegin; 
 
  info = TaoGetSolution(tao,&xx);CHKERRQ(info); 
  info = xx->Clone(&cg->gg); CHKERRQ(info); 
  info = xx->Clone(&cg->ww); CHKERRQ(info); 
  info = xx->Clone(&cg->dx); CHKERRQ(info); 
  TaoFunctionReturn(0); 
} 
The second argument can be cast to the appropriate data structure. Many solvers use a similar routine to allocate data structures needed by the solver but not created by the initialization routine.