[Insight-developers] Intel C++ and vnl_*_ref
Bill Hoffman
bill . hoffman at kitware . com
Mon, 18 Aug 2003 15:20:18 -0400
This is the same bug that was referenced by Jill here:
At 01:04 PM 8/14/2003, Miller, James V (Research) wrote:
>The Intel compiler builds were crashing on the deallocation of a vnl_matrix. Bill changed the code in Ellipsoid*SpatialFunction to take a reference to a vnl_matrix_fixed instead of taking a vnl_matrix by value. This clears up the problem on the Intel compiler. I am guessing the other systems are relying on some other type conversion operators that may be flawed on the Intel compiler.
>
>Two things to look out for:
>
>1. vnl_matrix and vnl_matrix_fixed mismatches.
>2. function that take matrix types by value as opposed to by reference.
>
>Jill
>
After finding the problem, we added some code to detect the it, and found
it showed up in about 83 other places in the ITK tests for matrix alone,
vector has the same problem. This may have been causing other instabilities
with the Intel compiler.
So, we should not have to look for the mismatches. However, I do
think as a matter of style const ref should be used over passing a matrix
by value.
-Bill