Changeset 6515


Ignore:
Timestamp:
05/05/09 13:15:48 (5 years ago)
Author:
jdsiiro
Message:

Adding Jacobian support to Application diamond.

Location:
colin/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • colin/trunk/colin/Application.h

    r6329 r6515  
    2323//#include <colin/Application_Bounds.h> 
    2424#include <colin/Application_Gradient.h> 
     25#include <colin/Application_Jacobian.h> 
    2526#include <colin/Application_Hessian.h> 
    2627#include <colin/Application_RealDomain.h> 
     
    7172        < GetProblemTrait(ProblemT, linear_constraints) > , 
    7273     public Application_Include_Gradient<GetProblemTrait(ProblemT, gradients)>, 
     74     public Application_Include_Jacobian 
     75        < GetProblemTrait(ProblemT, gradients)  
     76          && GetProblemTrait(ProblemT, nonlinear_constraints) >, 
    7377     public Application_Include_Hessian<GetProblemTrait(ProblemT, hessians)> 
    7478{ 
  • colin/trunk/colin/Application_Gradient.h

    r6094 r6515  
    3434/** 
    3535 *  Defines the elements of an Application that pertain to problems 
    36  *  where gradient information is available. 
     36 *  where objective gradient information is available. 
    3737 */ 
    3838class Application_Gradient : virtual public Application_Base 
  • colin/trunk/colin/Application_Jacobian.h

    r6094 r6515  
    3131//============================================================================ 
    3232 
    33 extern const response_info_t cg_info; 
    34  
    3533/** 
    3634 *  Defines the elements of an Application that pertain to problems 
    37  *  where jacobian information is available. 
     35 *  where Jacobian (constraint gradient) information is available. 
    3836 */ 
    39 template <bool JacFlag> 
    4037class Application_Jacobian : virtual public Application_Base 
    4138{ 
     
    4340 
    4441   /// Constructor 
    45    Application_Jacobian() 
    46          : data(NULL) 
    47    {} 
     42   Application_Jacobian(); 
    4843 
    4944   /// Virtual destructor 
    50    virtual ~Application_Jacobian() 
    51    { unregister_derived_class(typeid(this)); } 
     45   virtual ~Application_Jacobian(); 
    5246 
    5347   /// Register a Jacobian evaluation computation 
    54    void Request_CG(AppRequest &request, 
    55                    utilib::AnyFixedRef result = utilib::Any(), 
    56                    bool recompute = false) 
    57    { record_compute_task(cg_info, request, result, recompute); } 
    58  
    59    /// Perform a Jacobian evaluation immediately 
    60    AppResponse EvalCG(const EvaluationManager &eval, 
    61                       const utilib::AnyRef& domain, 
    62                       utilib::AnyFixedRef result) 
    63    { 
    64       AppRequest req = set_domain(domain); 
    65       Request_CG(req, result); 
    66       return eval.perform_evaluation(req); 
    67    } 
    68  
    69    /// Perform a Jacobian evaluation asynchronously 
    70    EvaluationID AsyncEvalCG(const EvaluationManager &eval, 
    71                             const utilib::AnyRef& domain, 
    72                             utilib::AnyFixedRef result = utilib::Any(), 
    73                             evalPriority_t priority = 0) 
    74    { 
    75       AppRequest req = set_domain(domain); 
    76       Request_CG(req, result); 
    77       return eval.queue_evaluation(req, priority); 
    78    } 
     48   DECLARE_REQUEST(CG); 
    7949 
    8050protected: // methods 
     
    8252 
    8353protected: // data 
    84    class Application_Jacobian_DATA 
    85             : public Application_DATA_Base 
    86       {}; 
     54   /// 
     55   class Application_Jacobian_DATA; 
    8756 
     57   /// 
    8858   Application_Jacobian_DATA *data; 
    8959 
     
    9161 
    9262 
    93 /// Empty class if jacobians are not available 
    94 template <> 
    95 class Application_Jacobian<false> {}; 
     63template <bool active> 
     64class Application_Include_Jacobian 
     65   : public Application_Jacobian 
     66{}; 
     67 
     68template<> 
     69class Application_Include_Jacobian<false> 
     70{}; 
    9671 
    9772 
  • colin/trunk/src/Makefile.am

    r6114 r6515  
    4040Application_NonlinearConstraints.cpp\ 
    4141Application_Gradient.cpp\ 
     42Application_Jacobian.cpp\ 
    4243Application_Hessian.cpp\ 
    4344ApplicationMngr.cpp\ 
Note: See TracChangeset for help on using the changeset viewer.