49 Teuchos::VerboseObjectBase::getDefaultOStream();
50 writeParameterListToXmlOStream(*theList, *out);
78 stringFoodTypeValidator =
rcp(
79 new StringToIntegralParameterEntryValidator<int>(
80 tuple<std::string>(
"Cheese",
"Soda",
"Chips" )
86 cheeseValidator =
rcp(
87 new StringToIntegralParameterEntryValidator<int>(
88 tuple<std::string>(
"Swiss",
"American",
"Super Awesome Cheese" )
94 new StringToIntegralParameterEntryValidator<int>(
95 tuple<std::string>(
"Pepsi",
"Coke",
"Kurtis Cola",
"Bad Cola" )
100 chipsValidator =
rcp(
101 new StringToIntegralParameterEntryValidator<int>(
102 tuple<std::string>(
"Lays",
"Doritos",
"Kurtis Super Awesome Brand" )
107 StringValidatorDependency::ValueToValidatorMap testValidatorMap1;
108 testValidatorMap1[
"Cheese"] = cheeseValidator;
109 testValidatorMap1[
"Soda"] = sodaValidator;
110 testValidatorMap1[
"Chips"] = chipsValidator;
114 stringValiDepList = My_deplist->
sublist(
"String Validator Dependency",
false,
"String Validator Dependency testing list.\nWorking June 27th 2009");
115 stringValiDepList.
set(
"Food Selector",
"Swiss",
"select the food you want", cheeseValidator);
116 stringValiDepList.
set(
"Food Type",
"Cheese",
"String Validator Dependency Tester", stringFoodTypeValidator);
118 new StringValidatorDependency(
121 testValidatorMap1 )));
125 stringRangeValidator =
rcp(
126 new StringToIntegralParameterEntryValidator<int>(
127 tuple<std::string>(
"1-10",
"10-33",
"50-60" )
132 stringValiDepList2 = My_deplist->
sublist(
"String Validator Dependency (other validators)",
false,
"String Validator Dependency testing list for EnhancedNumber Validators.");
133 stringValiDepList2.
set(
"Range selector",
"1-10",
"selects the range to validate", stringRangeValidator);
140 StringValidatorDependency::ValueToValidatorMap rangeValidatorMap1;
141 rangeValidatorMap1[
"1-10"] = range110Vali;
142 rangeValidatorMap1[
"10-33"] = range1033Vali;
143 rangeValidatorMap1[
"50-60"] = range5060Vali;
144 stringValiDepList2.
set(
"RangeValue", 3,
"the value of the range", range110Vali);
146 new StringValidatorDependency(
149 rangeValidatorMap1)));
153 boolValidatorDepList = My_deplist->
sublist(
"Bool Validator Dependency List",
false,
"Bool Validator Dependency testing list.\nWorking June 27th 2009");
154 boolValidatorDepList.
set(
"Use Validator?",
true,
"truns the validator on and off");
157 boolValidatorDepList.
set(
"do I have a validator?", 4,
"does it have a validator?", basicVali);
159 new BoolValidatorDependency(
167 lowTempCheeseValidator =
rcp(
168 new StringToIntegralParameterEntryValidator<int>(
169 tuple<std::string>(
"PepperJack",
"Swiss",
"American" )
175 highTempCheeseValidator =
rcp(
176 new StringToIntegralParameterEntryValidator<int>(
177 tuple<std::string>(
"Munster",
"Provalone",
"Kurtis Super Awesome Cheese")
182 rangeValidatorDepList = My_deplist->
sublist(
"Range Validator and NumberVisual Dependency List",
false,
"Range Validator and Number Visual Dependency testing list.");
183 rangeValidatorDepList.
set(
"Temperature",101.0,
"The temperature of the fondue");
184 rangeValidatorDepList.
set(
"Cheese to Fondue",
"Swiss",
"The cheese we'll be using in our fondue pot.", lowTempCheeseValidator);
185 RangeValidatorDependency<double>::RangeToValidatorMap tempranges;
186 tempranges[std::pair<double,double>(100,200)] = lowTempCheeseValidator;
187 tempranges[std::pair<double,double>(200,300)] = highTempCheeseValidator;
189 new RangeValidatorDependency<double>(
197 new SubtractionFunction<double>(100));
207 numberArrayLengthDepList = My_deplist->
sublist(
"Number Array Length Dependency List",
false,
"Number Array Length ependecy testing list.");
208 numberArrayLengthDepList.
set(
"Array Length", 8,
"array length setter");
212 numberArrayLengthDepList.
set(
"Variable Length Array", variableLengthArray,
"variable length array",
213 RCP<ArrayNumberValidator<double> >(
new ArrayNumberValidator<double>(varLengthArrayVali)));
216 new NumberArrayLengthDependency<int, double>(My_deplist->
getEntryRCP(
"Array Length"),
217 My_deplist->
getEntryRCP(
"Variable Length Array")));
223 numberValiAspDepList = My_deplist->
sublist(
"Number Validator Aspect Dependency List",
false,
"Number Validator Aspect Dependency testing list.");
226 numberValiAspDepList.
set(
"Int", 8,
"Int tester", intVali2);
227 numberValiAspDepList.
set(
"Int2", 8,
"int2 tester", intVali2);
228 numberValiAspDepList.
set(
"Int dependee", 1,
"Int dependee");
231 boolVisDepList = My_deplist->
sublist(
"Bool Visual Dependency List",
false,
"Bool Visual Dependency testing list.");
232 boolVisDepList.
set(
"ShowPrecs",
true,
"Whether or not to should the Preciondtioner list");
234 Prec_List0 = boolVisDepList.
sublist(
"Preconditioner",
false,
"Sublist that defines the preconditioner.");
235 Prec_List0.
set(
"Type",
"ILU",
"The tpye of preconditioner to use");
237 Prec_List0.
set(
"Drop Tolerance", 1e-3
238 ,
"The tolerance below which entries from the\n""factorization are left out of the factors.", droptolValidator);
249 stringVisDepList = My_deplist->
sublist(
"String Visual Dependency List",
false,
"String Visual Dependency testing list.\nWorking June 29 2009");
251 favCheeseValidator =
rcp(
252 new StringToIntegralParameterEntryValidator<int>(
253 tuple<std::string>(
"Swiss",
"American",
"Cheder" )
258 stringVisDepList.
set(
259 "Favorite Cheese",
"American",
"Your favorite type of cheese", favCheeseValidator);
261 stringVisDepList.
set(
"Swiss rating", 0,
"How you rate swiss on a scale of 1 to 10", swissValidator);
275 rcp(
new SubtractionFunction<int>(32));
277 numberVisDepList = My_deplist->
sublist(
278 "Number Visual Dependency List",
false,
279 "Number Visual Dependency testing list.");
280 numberVisDepList.
set(
"Ice", 50,
"Ice stuff");
281 numberVisDepList.
set(
"Room Temp", 10,
"Room temperature");
284 new NumberVisualDependency<int>(
296 getInput(My_deplist, depSheet1, myFunc);
298 std::cout <<
"Dep List: \n";
299 writeParameterListToXmlOStream(*My_deplist, *out);
301 std::cout <<
"Deps: \n";
RCP< ParameterEntry > getEntryRCP(const std::string &name)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
A collection of functions and an Object that serve as the primary interface to the Optika package all...
RCP< ParameterList > sublist(const RCP< ParameterList > ¶mList, const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
void printDeps(std::ostream &out) const
void addDependency(RCP< Dependency > dependency)
void getInput(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet, void(*customFunc)(RCP< const ParameterList >))
Retreives the input for a Teuchos Parameter List using a GUI. Note the Parameter List will be edited...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void RUN_OPTIKA_DEPENDENCY_AND_EXEC_TEST()
basic_FancyOStream< char > FancyOStream
void print(Teuchos::RCP< const Teuchos::ParameterList > theList)