box_rep< C > Struct Template Reference

#include <fatarcs.hpp>

List of all members.

Public Types

Public Member Functions

Public Attributes


Detailed Description

template<class C>
struct box_rep< C >

Definition at line 307 of file fatarcs.hpp.


Member Typedef Documentation

Definition at line 315 of file fatarcs.hpp.

typedef polynomial< coeff_t ,with<Bernstein> > bernstein_t

Definition at line 313 of file fatarcs.hpp.

typedef domain<coeff_t> box_t

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.

typedef std::vector<coeff_t> vec_t

Definition at line 311 of file fatarcs.hpp.


Constructor & Destructor Documentation

box_rep ( bernstein_t  p  )  [inline]

Definition at line 323 of file fatarcs.hpp.

References box_rep< C >::box, and box_rep< C >::poly.

00323 {box_t bb; poly=p; box=bb; };

box_rep ( bernstein_t  p,
box_t  bb 
) [inline]

Definition at line 324 of file fatarcs.hpp.

References box_rep< C >::box, domain< C >::I, box_rep< C >::poly, and mmx::tensor::restrict().

00325   {
00326     bernstein_t pa=p;
00327 
00328     tensor::restrict(pa.rep(), 0 , bb.I[0].m , bb.I[0].M );
00329     tensor::restrict(pa.rep(), 1 , bb.I[1].m , bb.I[1].M );
00330    
00331     poly=pa;
00332     box=bb;
00333   };


Member Function Documentation

bool corner_event ( int  c1,
int  c2 
) [inline]

Definition at line 388 of file fatarcs.hpp.

References mmx::brnops::eval(), mmx::tensor::face(), box_rep< C >::first_nonzero(), is_small(), box_rep< C >::poly, and vec().

Referenced by box_rep< C >::event_list().

00388                                    {
00389   vec_t evc=vec(coeff_t(c1),coeff_t(c2));
00390   coeff_t v;
00391   eval(v, poly.rep(), evc );
00392   bernstein_t face_p, face_q;
00393  
00394   if ( is_small(v) ){      
00395     tensor::face(face_p, poly, 0, c2);
00396     tensor::face(face_q, poly, 1, c1);
00397 
00398     if (first_nonzero(face_p, c1)*first_nonzero(face_q, c2) < 0){return true; }else{ return false; };
00399 
00400   }else{ return false;};
00401 }

bool edge_event ( int  var,
int  n 
) [inline]

Definition at line 349 of file fatarcs.hpp.

References mmx::tensor::face(), box_rep< C >::poly, and mmx::sign().

Referenced by box_rep< C >::event_list().

00349                                   {
00350 
00351   bernstein_t face_p;
00352   int event = 0;
00353 
00354   tensor::face(face_p, poly, var, n);
00355   
00356   int stc = 0;
00357  
00358   for(unsigned i = 0 ; i < face_p.size() ; i++){
00359     if( stc*sign(face_p.rep()[i]) == -1 ){
00360       stc = sign(face_p.rep()[i]); event++;
00361     }
00362     else if ( stc == 0 && sign(face_p.rep()[i])!=0 ){
00363       stc = sign(face_p.rep()[i]);
00364     };
00365   }
00366   if(event==1){return true;}else{return false;};
00367 }/*edge event along ONE edge*/

Seq<vec_t> event_list (  )  [inline]

Definition at line 404 of file fatarcs.hpp.

References box_rep< C >::corner_event(), box_rep< C >::edge_event(), and vec().

Referenced by solver_mv_fatarcs< C >::box_gen().

