[vtk-developers] Tests failing on Borland builds

Ken Martin ken.martin at kitware.com
Mon Dec 8 15:20:50 EST 2003


I can live with FLOAT_MAX or honestly -1 1 just as well. The only thing to
be careful of is that some codes look at the values to determine if they are
initialized. So if the initialization of the bounds is changed to FLOAT_MAX
the matching code must also be changed to consider FLOAT_MAX as the
uninitialized value.

Ken

> -----Original Message-----
> From: vtk-developers-admin at vtk.org [mailto:vtk-developers-admin at vtk.org]
> On Behalf Of dean.inglis at camris.ca
> Sent: Monday, December 08, 2003 3:10 PM
> To: vtk-developers at vtk.org
> Subject: [vtk-developers] Tests failing on Borland builds
> 
> Hi,
> 
> I have noticed that the tests failing on the Borland
> dashboards are all due to numerical exceptions.  This is
> because in some classes, like vtkCell and its subclasses
> and vtkDataSet the double ivar Bounds, is initialized
> to something like
> 
>   this->Bounds[0] = VTK_DOUBLE_MAX;
>   this->Bounds[1] = -VTK_DOUBLE_MAX;
>   this->Bounds[2] = VTK_DOUBLE_MAX;
>   this->Bounds[3] = -VTK_DOUBLE_MAX;
>   this->Bounds[4] = VTK_DOUBLE_MAX;
>   this->Bounds[5] = -VTK_DOUBLE_MAX;
> 
> and then a method is called, for example as in vtkDataSet:
> 
> // Return the length of the diagonal of the bounding box.
> double vtkDataSet::GetLength()
> {
>   double diff, l=0.0;
>   int i;
> 
>   this->ComputeBounds();
>   for (i=0; i<3; i++)
>     {
>     diff = static_cast<double>(this->Bounds[2*i+1]) -
>       static_cast<double>(this->Bounds[2*i]);
>     l += diff * diff;  //<----------------exception
>     }
>   diff = sqrt(l);
>   if(diff > VTK_DOUBLE_MAX)
>     {
>     return VTK_DOUBLE_MAX;
>     }
>   return static_cast<double>(diff);
> }
> 
> 
> Should Bounds be default initialized using
> VTK_FLOAT_MAX, -VTK_FLOAT_MAX instead???
> 
> Dean
> 
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers





More information about the vtk-developers mailing list