Subject: CGAL users discussion list
List archive
- From: "Mathieu Brédif" <>
- To:
- Subject: Re: Precondition_exception in Sign_Sturm_sequence.h
- Date: Fri, 25 Apr 2008 15:15:45 +0200
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=rjN3UKiPGFikk/nNccOJxviuvbw8rpbY/OkC0gnLV3+mrRhf4Y+Vdwj05OhmNjhKiTXA26ayscWVR2mxM+WmrSseHJYM2TVhoo3pzzHMjv0y8kqHE8n815Oj4rvTt2Yhb/oDlBdG6xd/JgusBfwt59wRFjU0nhTCKr3xZTrgbxU=
If it can help, I get an other problem that seems related in :
-----------------
template<class K, class Time>
unsigned int get_multiplicity(const typename K::Function& f, const K&
k, const Time& t) {
if(f.degree() == -1) return (unsigned int) -1; // null function
typename K::Function h=f;
unsigned int deg=0;
typename K::Sign_at sign= k.sign_at_object();
typename K::Differentiate diff=k.differentiate_object();
while (sign(h, t)==CGAL::ZERO) { <---------------- throws exception
++deg;
h=diff(h);
}
return deg;
};
------------------------
the exception is :
--------------------------------------------------
CGAL error: assertion violation!
Expr: p_(v) == 0
File: /usr/include/CGAL/Polynomial/Sturm_root_stack.h
Line: 167
-----------------------------------------
the corresponding code is:
if (p_.degree() == 1) {
NT v= -p_[0]/p_[1];
CGAL_assertion(p_(v) == 0);
....
}
so it does not seem related to the particular root t but rather to the
polynom p_ and the exactness of p_[0]-p_[1]*p_[0]/p_[1]==CGAL::ZERO.
The values ouput by "std::cout <<" that cause the problem are :
f=-0.894427191-0.105572809*t
t=0
The roots that cause the problem in the previous mail were both output as :
-0.12132034356+0.192388155425*t+0.100505063388*t^2 in [0,1] = 0.5...0.5
Is there a way to backup exactly the value of a Function to be able to
reproduce my problem with a small piece of code ?
Thanks,
Mathieu
On Fri, Apr 25, 2008 at 2:17 PM, Mathieu Brédif
<>
wrote:
> Hi,
> I have some trouble tracking done the cause of this precondition_exception
> :
>
> ----------------------
> Expr: s0 != CGAL::ZERO
> File: /usr/include/CGAL/Polynomial/internal/Rational/Sign_Sturm_sequence.h
> Line: 57
> Explanation:
> terminate called after throwing an instance of
> 'CGAL::Precondition_exception'
> what(): CGAL ERROR: precondition violation!
> Expr: s0 != CGAL::ZERO
> File: /usr/include/CGAL/Polynomial/internal/Rational/Sign_Sturm_sequence.h
> Line: 57
> -----------------
>
> This exception is triggered when i am comparing 2 roots for equality.
> The traits i use are :
>
> typedef CGAL::Exact_predicates_exact_constructions_kernel Static_kernel;
> typedef CGAL::POLYNOMIAL::Polynomial<Static_kernel::FT> Function;
> typedef CGAL::POLYNOMIAL::Sturm_root_stack_traits<Function>
> Root_stack_traits;
> typedef CGAL::POLYNOMIAL::Sturm_root_stack<Root_stack_traits> Root_stack;
> typedef CGAL::POLYNOMIAL::Kernel<Function, Root_stack> Function_kernel;
>
> Am i doing something wrong ?
>
> thanks
> Mathieu Bredif
>
- Precondition_exception in Sign_Sturm_sequence.h, Mathieu Brédif, 04/25/2008
- Re: Precondition_exception in Sign_Sturm_sequence.h, Mathieu Brédif, 04/25/2008
- Re: [cgal-discuss] Re: Precondition_exception in Sign_Sturm_sequence.h, Daniel Russel, 04/30/2008
- [cgal-discuss] Errors when get Facet_handle from Halfedge_around_facet_circulator, samuel kim, 04/25/2008
- Re: [cgal-discuss] Errors when get Facet_handle from Halfedge_around_facet_circulator, Mathieu Brédif, 04/25/2008
- Re: [cgal-discuss] Errors when get Facet_handle from Halfedge_around_facet_circulator, Sebastien Loriot, 04/25/2008
- RE: [cgal-discuss] Errors when get Facet_handle from Halfedge_around_facet_circulator, samuel kim, 04/25/2008
- Re: Precondition_exception in Sign_Sturm_sequence.h, Mathieu Brédif, 04/25/2008
Archive powered by MHonArc 2.6.16.