Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
alta
alta
Commits
2f00f43a
Commit
2f00f43a
authored
Aug 23, 2013
by
Laurent Belcour
Browse files
Coded the Jacobian of the Fresnel
parent
3064dc42
Changes
1
Hide whitespace changes
Inline
Side-by-side
sources/core/function.h
View file @
2f00f43a
...
...
@@ -291,7 +291,36 @@ class fresnel : public nonlinear_function
//! \brief Obtain the derivatives of the function with respect to the
//! parameters.
virtual
vec
parametersJacobian
(
const
vec
&
x
)
const
=
0
;
virtual
vec
parametersJacobian
(
const
vec
&
x
)
const
{
int
nb_func_params
=
f
->
nbParameters
();
int
nb_fres_params
=
nbFresnelParameters
();
int
nb_params
=
nb_func_params
+
nb_fres_params
;
vec
func_jacobian
=
f
->
parametersJacobian
(
x
);
vec
fres_jacobian
=
getFresnelParametersJacobian
(
x
);
vec
func_value
=
f
->
value
(
x
);
vec
fres_value
=
fresnelValue
(
x
);
// F = fresnel; f = function
// d(F * f)(x) /dp = F(x) df(x) /dp + f(x) dF(x) / dp
vec
jac
(
nb_params
*
_nY
);
for
(
int
y
=
0
;
y
<
_nY
;
++
y
)
{
for
(
int
i
=
0
;
i
<
nb_func_params
;
++
i
)
{
jac
[
y
+
_nY
*
i
]
=
func_jacobian
[
y
+
_nY
*
i
]
*
fres_value
[
y
];
}
for
(
int
i
=
0
;
i
<
nb_fres_params
;
++
i
)
{
jac
[
y
+
_nY
*
(
i
+
nb_func_params
)]
=
fres_jacobian
[
y
+
_nY
*
i
]
*
fres_value
[
y
];
}
}
return
jac
;
}
//! \brief set the value for the base function
void
setBase
(
nonlinear_function
*
fin
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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