Difference for src/colvardeps.C from version 1.4 to 1.5

version 1.4version 1.5
Line 14
Line 14
 colvardeps::~colvardeps() { colvardeps::~colvardeps() {
   size_t i;   size_t i;
  
   for (i=0; i<feature_states.size(); i++) { 
     if (feature_states[i] != NULL) delete feature_states[i]; 
   } 
       // Do not delete features if it's static       // Do not delete features if it's static
 //     for (i=0; i<features.size(); i++) { //     for (i=0; i<features.size(); i++) {
 //       if (features[i] != NULL) delete features[i]; //       if (features[i] != NULL) delete features[i];
Line 35
Line 32
  
  
 void colvardeps::provide(int feature_id) { void colvardeps::provide(int feature_id) {
   feature_states[feature_id]->available = true;   feature_states[feature_id].available = true;
 } }
  
  
 void colvardeps::set_available(int feature_id, bool truefalse) { void colvardeps::set_available(int feature_id, bool truefalse) {
   feature_states[feature_id]->available = truefalse;   feature_states[feature_id].available = truefalse;
 } }
  
  
 void colvardeps::set_enabled(int feature_id, bool truefalse) { void colvardeps::set_enabled(int feature_id, bool truefalse) {
   feature_states[feature_id]->enabled = truefalse;   feature_states[feature_id].enabled = truefalse;
 } }
  
  
Line 74
Line 71
   size_t i, j;   size_t i, j;
   bool ok;   bool ok;
   feature *f = features()[feature_id];   feature *f = features()[feature_id];
   feature_state *fs = feature_states[feature_id];   feature_state *fs = &feature_states[feature_id];
  
   if (cvm::debug()) {   if (cvm::debug()) {
     cvm::log("DEPS: " + description +     cvm::log("DEPS: " + description +
Line 248
Line 245
   // Initialize feature_states for each instance   // Initialize feature_states for each instance
   feature_states.reserve(f_cvb_ntot);   feature_states.reserve(f_cvb_ntot);
   for (i = 0; i < f_cvb_ntot; i++) {   for (i = 0; i < f_cvb_ntot; i++) {
     feature_states.push_back(new feature_state(true, false));     feature_states.push_back(feature_state(true, false));
     // Most features are available, so we set them so     // Most features are available, so we set them so
     // and list exceptions below     // and list exceptions below
   }   }
  
   // some biases are not history-dependent   // some biases are not history-dependent
   feature_states[f_cvb_history_dependent]->available = false;   feature_states[f_cvb_history_dependent].available = false;
  
   // some biases do not compute a PMF   // some biases do not compute a PMF
   feature_states[f_cvb_calc_pmf]->available = false;   feature_states[f_cvb_calc_pmf].available = false;
  
   // by default, biases should work with vector variables, too   // by default, biases should work with vector variables, too
   feature_states[f_cvb_scalar_variables]->available = false;   feature_states[f_cvb_scalar_variables].available = false;
 } }
  
  
Line 354
Line 351
   // Initialize feature_states for each instance   // Initialize feature_states for each instance
   feature_states.reserve(f_cv_ntot);   feature_states.reserve(f_cv_ntot);
   for (i = 0; i < f_cv_ntot; i++) {   for (i = 0; i < f_cv_ntot; i++) {
     feature_states.push_back(new feature_state(true, false));     feature_states.push_back(feature_state(true, false));
     // Most features are available, so we set them so     // Most features are available, so we set them so
     // and list exceptions below     // and list exceptions below
    }    }
Line 372
Line 369
     f_cv_homogeneous     f_cv_homogeneous
   };   };
   for (i = 0; i < sizeof(unavailable_deps) / sizeof(unavailable_deps[0]); i++) {   for (i = 0; i < sizeof(unavailable_deps) / sizeof(unavailable_deps[0]); i++) {
     feature_states[unavailable_deps[i]]->available = false;     feature_states[unavailable_deps[i]].available = false;
   }   }
 } }
  
Line 425
Line 422
   // default as unavailable, not enabled   // default as unavailable, not enabled
   feature_states.reserve(f_cvc_ntot);   feature_states.reserve(f_cvc_ntot);
   for (i = 0; i < colvardeps::f_cvc_ntot; i++) {   for (i = 0; i < colvardeps::f_cvc_ntot; i++) {
     feature_states.push_back(new feature_state(false, false));     feature_states.push_back(feature_state(false, false));
   }   }
  
   // Features that are implemented by all cvcs by default   // Features that are implemented by all cvcs by default
   // Each cvc specifies what other features are available   // Each cvc specifies what other features are available
   feature_states[f_cvc_active]->available = true;   feature_states[f_cvc_active].available = true;
   feature_states[f_cvc_gradient]->available = true;   feature_states[f_cvc_gradient].available = true;
  
   // Features that are implemented by default if their requirements are   // Features that are implemented by default if their requirements are
   feature_states[f_cvc_one_site_total_force]->available = true;   feature_states[f_cvc_one_site_total_force].available = true;
  
   // Features That are implemented only for certain simulation engine configurations   // Features That are implemented only for certain simulation engine configurations
   feature_states[f_cvc_scalable_com]->available = (cvm::proxy->scalable_group_coms() == COLVARS_OK);   feature_states[f_cvc_scalable_com].available = (cvm::proxy->scalable_group_coms() == COLVARS_OK);
   feature_states[f_cvc_scalable]->available = feature_states[f_cvc_scalable_com]->available;   feature_states[f_cvc_scalable].available = feature_states[f_cvc_scalable_com].available;
 } }
  
  
Line 474
Line 471
   // default as unavailable, not enabled   // default as unavailable, not enabled
   feature_states.reserve(f_ag_ntot);   feature_states.reserve(f_ag_ntot);
   for (i = 0; i < colvardeps::f_ag_ntot; i++) {   for (i = 0; i < colvardeps::f_ag_ntot; i++) {
     feature_states.push_back(new feature_state(false, false));     feature_states.push_back(feature_state(false, false));
   }   }
  
   // Features that are implemented (or not) by all atom groups   // Features that are implemented (or not) by all atom groups
   feature_states[f_ag_active]->available = true;   feature_states[f_ag_active].available = true;
   // f_ag_scalable_com is provided by the CVC iff it is COM-based   // f_ag_scalable_com is provided by the CVC iff it is COM-based
   feature_states[f_ag_scalable_com]->available = false;   feature_states[f_ag_scalable_com].available = false;
   // TODO make f_ag_scalable depend on f_ag_scalable_com (or something else)   // TODO make f_ag_scalable depend on f_ag_scalable_com (or something else)
   feature_states[f_ag_scalable]->available = true;   feature_states[f_ag_scalable].available = true;
 } }
  
  
Line 490
Line 487
   size_t i;   size_t i;
   cvm::log("Enabled features of " + description);   cvm::log("Enabled features of " + description);
   for (i = 0; i < feature_states.size(); i++) {   for (i = 0; i < feature_states.size(); i++) {
     if (feature_states[i]->enabled)     if (feature_states[i].enabled)
       cvm::log("- " + features()[i]->description);       cvm::log("- " + features()[i]->description);
   }   }
   for (i=0; i<children.size(); i++) {   for (i=0; i<children.size(); i++) {


Legend:
Removed in v.1.4 
changed lines
 Added in v.1.5



Made by using version 1.53 of cvs2html