/[ascend]/trunk/solvers/ipopt/asc_ipopt.c
ViewVC logotype

Diff of /trunk/solvers/ipopt/asc_ipopt.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1770 by jpye, Wed May 7 07:06:36 2008 UTC revision 1771 by jpye, Mon May 12 04:28:04 2008 UTC
# Line 468  Bool ipopt_eval_grad_f(Index n, Number* Line 468  Bool ipopt_eval_grad_f(Index n, Number*
468      variables = ASC_NEW_ARRAY(int,len);      variables = ASC_NEW_ARRAY(int,len);
469      derivatives = ASC_NEW_ARRAY(double,len);      derivatives = ASC_NEW_ARRAY(double,len);
470    
471        CONSOLE_DEBUG("allocated variables,derivatives");
472    
473      relman_diff2(      relman_diff2(
474          sys->obj,&vfilter,derivatives,variables          sys->obj,&vfilter,derivatives,variables
475          , &count,SLV_PARAM_BOOL(&(sys->p),IPOPT_PARAM_SAFEEVAL)          , &count,SLV_PARAM_BOOL(&(sys->p),IPOPT_PARAM_SAFEEVAL)
# Line 477  Bool ipopt_eval_grad_f(Index n, Number* Line 479  Bool ipopt_eval_grad_f(Index n, Number*
479          grad_f[variables[j]] = derivatives[j];          grad_f[variables[j]] = derivatives[j];
480      }      }
481    
482      ASC_FREE(variables);      if(variables)ASC_FREE(variables);
483      ASC_FREE(derivatives);      if(derivatives)ASC_FREE(derivatives);
484    
485        CONSOLE_DEBUG("done ipopt_eval_grad_f");
486      return 1; /* success, presumably */      return 1; /* success, presumably */
487  }  }
488    
# Line 513  Bool ipopt_eval_jac_g(Index n, Number* x Line 516  Bool ipopt_eval_jac_g(Index n, Number* x
516      sys = SYS(user_data);      sys = SYS(user_data);
517      int i,res;      int i,res;
518    
519        CONSOLE_DEBUG("ipopt_eval_jac_g");
520    
521        if(!iRow || !jCol){
522            CONSOLE_DEBUG("sparsity structure requested");
523        }
524    
525      asc_assert(sys!=NULL);      asc_assert(sys!=NULL);
526      asc_assert(n==sys->n);      asc_assert(n==sys->n);
527      asc_assert(nele_jac==sys->nnzJ);      asc_assert(nele_jac==sys->nnzJ);
# Line 527  Bool ipopt_eval_jac_g(Index n, Number* x Line 536  Bool ipopt_eval_jac_g(Index n, Number* x
536      for(i=0; i<m; ++i){      for(i=0; i<m; ++i){
537          /* get derivatives for constraint i */          /* get derivatives for constraint i */
538          /* insert the derivatives into the matrix in row i, columns j */          /* insert the derivatives into the matrix in row i, columns j */
539      }      }  
540    
541        CONSOLE_DEBUG("done ipopt_eval_jac_g");
542    
543      return 0; /* fail: not yet implemented */      return 0; /* fail: not yet implemented */
544  }  }

Legend:
Removed from v.1770  
changed lines
  Added in v.1771

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22