1 #include "Epetra_ConfigDefs.h" 4 #include "Epetra_MpiComm.h" 6 #include "Epetra_SerialComm.h" 9 #include "Teuchos_CommandLineProcessor.hpp" 10 #include "Teuchos_StandardCatchMacros.hpp" 11 #include "Teuchos_ParameterList.hpp" 12 #include "Teuchos_XMLParameterListCoreHelpers.hpp" 14 #include <boost/random/mersenne_twister.hpp> 15 #include <boost/random/uniform_real_distribution.hpp> 16 #include <boost/math/special_functions/erf.hpp> 17 #include <boost/random/normal_distribution.hpp> 18 #include <boost/math/special_functions/gamma.hpp> 19 #include <boost/math/special_functions/beta.hpp> 21 int main(
int argc,
char *argv[]){
23 std::string xmlInFileName =
"";
24 std::string extraXmlFile =
"";
25 std::string xmlOutFileName =
"paramList.out";
27 Teuchos::CommandLineProcessor clp(
false);
28 clp.setOption(
"xml-in-file",&xmlInFileName,
"The XML file to read into a parameter list");
29 clp.setDocString(
"TO DO.");
31 Teuchos::CommandLineProcessor::EParseCommandLineReturn
32 parse_return = clp.parse(argc,argv);
33 if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
34 std::cout <<
"\nEnd Result: TEST FAILED" << std::endl;
39 MPI_Init(&argc, &argv);
40 Epetra_MpiComm Comm(MPI_COMM_WORLD);
42 Epetra_SerialComm Comm;
45 Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(
new Teuchos::ParameterList);
46 if(xmlInFileName.length()) {
47 Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
49 paramList->print(std::cout,2,
true,
true);
58 double alpha = 1.0/(0.1*0.1);
59 double beta = 1771.0*0.1*0.1;
60 for (
int i=0;
i<n; ++
i){
61 v = a + (b-a)*
double(
i)/double(n-1);
62 double erfx = boost::math::erf<double>(v/std::sqrt(2.0));
63 double y = (1.0/2.0)*(1.0 + erfx);
64 double yinv = boost::math::gamma_p_inv<double,double>(alpha,y);
67 std::cout << v << std::setw(15) << g <<
"\n";
int main(int argc, char *argv[])