Commit 1a80962c authored by Laurent Belcour's avatar Laurent Belcour

Compound with product bootstraping. It does not solve the issue when the...

Compound with product bootstraping. It does not solve the issue when the bootstrap is done with more depth to the compound tree.
parent 51dddacc
......@@ -488,11 +488,36 @@ void compound_function::bootstrap(const ::data* d, const arguments& args)
for(unsigned int i=0; i<fs.size(); ++i)
{
std::streampos pos = file.tellg();
/*
if(dynamic_cast<product_function*>(fs[i]) != NULL)
{
product_function* p = dynamic_cast<product_function*>(fs[i]);
nonlinear_function* f1 = p->first();
nonlinear_function* f2 = p->second();
pos = file.tellg();
if(!f1->load(file))
{
file.seekg(pos);
// Bootstrap the function as if it was not loaded
f1->bootstrap(d, args);
std::cout << "<<DEBUG>> Unable to load first function of product, regular bootstraping" << std::endl;
}
// If the second function cannot be loaded, put the input stream
// in the previous state and bootstrap normaly this function.
pos = file.tellg();
if(!f2->load(file))
{
file.seekg(pos);
// Bootstrap the function as if it was not loaded
f2->bootstrap(d, args);
std::cout << "<<DEBUG>> Unable to load second function of product, regular bootstraping" << std::endl;
}
}
*/
// If the function cannot be loaded, put the input stream
// in the previous state and bootstrap normaly this function.
......@@ -1087,3 +1112,13 @@ void product_function::setParametrization(params::output new_param)
f1->setParametrization(new_param);
f2->setParametrization(new_param);
}
nonlinear_function* product_function::first() const
{
return f1;
}
nonlinear_function* product_function::second() const
{
return f2;
}
......@@ -304,6 +304,15 @@ class product_function : public nonlinear_function
product_function(nonlinear_function* g1, nonlinear_function* g2);
/* ACCESS TO INDIVIDUAL ELEMENTS */
//! \brief Access to the first member of the product
nonlinear_function* first() const;
//! \biref Access to the second member of the product
nonlinear_function* second() const;
/* EVALUATION FUNCTIONS */
//! \brief Overload the function operator, directly call the value function.
......
......@@ -17,6 +17,7 @@ ALTA_DLL_EXPORT function* provide_function()
schlick::schlick()
{
setParametrization(params::CARTESIAN);
setDimX(6);
}
//! Load function specific files
......@@ -187,5 +188,5 @@ vec schlick::parametersJacobian(const vec& x) const
void schlick::bootstrap(const data* d, const arguments& args)
{
for(int i=0; i<dimY(); ++i) { R[i] = 0.000001; }
for(int i=0; i<dimY(); ++i) { R[i] = 0.1; }
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment