|
realroot_doc 0.1.1
|
#include <fatarcs.hpp>
Definition at line 307 of file fatarcs.hpp.
Definition at line 315 of file fatarcs.hpp.
| typedef polynomial< coeff_t ,with<Bernstein> > bernstein_t |
Definition at line 313 of file fatarcs.hpp.
Definition at line 312 of file fatarcs.hpp.
| typedef C coeff_t |
Definition at line 310 of file fatarcs.hpp.
| typedef polynomial< coeff_t ,with<MonomialTensor> > monom_t |
Definition at line 314 of file fatarcs.hpp.
Definition at line 311 of file fatarcs.hpp.
| box_rep | ( | bernstein_t | p | ) | [inline] |
Definition at line 323 of file fatarcs.hpp.
| box_rep | ( | bernstein_t | p, |
| box_t | bb | ||
| ) | [inline] |
Definition at line 324 of file fatarcs.hpp.
References domain< C >::I, and mmx::tensor::restrict().
{
bernstein_t pa=p;
tensor::restrict(pa.rep(), 0 , bb.I[0].m , bb.I[0].M );
tensor::restrict(pa.rep(), 1 , bb.I[1].m , bb.I[1].M );
poly=pa;
box=bb;
};
| bool corner_event | ( | int | c1, |
| int | c2 | ||
| ) | [inline] |
Definition at line 388 of file fatarcs.hpp.
References mmx::eval(), mmx::tensor::face(), is_small(), and vec().
{
vec_t evc=vec(coeff_t(c1),coeff_t(c2));
coeff_t v;
eval(v, poly.rep(), evc );
bernstein_t face_p, face_q;
if ( is_small(v) ){
tensor::face(face_p, poly, 0, c2);
tensor::face(face_q, poly, 1, c1);
if (first_nonzero(face_p, c1)*first_nonzero(face_q, c2) < 0){return true; }else{ return false; };
}else{ return false;};
}
| bool edge_event | ( | int | var, |
| int | n | ||
| ) | [inline] |
Definition at line 349 of file fatarcs.hpp.
References mmx::tensor::face(), and mmx::sign().
{
bernstein_t face_p;
int event = 0;
tensor::face(face_p, poly, var, n);
int stc = 0;
for(unsigned i = 0 ; i < face_p.size() ; i++){
if( stc*sign(face_p.rep()[i]) == -1 ){
stc = sign(face_p.rep()[i]); event++;
}
else if ( stc == 0 && sign(face_p.rep()[i])!=0 ){
stc = sign(face_p.rep()[i]);
};
}
if(event==1){return true;}else{return false;};
}/*edge event along ONE edge*/
Definition at line 404 of file fatarcs.hpp.
References vec().
Referenced by solver_mv_fatarcs< C >::box_gen().
{
Seq<vec_t> elist;
if(edge_event( 0, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec(coeff_t(1),coeff_t(0));}
if(edge_event( 0, 1)){elist<<vec(coeff_t(0),coeff_t(1))<<vec(coeff_t(1),coeff_t(1));}
if(edge_event( 1, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec(coeff_t(0),coeff_t(1));}
if(edge_event( 1, 1)){elist<<vec(coeff_t(1),coeff_t(0))<<vec(coeff_t(1),coeff_t(1));}
if(corner_event( 0, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec_t();}
if(corner_event( 0, 1)){elist<<vec(coeff_t(0),coeff_t(1))<<vec_t();}
if(corner_event( 1, 0)){elist<<vec(coeff_t(1),coeff_t(0))<<vec_t();}
if(corner_event( 1, 1)){elist<<vec(coeff_t(1),coeff_t(1))<<vec_t();}
return elist;
} //boxes with single implicitly defined curve segment*/
| int first_nonzero | ( | bernstein_t | list, |
| int | e | ||
| ) | [inline] |
Definition at line 370 of file fatarcs.hpp.
References mmx::sign().
Definition at line 437 of file fatarcs.hpp.
References abs_max_coeff(), mmx::assign(), Seq< C, R >::clear(), mmx::degree(), mmx::tensor::heval(), arc_rep< C >::midc(), min_coeff(), mmx::pow(), arc_rep< C >::pts, seq2b(), and arc_rep< C >::weight().
Referenced by solver_mv_fatarcs< C >::box_gen().
{
bernstein_t neww, bxt, byt, bwt, num, polyco;
monom_t monomp, newnom, xt, yt, wt;
Seq<coeff_t> v;
v<<coeff_t(1)<<circ.weight()<<coeff_t(1);
neww=seq2b( v );
v.clear();
pow(neww,degree(poly,0)+degree(poly,1));
v<<circ.pts[0][0]<<circ.midc()[0]*circ.weight()<<circ.pts[2][0];
bxt=seq2b(v); v.clear();
tensor::assign(xt.rep(),bxt.rep());
v<<circ.pts[0][1]<<circ.midc()[1]*circ.weight()<<circ.pts[2][1];
byt=seq2b(v); v.clear();
tensor::assign(yt.rep(),byt.rep());
v<<coeff_t(1)<<circ.weight()<<coeff_t(1);
bwt=seq2b(v); v.clear();
tensor::assign(wt.rep(),bwt.rep());
Seq<monom_t> paramv; paramv<<wt<<xt<<yt;
polyco=poly;
tensor::assign(monomp.rep(),polyco.rep());
tensor::heval(newnom, monomp.rep(), paramv );
let::assign(num.rep(),newnom.rep());
return(abs_max_coeff(num)/min_coeff(neww));
};
| coeff_t min_grad | ( | ) | [inline] |
Definition at line 420 of file fatarcs.hpp.
References mmx::add(), mmx::diff(), min_coeff(), and mmx::mul().
Referenced by solver_mv_fatarcs< C >::box_gen().
{
bernstein_t p0 = diff(poly,0);
bernstein_t p1 = diff(poly,1);
bernstein_t grad;
bernstein_t gradx0 = p0;
bernstein_t gradx1 = p1;
mul(gradx0.rep(),p0.rep());
mul(gradx1.rep(),p1.rep());
add(grad.rep(),gradx0.rep(),gradx1.rep());
return(min_coeff(grad));
}
| bool not_empty | ( | ) | [inline] |
Definition at line 338 of file fatarcs.hpp.
References max_coeff(), min_coeff(), and mmx::sign().
Referenced by solver_mv_fatarcs< C >::solver().
Definition at line 318 of file fatarcs.hpp.
Referenced by solver_mv_fatarcs< C >::box_gen().
Definition at line 319 of file fatarcs.hpp.
Referenced by median().