Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
9d89132e
Commit
9d89132e
authored
Aug 21, 2013
by
Laurent Belcour
Browse files
Changing some throw into comprehensible messages.
parent
06db04e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
sources/core/data.h
View file @
9d89132e
...
...
@@ -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
();
...
...
sources/core/params.cpp
View file @
9d89132e
...
...
@@ -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
::
c
out
<<
"<<ERROR>>
not defined input param: "
<<
get_name
(
outtype
)
<<
std
::
endl
;
std
::
c
err
<<
"<<ERROR>>
Transformation not implemented, "
<<
get_name
(
outtype
)
<<
" "
<<
__FILE__
<<
":"
<<
__LINE__
<<
std
::
endl
;
assert
(
false
);
break
;
}
...
...
sources/plugins/nonlinear_function_isotropic_lafortune/function.cpp
View file @
9d89132e
...
...
@@ -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
);
}
}
}
...
...
sources/plugins/nonlinear_levenberg_eigen/fitter.cpp
View file @
9d89132e
...
...
@@ -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
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment