[Insight-developers] Help to debug on LInux64 and Mac 10.5

Bill Lorensen bill.lorensen at gmail.com
Thu Dec 20 16:24:11 EST 2007


I it's OK. It is meant to hash an arbitrary object.

Can you attach the output?

Bill

On Dec 20, 2007 4:05 PM, Sean McBride <sean at rogue-research.com> wrote:

> On 12/20/07 1:52 PM, Bill Lorensen said:
>
> >Can you add some output to the Algorithms/itkStructHashFunction.h to
> >std::cout the key, len and hash? Then run the Review test.
>
> Bill,
>
> Mathieu and I looked at it more... I think this hash function is
> definitely involved in the problem.  I added:
>
> template< class TInput >
> inline unsigned int
> StructHashFunction< TInput >
> ::operator()( const InputType& key ) const
> {
>  size_t len = sizeof( InputType );
>  std::cout << "key is: " << key << std::endl;
>  std::cout << "key size: " << std::dec << len << std::endl;
>
> First, "key" prints itself as, for example, "[0, 1, 0]".  "key size" is
> 32 bytes.  Is this expected?  I would have thought 3 * sizeof(float/
> double) which is either 12 or 24.  I guess the vtable or other members
> of the class take up space too.  Indeed, a "FixedArray" contains some
> pointer-sized members, and so the size is probably different on 32/64
> builds.  If so, then different hashes will be computed and collisions
> may result?  Does it make sense to be hashing against private things
> anyway?  Seems to go against the comment at the top of
> itkStructHashFunction.h.
>
> Thoughts?
>
> --
>  ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20071220/3f2441dc/attachment.htm


More information about the Insight-developers mailing list