Commit dc730999 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Merge

parent cd1374a7
......@@ -24,7 +24,15 @@ vec blinn_function::value(const vec& x) const
vec res(dimY());
for(int i=0; i<dimY(); ++i)
{
res[i] = _ks[i] * std::pow(x[0], _N[i]);
// Check if the cosine is below the hoziron
if(x[0] > 0.0)
{
res[i] = _ks[i] * std::pow(x[0], _N[i]);
}
else
{
res[i] = 0.0;
}
}
return res;
......@@ -120,15 +128,20 @@ vec blinn_function::parametersJacobian(const vec& x) const
{
if(i == j)
{
// df / dk_s
jac[i*nbParameters() + j*2+0] = std::pow(x[0], _N[j]);
// df / dN
if(x[0] == 0.0)
jac[i*nbParameters() + j*2+1] = 0.0;
// Test if the configuration is below the horizon
if(x[0] <= 0.0)
{
jac[i*nbParameters() + j*2+0] = 0.0;
jac[i*nbParameters() + j*2+1] = 0.0;
}
else
{
// df / dk_s
jac[i*nbParameters() + j*2+0] = std::pow(x[0], _N[j]);
// df / dN
jac[i*nbParameters() + j*2+1] = _ks[j] * std::log(x[0]) * std::pow(x[0], _N[j]);
}
}
else
{
......@@ -146,7 +159,7 @@ void blinn_function::bootstrap(const data* d, const arguments& args)
for(int i=0; i<dimY(); ++i)
{
_ks[i] = 1.0;
_N[i] = 1.0;
_N[i] = 10.0;
}
}
......
......@@ -68,7 +68,7 @@ class blinn_function : public nonlinear_function
virtual params::input input_parametrization() const
{
return params::COS_TH ;
}
}
void setDimY(int nY)
{
......
......@@ -17,12 +17,16 @@
* loading plugin is defined using the option <b>\-\-in-data <i>
* filename</i></b>.
* </li>
* <li><b>\-\-in-data <i>filename</i></b></li> specify the data plugin
* <li><b>\-\-in-data <i>filename</i></b> specify the data plugin
* used to load the input file. If this option is not specified, the
* loading plugin will be a \ref vertical_segment plugin. \note If
* the input plugin is not interpolating, like \ref vertical_segment,
* you can only use the reparametrization tool.
* <li><b>\-\-input <i>filename</i></b> the resulting data file.
* you can only use the reparametrization tool.</li>
* <li><b>\-\-output <i>filename</i></b> the resulting data file.
* </li>
* <li><b>\-\-out-data <i>filename</i></b></li> specify the data plugin
* used to export the data. This parameter is optional. If not defined,
* the output format will be ALTA's \ref format.
* </li>
* </ul>
*/
......
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