Issue 44 in cortex-vfx: Uninitialised variable at line 523 in include/IECore/LevenbergMarquardt.inl

1 view
Skip to first unread message

corte...@googlecode.com

unread,
Oct 27, 2011, 7:31:16 PM10/27/11
to cortex...@googlegroups.com
Status: Accepted
Owner: ----

New issue 44 by thehaddo...@gmail.com: Uninitialised variable at line 523
in include/IECore/LevenbergMarquardt.inl
http://code.google.com/p/cortex-vfx/issues/detail?id=44

This was shown up by gcc 4.4.4. There are two potential fixes, but I don't
understand the code well enough to choose one right now.

EITHER :

replace lines 613-614 with "par = parl;"...

OR :

T par = T(0);

on line 286, then :

change line 290 from :

T par = computeLMParameter( m_wa1, m_wa2->writable(), delta );

to :

computeLMParameter( m_wa1, m_wa2->writable(), delta, par );

change the function definition:

T LevenbergMarquardt<T, ErrorFn, Traits>::computeLMParameter(
std::vector<T> &x, std::vector<T> &sdiag, T delta )

to :

void LevenbergMarquardt<T, ErrorFn, Traits>::computeLMParameter(
std::vector<T> &x, std::vector<T> &sdiag, T delta, T &par )

change line 572 from :

return 0;

to:

par = T(0);

and then delete that peskly line 523....

Reply all
Reply to author
Forward
0 new messages