00404                         { 
00405     Seq<vec_t> elist;
00406     if(edge_event( 0, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec(coeff_t(1),coeff_t(0));}
00407     if(edge_event( 0, 1)){elist<<vec(coeff_t(0),coeff_t(1))<<vec(coeff_t(1),coeff_t(1));}
00408     if(edge_event( 1, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec(coeff_t(0),coeff_t(1));}
00409     if(edge_event( 1, 1)){elist<<vec(coeff_t(1),coeff_t(0))<<vec(coeff_t(1),coeff_t(1));}
00410 
00411     if(corner_event( 0, 0)){elist<<vec(coeff_t(0),coeff_t(0))<<vec_t();}
00412     if(corner_event( 0, 1)){elist<<vec(coeff_t(0),coeff_t(1))<<vec_t();}
00413     if(corner_event( 1, 0)){elist<<vec(coeff_t(1),coeff_t(0))<<vec_t();}
00414     if(corner_event( 1, 1)){elist<<vec(coeff_t(1),coeff_t(1))<<vec_t();}
00415     return elist;
00416 
00417 } //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().

Referenced by box_rep< C >::corner_event().

00370                                           {
00371 
00372   int elem =0;
00373   int n = list.size();
00374   int j;
00375 
00376   for(int i = 0; i < n ; i++){
00377     if( e==0 ){ j=i; }else{j=n-i-1;}
00378     if( coeff_t(0)!=(list[j]) ){
00379       elem=sign(list[j]);
00380       break;
00381     }
00382   } 
00383   return elem;
00384 
00385 }

coeff_t max_eval ( arc_rep_t  circ  )  [inline]

Definition at line 437 of file fatarcs.hpp.

References abs_max_coeff(), mmx::array::assign(), Seq< C, R >::clear(), mmx::degree(), mmx::tensor::heval(), arc_rep< C >::midc(), min_coeff(), box_rep< C >::poly, pow(), arc_rep< C >::pts, seq2b(), and arc_rep< C >::weight().

Referenced by solver_mv_fatarcs< C >::box_gen().

00437                                 {
00438   bernstein_t neww, bxt, byt, bwt, num, polyco;
00439   monom_t monomp, newnom, xt, yt, wt;    
00440   Seq<coeff_t> v;
00441 
00442   v<<coeff_t(1)<<circ.weight()<<coeff_t(1);
00443   neww=seq2b( v );
00444   v.clear();
00445  
00446     pow(neww,degree(poly,0)+degree(poly,1));
00447 
00448     v<<circ.pts[0][0]<<circ.midc()[0]*circ.weight()<<circ.pts[2][0];
00449     bxt=seq2b(v); v.clear(); 
00450     tensor::assign(xt.rep(),bxt.rep());
00451     v<<circ.pts[0][1]<<circ.midc()[1]*circ.weight()<<circ.pts[2][1];
00452     byt=seq2b(v); v.clear(); 
00453     tensor::assign(yt.rep(),byt.rep());
00454     v<<coeff_t(1)<<circ.weight()<<coeff_t(1);
00455     bwt=seq2b(v); v.clear(); 
00456     tensor::assign(wt.rep(),bwt.rep());
00457   
00458     Seq<monom_t> paramv; paramv<<wt<<xt<<yt;
00459  
00460     polyco=poly;
00461     tensor::assign(monomp.rep(),polyco.rep());
00462     tensor::heval(newnom, monomp.rep(), paramv ); 
00463   
00464     let::assign(num.rep(),newnom.rep());
00465       
00466    return(abs_max_coeff(num)/min_coeff(neww));
00467 
00468 };

coeff_t min_grad (  )  [inline]

Definition at line 420 of file fatarcs.hpp.

References mmx::array::add(), mmx::brnops::diff(), min_coeff(), mmx::mul(), and box_rep< C >::poly.

Referenced by solver_mv_fatarcs< C >::box_gen().

00420                   {
00421 
00422   bernstein_t p0 = diff(poly,0);
00423   bernstein_t p1 = diff(poly,1);
00424   bernstein_t grad;
00425   bernstein_t gradx0 = p0; 
00426   bernstein_t gradx1 = p1;
00427 
00428  
00429   mul(gradx0.rep(),p0.rep());
00430   mul(gradx1.rep(),p1.rep()); 
00431   add(grad.rep(),gradx0.rep(),gradx1.rep());
00432 
00433   return(min_coeff(grad));
00434 }

bool not_empty (  )  [inline]

Definition at line 338 of file fatarcs.hpp.

References max_coeff(), min_coeff(), box_rep< C >::poly, and mmx::sign().

Referenced by solver_mv_fatarcs< C >::solver().

00338                 {
00339 
00340   if( sign(min_coeff(poly))*sign(max_coeff(poly)) > 0 ){
00341     return false;
00342   }
00343   else{ 
00344     return true; 
00345   }
00346 }/*detect empty boxes*/


Member Data Documentation

Definition at line 318 of file fatarcs.hpp.

Referenced by solver_mv_fatarcs< C >::box_gen(), and box_rep< C >::box_rep().


The documentation for this struct was generated from the following file:

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1