## Re: [Vxl-maintainers] vgl_point_3d eps test

 Re: [Vxl-maintainers] vgl_point_3d eps test From: Marcus Brubaker - 2007-08-20 17:03:12 ```Joseph Mundy wrote: > Kieran, > You do raise the issue as to whether or not there should be tolerances > in other vgl functions that have to make a bool decision. We should be > uniform in this regard. Maybe there should be a global constant class > defined, e.g. vgl_tolerance with different static values, such as > vgl_tolerance::point_neigborhood > vgl_tolerance::orientation_radians > It would only take a few of these tolerances to cover most of the > geometric predicates needed for vgl. > It may be worth determining the machine-precision for the given values and using some function of those. For instance, I have a piece of code which localizes the zero crossings of a function of a ODE. The threshold is: const double &dtTol = min(128*max(eps(tL),eps(tR)), fabs(tR-tL)); where eps(x) is a function which returns the rough machine precision around the value of x. It looks something like: inline double eps(double v) { if (!finite(v)) return v; int vpow = max(-1074,ilogb(v)-52); return ldexp(1.0,vpow); } Similar automatic thresholds could probably be determined in most cases. Just a thought. Cheers, Marcus ```

 [Vxl-maintainers] vgl_point_3d eps test From: Kieran O'Mahony - 2007-08-16 12:37:58 ```Hi all, I am currently working with Ian Scott and as part of my work I am dealing quite a bit with parts of vxl but mainly vgl. Something that has cropped up recently is the lack of an eps test in the vgl_point_3d coplanar() function. At present the decision is based on a direct equality check with zero. Would anyone object to replacing this with a bounds check around zero using vcl_numeric_limits::epsilon() ? This should be fine for all possible template types as according to the C++ standard epsilon() should return 0 for any types where it doesn't make sense (integer etc). BTW I also noticed a couple of sign mistakes in the same function and have corrected them. Thanks, Kieran ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Joseph Mundy - 2007-08-16 13:01:07 ```Sounds like a good idea to me. What about a default value for epsilon? Joe -----Original Message----- From: vxl-maintainers-bounces@... [mailto:vxl-maintainers-bounces@...] On Behalf Of Kieran O'Mahony Sent: Thursday, August 16, 2007 8:38 AM To: vxl-maintainers@... Subject: [Vxl-maintainers] vgl_point_3d eps test Hi all, I am currently working with Ian Scott and as part of my work I am dealing quite a bit with parts of vxl but mainly vgl. Something that has cropped up recently is the lack of an eps test in the vgl_point_3d coplanar() function. At present the decision is based on a direct equality check with zero. Would anyone object to replacing this with a bounds check around zero using vcl_numeric_limits::epsilon() ? This should be fine for all possible template types as according to the C++ standard epsilon() should return 0 for any types where it doesn't make sense (integer etc). BTW I also noticed a couple of sign mistakes in the same function and have corrected them. Thanks, Kieran ------------------------------------------------------------------------ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Vxl-maintainers mailing list Vxl-maintainers@... https://lists.sourceforge.net/lists/listinfo/vxl-maintainers ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Kieran O'Mahony - 2007-08-16 13:44:31 ```Unfortunately, in order to be usable introducing an argument with a default value (presumably defaulting to 0) would require the introduction of default values in other vgl functions which use vgl_point_3d's coplanar function e.g. functions in vgl_intersection and vgl_line_3d_2_points. Introducing changes in these functions would probably suggest that a lot of vgl functions should be updated with default eps arguments also. However a more serious issue if default eps arguments were introduced would be their compatability between functions. For example if a vgl_intersection function required an eps check of sqrt_eps say but vgl_point_3d coplanar should only be checking against eps directly then it is undesirable for vgl_intersection to pass on its eps argument to vgl_point_3d. Therefore I would like to avoid introducing a default argument. Hope this makes sense. Kieran On 16/08/07, Joseph Mundy wrote: > Sounds like a good idea to me. What about a default value for epsilon? > Joe > > -----Original Message----- > From: vxl-maintainers-bounces@... > [mailto:vxl-maintainers-bounces@...] On Behalf Of > Kieran O'Mahony > Sent: Thursday, August 16, 2007 8:38 AM > To: vxl-maintainers@... > Subject: [Vxl-maintainers] vgl_point_3d eps test > > Hi all, > > I am currently working with Ian Scott and as part of my work I am > dealing quite a bit with parts of vxl but mainly vgl. > > Something that has cropped up recently is the lack of an eps test in > the vgl_point_3d coplanar() function. At present the decision is based > on a direct equality check with zero. Would anyone object to replacing > this with a bounds check around zero using > vcl_numeric_limits::epsilon() ? > > This should be fine for all possible template types as according to > the C++ standard epsilon() should return 0 for any types where it > doesn't make sense (integer etc). > > BTW I also noticed a couple of sign mistakes in the same function and > have corrected them. > > Thanks, > Kieran > > ------------------------------------------------------------------------ > - > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Vxl-maintainers mailing list > Vxl-maintainers@... > https://lists.sourceforge.net/lists/listinfo/vxl-maintainers > > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Kieran O'Mahony - 2007-08-16 14:55:36 ```Just to be clear, I would like to introduce the eps test in the body of the function and avoid introducing any argument (default or otherwise). Thanks, Kieran On 16/08/07, Kieran O'Mahony wrote: > Unfortunately, in order to be usable introducing an argument with a > default value (presumably defaulting to 0) would require the > introduction of default values in other vgl functions which use > vgl_point_3d's coplanar function e.g. functions in vgl_intersection > and vgl_line_3d_2_points. > > Introducing changes in these functions would probably suggest that a > lot of vgl functions should be updated with default eps arguments > also. > > However a more serious issue if default eps arguments were introduced > would be their compatability between functions. > > For example if a vgl_intersection function required an eps check of > sqrt_eps say but vgl_point_3d coplanar should only be checking against > eps directly then it is undesirable for vgl_intersection to pass on > its eps argument to vgl_point_3d. > > Therefore I would like to avoid introducing a default argument. Hope > this makes sense. > > Kieran > > On 16/08/07, Joseph Mundy wrote: > > Sounds like a good idea to me. What about a default value for epsilon? > > Joe > > > > -----Original Message----- > > From: vxl-maintainers-bounces@... > > [mailto:vxl-maintainers-bounces@...] On Behalf Of > > Kieran O'Mahony > > Sent: Thursday, August 16, 2007 8:38 AM > > To: vxl-maintainers@... > > Subject: [Vxl-maintainers] vgl_point_3d eps test > > > > Hi all, > > > > I am currently working with Ian Scott and as part of my work I am > > dealing quite a bit with parts of vxl but mainly vgl. > > > > Something that has cropped up recently is the lack of an eps test in > > the vgl_point_3d coplanar() function. At present the decision is based > > on a direct equality check with zero. Would anyone object to replacing > > this with a bounds check around zero using > > vcl_numeric_limits::epsilon() ? > > > > This should be fine for all possible template types as according to > > the C++ standard epsilon() should return 0 for any types where it > > doesn't make sense (integer etc). > > > > BTW I also noticed a couple of sign mistakes in the same function and > > have corrected them. > > > > Thanks, > > Kieran > > > > ------------------------------------------------------------------------ > > - > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Vxl-maintainers mailing list > > Vxl-maintainers@... > > https://lists.sourceforge.net/lists/listinfo/vxl-maintainers > > > > > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Joseph Mundy - 2007-08-16 22:46:11 ```Kieran, You do raise the issue as to whether or not there should be tolerances in other vgl functions that have to make a bool decision. We should be uniform in this regard. Maybe there should be a global constant class defined, e.g. vgl_tolerance with different static values, such as vgl_tolerance::point_neigborhood vgl_tolerance::orientation_radians It would only take a few of these tolerances to cover most of the geometric predicates needed for vgl. Joe -----Original Message----- From: Kieran O'Mahony [mailto:kieranom@...] Sent: Thursday, August 16, 2007 10:56 AM To: Joseph Mundy Cc: vxl-maintainers@... Subject: Re: [Vxl-maintainers] vgl_point_3d eps test Just to be clear, I would like to introduce the eps test in the body of the function and avoid introducing any argument (default or otherwise). Thanks, Kieran On 16/08/07, Kieran O'Mahony wrote: > Unfortunately, in order to be usable introducing an argument with a > default value (presumably defaulting to 0) would require the > introduction of default values in other vgl functions which use > vgl_point_3d's coplanar function e.g. functions in vgl_intersection > and vgl_line_3d_2_points. > > Introducing changes in these functions would probably suggest that a > lot of vgl functions should be updated with default eps arguments > also. > > However a more serious issue if default eps arguments were introduced > would be their compatability between functions. > > For example if a vgl_intersection function required an eps check of > sqrt_eps say but vgl_point_3d coplanar should only be checking against > eps directly then it is undesirable for vgl_intersection to pass on > its eps argument to vgl_point_3d. > > Therefore I would like to avoid introducing a default argument. Hope > this makes sense. > > Kieran > > On 16/08/07, Joseph Mundy wrote: > > Sounds like a good idea to me. What about a default value for epsilon? > > Joe > > > > -----Original Message----- > > From: vxl-maintainers-bounces@... > > [mailto:vxl-maintainers-bounces@...] On Behalf Of > > Kieran O'Mahony > > Sent: Thursday, August 16, 2007 8:38 AM > > To: vxl-maintainers@... > > Subject: [Vxl-maintainers] vgl_point_3d eps test > > > > Hi all, > > > > I am currently working with Ian Scott and as part of my work I am > > dealing quite a bit with parts of vxl but mainly vgl. > > > > Something that has cropped up recently is the lack of an eps test in > > the vgl_point_3d coplanar() function. At present the decision is based > > on a direct equality check with zero. Would anyone object to replacing > > this with a bounds check around zero using > > vcl_numeric_limits::epsilon() ? > > > > This should be fine for all possible template types as according to > > the C++ standard epsilon() should return 0 for any types where it > > doesn't make sense (integer etc). > > > > BTW I also noticed a couple of sign mistakes in the same function and > > have corrected them. > > > > Thanks, > > Kieran > > > > ------------------------------------------------------------------------ > > - > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Vxl-maintainers mailing list > > Vxl-maintainers@... > > https://lists.sourceforge.net/lists/listinfo/vxl-maintainers > > > > > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Peter Vanroose - 2007-08-17 06:50:57 ```We could also make these constants sort of "configurable", like the ones in core/vnl/vnl_config.h.in -- Peter. -- __________________________________________________________ Fly(g) från regnet - sök efter resor hos Yahoo! Shopping. Jämför pris på flygbiljetter och hotellrum här: http://shopping.yahoo.se/c-169901-resor-biljetter.html?partnerId=96914052 ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Kieran O'Mahony - 2007-08-20 11:23:49 ```It seems like a good idea to me to introduce eps tests throughout vgl, I think it is sorely missing. However I'm afraid I don't have time at present to investigate vgl in it's entirety. Therefore, if you don't have any objections, I will limit myself to introducing the eps check in the body of the coplanar function. Kieran On 17/08/07, Peter Vanroose wrote: > We could also make these constants sort of "configurable", like the > ones in core/vnl/vnl_config.h.in > > -- Peter. > > > > > > > > > > > > > > > -- > > > __________________________________________________________ > Fly(g) fr=E5n regnet - s=F6k efter resor hos Yahoo! Shopping. > J=E4mf=F6r pris p=E5 flygbiljetter och hotellrum h=E4r: > http://shopping.yahoo.se/c-169901-resor-biljetter.html?partnerId=3D969140= 52 > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Joseph Mundy - 2007-08-20 12:03:05 ```Maybe you could get the ball rolling on vgl_tolerance but only apply it to coplanar. That way others can put tolerances in other parts of vgl as they can. Joe -----Original Message----- From: Kieran O'Mahony [mailto:kieranom@...]=20 Sent: Monday, August 20, 2007 6:36 AM To: p.vanroose@... Cc: Joseph Mundy; vxl-maintainers@... Subject: Re: vgl_point_3d eps test It seems like a good idea to me to introduce eps tests throughout vgl, I think it is sorely missing. However I'm afraid I don't have time at present to investigate vgl in it's entirety. Therefore, if you don't have any objections, I will limit myself to introducing the eps check in the body of the coplanar function. Kieran On 17/08/07, Peter Vanroose wrote: > We could also make these constants sort of "configurable", like the > ones in core/vnl/vnl_config.h.in > > -- Peter. > > > > > > > > > > > > > > > -- > > > __________________________________________________________ > Fly(g) fr=E5n regnet - s=F6k efter resor hos Yahoo! Shopping. > J=E4mf=F6r pris p=E5 flygbiljetter och hotellrum h=E4r: > http://shopping.yahoo.se/c-169901-resor-biljetter.html?partnerId=3D969140= 5 2 > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Kieran O'Mahony - 2007-08-20 12:08:04 ```No problem. I'll check it in at some stage in the next few days. Kieran On 20/08/07, Joseph Mundy wrote: > Maybe you could get the ball rolling on vgl_tolerance but only apply > it to coplanar. That way others can put tolerances in other parts of vgl > as they can. > Joe > > -----Original Message----- > From: Kieran O'Mahony [mailto:kieranom@...] > Sent: Monday, August 20, 2007 6:36 AM > To: p.vanroose@... > Cc: Joseph Mundy; vxl-maintainers@... > Subject: Re: vgl_point_3d eps test > > It seems like a good idea to me to introduce eps tests throughout vgl, > I think it is sorely missing. However I'm afraid I don't have time at > present to investigate vgl in it's entirety. > > Therefore, if you don't have any objections, I will limit myself to > introducing the eps check in the body of the coplanar function. > > Kieran > > > On 17/08/07, Peter Vanroose wrote: > > We could also make these constants sort of "configurable", like the > > ones in core/vnl/vnl_config.h.in > > > > -- Peter. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > __________________________________________________________ > > Fly(g) fr=E5n regnet - s=F6k efter resor hos Yahoo! Shopping. > > J=E4mf=F6r pris p=E5 flygbiljetter och hotellrum h=E4r: > > > http://shopping.yahoo.se/c-169901-resor-biljetter.html?partnerId=3D969140= 5 > 2 > > > > ```
 Re: [Vxl-maintainers] vgl_point_3d eps test From: Marcus Brubaker - 2007-08-20 17:03:12 ```Joseph Mundy wrote: > Kieran, > You do raise the issue as to whether or not there should be tolerances > in other vgl functions that have to make a bool decision. We should be > uniform in this regard. Maybe there should be a global constant class > defined, e.g. vgl_tolerance with different static values, such as > vgl_tolerance::point_neigborhood > vgl_tolerance::orientation_radians > It would only take a few of these tolerances to cover most of the > geometric predicates needed for vgl. > It may be worth determining the machine-precision for the given values and using some function of those. For instance, I have a piece of code which localizes the zero crossings of a function of a ODE. The threshold is: const double &dtTol = min(128*max(eps(tL),eps(tR)), fabs(tR-tL)); where eps(x) is a function which returns the rough machine precision around the value of x. It looks something like: inline double eps(double v) { if (!finite(v)) return v; int vpow = max(-1074,ilogb(v)-52); return ldexp(1.0,vpow); } Similar automatic thresholds could probably be determined in most cases. Just a thought. Cheers, Marcus ```