Commit 9d89132e authored by Laurent Belcour's avatar Laurent Belcour

Changing some throw into comprehensible messages.

parent 06db04e0
......@@ -111,6 +111,9 @@ class data_params : public data
data_params::clustrering method = data_params::NONE) :
_clustering_method(method)
{
setParametrization(new_param);
setParametrization(d->output_parametrization());
_nX = params::dimension(new_param);
_nY = d->dimY();
......
......@@ -119,7 +119,8 @@ void params::to_cartesian(const double* invec, params::input intype,
break;
default:
throw("Transformation not implemented, params::to_cartesian");
std::cerr << "<<ERROR>> Transformation not implemented, " << get_name(intype) << " " << __FILE__ << ":" << __LINE__ << std::endl;
throw;
break;
}
......@@ -179,9 +180,8 @@ void params::from_cartesian(const double* invec, params::input outtype,
break;
case params::ISOTROPIC_TV_TL_DPHI:
outvec[0] = acos(invec[2]);
outvec[1] = 0.0;
outvec[2] = acos(invec[5]);
outvec[3] = atan2(invec[1], invec[0]) - atan2(invec[4], invec[3]);
outvec[1] = acos(invec[5]);
outvec[2] = atan2(invec[1], invec[0]) - atan2(invec[4], invec[3]);
break;
// 4D Parametrization
......@@ -216,7 +216,7 @@ void params::from_cartesian(const double* invec, params::input outtype,
break;
default:
std::cout << "<<ERROR>> not defined input param: " << get_name(outtype) << std::endl;
std::cerr << "<<ERROR>> Transformation not implemented, " << get_name(outtype) << " " << __FILE__ << ":" << __LINE__ << std::endl;
assert(false);
break;
}
......
......@@ -88,7 +88,9 @@ vec isotropic_lafortune_function::value(const vec& x, const vec& p) const
const double d = Cx*(dx + dy) + Cz*dz;
if(d > 0.0)
{
res[i] += pow(d, N);
}
}
}
......
......@@ -53,6 +53,13 @@ struct EigenFunctor: Eigen::DenseFunctor<double>
vec _y = _di - (*_f)(_x);
for(int i=0; i<_f->dimY(); ++i)
y(i*_d->size() + s) = _y[i];
/*
// Cosine term. It is supposed to improve the quality of the fit (see Ngan '05).
vec x2(3);
params::convert(&_x[0], _d->input_parametrization(), params::ISOTROPIC_TV_TL_DPHI, &x2[0]);
y *= cos(x2[1]);
*/
}
#ifdef DEBUG
std::cout << "diff vector:" << std::endl << y << std::endl << std::endl ;
......@@ -76,7 +83,12 @@ struct EigenFunctor: Eigen::DenseFunctor<double>
// Get the associated jacobian
vec _jac = _f->parametersJacobian(xi);
/*
// Cosine term. It is supposed to improve the quality of the fit (see Ngan '05).
vec x2(3);
params::convert(&xi[0], _d->input_parametrization(), params::ISOTROPIC_TV_TL_DPHI, &x2[0]);
_jac = _jac * cos(x2[1]);
*/
// Fill the columns of the matrix
#ifdef DEBUG
Eigen::MatrixXd temp (_f->dimY(), _f->nbParameters());
......
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