diff --git a/packages/muelu/src/Utils/MueLu_AvatarInterface.cpp b/packages/muelu/src/Utils/MueLu_AvatarInterface.cpp index c5913e1c1919..7a411031a0dd 100644 --- a/packages/muelu/src/Utils/MueLu_AvatarInterface.cpp +++ b/packages/muelu/src/Utils/MueLu_AvatarInterface.cpp @@ -124,11 +124,17 @@ RCP AvatarInterface::GetValidParameterList() const { validParamList->set("avatar: good class",int_dummy,"Numeric code for class Avatar considers to be good"); // Which drop tol choice heuristic to use - validParamList->set("avatar: heuristic",int_dummy,"Numeric code for which heurisitc we want to use"); + validParamList->set("avatar: heuristic",int_dummy,"Numeric code for which heuristic we want to use"); // Bounds file for extrapolation risk validParamList->set >("avatar: bounds file",ar_dummy,"Bounds file for Avatar extrapolation risk"); + // Add dummy variables at the start + validParamList->set("avatar: initial dummy variables",int_dummy,"Number of dummy variables to add at the start"); + + // Add dummy variables before the class + validParamList->set("avatar: pre-class dummy variables",int_dummy,"Number of dummy variables to add at the before the class"); + return validParamList; } @@ -163,7 +169,9 @@ void AvatarInterface::Setup() { // Get the avatar strings (NOTE: Only exist on proc 0) avatarStrings_ = ReadFromFiles("avatar: decision tree files"); namesStrings_ = ReadFromFiles("avatar: names files"); - boundsString_ = ReadFromFiles("avatar: bounds file"); + if(params_.isParameter("avatar: bounds file")) + boundsString_ = ReadFromFiles("avatar: bounds file"); + filestem_ = params_.get>("avatar: filestem"); @@ -197,6 +205,14 @@ void AvatarInterface::Cleanup() { void AvatarInterface::GenerateFeatureString(const Teuchos::ParameterList & problemFeatures, std::string & featureString) const { // NOTE: Assumes that the features are in the same order Avatar wants them. std::stringstream ss; + + // Initial Dummy Variables + if (params_.isParameter("avatar: initial dummy variables")) { + int num_dummy = params_.get("avatar: initial dummy variables"); + for(int i=0; i & indices) co for(Teuchos_Ordinal i=0; i("avatar: pre-class dummy variables"); + for(int i=0; i boundsString) const { std::stringstream ss(trialString); - std::vector vect; + std::vector vect; - int useNewFeatures = 0; - - float i; - - while (ss >> i) - { - vect.push_back(i); - - if (ss.peek() == ',') - ss.ignore(); + double b; + while (ss >> b) { + vect.push_back(b); + if (ss.peek() == ',') ss.ignore(); } + + std::stringstream ssBounds(boundsString[0]); + std::vector boundsVect; - std::string bounds = const_cast(boundsString[0].c_str()); - - std::stringstream ssBounds(bounds); - std::vector boundsVect; - - float b; - - while (ssBounds >> b) - { - boundsVect.push_back(b); - - if (ssBounds.peek() == ',') - ssBounds.ignore(); + while (ssBounds >> b) { + boundsVect.push_back(b); + if (ssBounds.peek() == ',') ssBounds.ignore(); } - if (vect.at(3) > boundsVect.at(0) || vect.at(3) < boundsVect.at(1)) - return 0; - - if (vect.at(4) > boundsVect.at(2) || vect.at(4) < boundsVect.at(3)) - return 0; - - if (vect.at(5) > boundsVect.at(4) || vect.at(5) < boundsVect.at(5)) - return 0; - - if (vect.at(6) > boundsVect.at(6) || vect.at(6) < boundsVect.at(7)) - return 0; + int min_idx = (int) std::min(vect.size(),boundsVect.size()/2); - if (useNewFeatures == 1){ - if (vect.at(8) > boundsVect.at(8) || vect.at(8) < boundsVect.at(9)) - return 0; - - if (vect.at(9) > boundsVect.at(10) || vect.at(9) < boundsVect.at(11)) - return 0; - } + bool inbounds=true; + for(int i=0; inbounds && i acceptableCombos) const{