[Insight-developers] MedialNodeCorrespondencesTest, Intel C++ fixed

Miller, James V (Research) millerjv at crd . ge . com
Fri, 15 Aug 2003 10:30:28 -0400


Aaron, 

I put in a fix for this.

Jim

> -----Original Message-----
> From: C. Aaron Cois [mailto:cacst11+ at pitt . edu]
> Sent: Friday, August 15, 2003 2:53 AM
> Cc: Insight-developers (E-mail)
> Subject: Re: [Insight-developers] MedialNodeCorrespondencesTest, Intel
> C++ fixed
> 
> 
> Ok, i found a fix for the .NET error, and i'll upload it tomorrow 
> morning.  Hopefully it will still be compatible with the other 
> compilers. (i can't see any reqason why it wouldn't, it was 
> just a weird 
> typedef thing)
> 
>     -Aaron
> 
>    
> 
> Aaron Cois wrote:
> 
> > The fix inplemented for itkEllipsoidInteriorExteriorSpatialFunction 
> > causes errors in VS .NET.  The errors are odd, and are 
> remeniscent of 
> > arbitrary errors that would pop up from a missing brace of bracket, 
> > but I have found no such problem in the code.  Can someone 
> else with 
> > .NET verify?  Just try to run anything that uses the class...the 
> > itkMedialNodeCorrespondenceTest should produce the errors.  
> The errors 
> > are listed below
> >
> >    -Aaron Cois
> >
> > 
> f:\Projects\Insight\Code\Common\itkEllipsoidInteriorExteriorSp
> atialFunction.txx(112): 
> > error C2244: 
> > 
> 'itk::EllipsoidInteriorExteriorSpatialFunction<,TInput>::SetOr
> ientations' 
> > : unable to match function definition to an existing declaration
> >
> > 
> f:\Projects\Insight\Code\Common\itkEllipsoidInteriorExteriorSp
> atialFunction.txx(114): 
> > error C2954: template definitions cannot nest
> >
> >
> > Miller, James V (Research) wrote:
> >
> >> This was on the Intel C++ compiler on Linux, version 7.
> >>
> >>
> >>  
> >>
> >>> -----Original Message-----
> >>> From: Bill Hoffman [mailto:bill . hoffman at kitware . com]
> >>> Sent: Thursday, August 14, 2003 1:59 PM
> >>> To: Miller, James V (Research); Insight-developers (E-mail)
> >>> Subject: Re: [Insight-developers] 
> MedialNodeCorrespondencesTest, Intel
> >>> C++ fixed
> >>>
> >>>
> >>> This change was made so that the fixed versions did not have the 
> >>> overhead
> >>> of having the extra data associated with the non-fixed 
> versions.  (8 
> >>> bytes)
> >>>
> >>>
> >>> From what I can tell, you are saying that the following crashes:
> >>>
> >>>
> >>> #include <vnl/vnl_matrix.h>
> >>> #include <vnl/vnl_matrix_fixed.h>
> >>> void foo(vnl_matrix<double> m)
> >>> {
> >>>  vnl_matrix<double> mm = m;
> >>> }
> >>>
> >>> main()
> >>> {
> >>>  vnl_matrix_fixed<double,3,3> m;
> >>>  foo(m);
> >>>  return 0;
> >>> }
> >>>
> >>> Which intel compiler is this?  Windows or Linux?
> >>>
> >>> It is using this operator:
> >>>
> >>>  //: Cheap conversion to vnl_matrix_ref
> >>>  // Sometimes, such as with templated functions, the 
> compiler cannot
> >>>  // use this user-defined conversion. For those cases, use the
> >>>  // explicit as_ref() method instead.
> >>>  operator const vnl_matrix_ref<T>() const { return 
> >>> vnl_matrix_ref<T>( num_rows, num_cols, 
> const_cast<T*>(data_block()) 
> >>> ); }
> >>>
> >>> Sounds like a bug in the compiler.   This is going to be hard to 
> >>> track down in all the
> >>> code, and should work. 
> >>> If you let me know which intel compiler it is crashing on, I can 
> >>> take a look.
> >>>
> >>> -Bill
> >>>
> >>>
> >>>   
> >>>
> >>>> It looks like the vnl_matrix_fixed and vnl_matrix classes     
> >>>
> >>> are no longer related via inheritence.  Instead, there are some 
> >>> converter routines ( mat_fixed.as_ref() returns a vnl_matrix).    
> >>>
> >>>> 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.   
> >>>
> >>>   
> >>
> >> _______________________________________________
> >> Insight-developers mailing list
> >> Insight-developers at itk . org
> >> http://www . itk . org/mailman/listinfo/insight-developers
> >>  
> >>
> >
> >
> >
> > _______________________________________________
> > Insight-developers mailing list
> > Insight-developers at itk . org
> > http://www . itk . org/mailman/listinfo/insight-developers
> 
> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk . org
> http://www . itk . org/mailman/listinfo/insight-developers
>