#include <solver_fatarcs.hpp>
Definition at line 14 of file solver_fatarcs.hpp.
Definition at line 21 of file solver_fatarcs.hpp.
typedef polynomial< C ,with<Bernstein> > bernstein_t |
Definition at line 19 of file solver_fatarcs.hpp.
Definition at line 20 of file solver_fatarcs.hpp.
Definition at line 18 of file solver_fatarcs.hpp.
Definition at line 23 of file solver_fatarcs.hpp.
Definition at line 22 of file solver_fatarcs.hpp.
typedef std::vector<C> vec_t |
Definition at line 17 of file solver_fatarcs.hpp.
solver_mv_fatarcs | ( | bernstein_t | p1, | |
bernstein_t | p2, | |||
C | eps | |||
) | [inline] |
Definition at line 29 of file solver_fatarcs.hpp.
References solver_mv_fatarcs< C >::epsilon, solver_mv_fatarcs< C >::poly1, and solver_mv_fatarcs< C >::poly2.
Definition at line 34 of file solver_fatarcs.hpp.
References box_rep< C >::box, C, box_rep< C >::event_list(), extpts(), is_arc(), box_rep< C >::max_eval(), median(), box_rep< C >::min_grad(), minmax_box(), Seq< C, R >::size(), and mmx::sqrt().
Referenced by solver_mv_fatarcs< C >::solver().
00035 { 00036 00037 arc_rep_t mc1,mc2; 00038 Seq<vec_t> l1=m1.event_list(); 00039 if(l1.size()==4){mc1=median(m1, l1, MTH);}else{mc1=arc_rep_t();}; 00040 Seq<vec_t> l2=m2.event_list(); 00041 if(l2.size()==4){mc2=median(m2, l2, MTH);}else{mc2=arc_rep_t();}; 00042 00043 box_t bbox=m1.box; 00044 00045 if(is_arc(mc1) && is_arc(mc2)){ 00046 00047 C c1=m1.min_grad();//std::cout << c1 <<std::endl; 00048 C c2=m2.min_grad();//std::cout << c2 <<std::endl; 00049 if(c1>C(0) && c2>C(0) ){ 00050 C r1=m1.max_eval(mc1)/sqrt(c1);//std::cout << r1 <<std::endl; 00051 C r2=m2.max_eval(mc2)/sqrt(c2);//std::cout << r2 <<std::endl; 00052 Seq<vec_t> extrema; 00053 extrema=extpts(mc1,r1,mc2,r2); 00054 00055 bbox=minmax_box(extrema, m1.box); 00056 }else{/*std::cout << "no grad "<<std::endl;*/} 00057 }else{/*std::cout << "no med "<<std::endl;*/} 00058 00059 return(bbox); 00060 };/*box around fatarc intersection*/
void prepro | ( | bernstein_t & | pol1, | |
bernstein_t & | pol2, | |||
vec_t | midpt | |||
) | [inline] |
Definition at line 64 of file solver_fatarcs.hpp.
References C, mmx::brnops::diff(), mmx::brnops::eval(), and mmx::rep().
00065 { 00066 bernstein_t p1=pol1,p2=pol2; 00067 C c1x,c1y,c2x,c2y; 00068 tensor::eval(c1x, diff(p1,0).rep(),midpt); 00069 tensor::eval(c2x, diff(p2,0).rep(),midpt); 00070 tensor::eval(c1y, diff(p1,1).rep(),midpt); 00071 tensor::eval(c2y, diff(p2,1).rep(),midpt); 00072 if(c1x!=c1y && c2x!=c2y){ 00073 pol1=c1x*p1+c2x*p2; 00074 pol2=c1y*p1+c2y*p2; } 00075 };
SOLVE ROUTINE.
Definition at line 79 of file solver_fatarcs.hpp.
References solver_mv_fatarcs< C >::box_gen(), C, domain< C >::diam(), domain< C >::dim(), solver_mv_fatarcs< C >::epsilon, box_rep< C >::not_empty(), solver_mv_fatarcs< C >::poly1, solver_mv_fatarcs< C >::poly2, and domain< C >::split().
Referenced by solve_bv_fatarcs().
00079 { 00080 stbox_t list, mo; 00081 seqbox_t moseq; 00082 00083 int subdiv=0; 00084 int arcgen=0; 00085 int it=0; 00086 00087 box_t unit(int(2)); 00088 box_t p[4]; 00089 list.push(unit); 00090 00091 while(!list.empty()){it++; 00092 00093 box_t rec=list.top(); 00094 00095 list.pop(); 00096 00097 box_rep_t m1(poly1, rec); 00098 box_rep_t m2(poly2, rec); 00099 00100 if(m1.not_empty() && m2.not_empty()){ 00101 00102 // prepro( m1.poly, m2.poly, (rec.llc()+rec.urc())/((coeff_t)(2))); 00103 // std::cout <<"b"<<std::endl; 00104 box_t newrec=box_gen(m1, m2, MTH); arcgen++; 00105 00106 00107 if(newrec.dim()==0){ //std::cout <<"no fatarc intersection"<<std::endl; 00108 }else{ //std::cout <<"new"<<std::endl;newrec.print(5); 00109 if(newrec.diam() <( rec.diam()/ C(2) ) ){; 00110 00111 if(newrec.diam()<epsilon){mo.push(newrec);//std::cout <<"small1"<<std::endl; newrec.print(6); 00112 } 00113 else{list.push(newrec);//std::cout <<"list new"<<std::endl; 00114 } 00115 00116 } 00117 else{ 00118 if(rec.diam()<epsilon){mo.push(rec);} 00119 else{rec.split(p);subdiv++;/*std::cout <<"sub1"<<std::endl;*/ 00120 for(int i=0; i<4; i++){list.push(p[3-i]);} 00121 } 00122 00123 }; 00124 00125 }; 00126 00127 }else{//std::cout <<"empty"<<std::endl; 00128 }; 00129 } 00130 00131 00132 00133 std::cout << " * * * * * "<<std::endl; 00134 std::cout << "iteration: "<<it<<std::endl; 00135 std::cout << "subdivisoins: "<<subdiv<<std::endl; 00136 std::cout << "try fatarc generation: "<<arcgen<<std::endl; 00137 //std::cout << "solution: "<<mo.size()<<std::endl; 00138 00139 00140 while(!mo.empty()){ 00141 00142 box_t rb=mo.top(); 00143 moseq<< rb; 00144 mo.pop(); 00145 }; 00146 00147 return moseq; 00148 00149 00150 }/*solver*/
C epsilon |
Definition at line 25 of file solver_fatarcs.hpp.
Referenced by solver_mv_fatarcs< C >::solver(), and solver_mv_fatarcs< C >::solver_mv_fatarcs().
Definition at line 26 of file solver_fatarcs.hpp.
Referenced by solver_mv_fatarcs< C >::solver(), and solver_mv_fatarcs< C >::solver_mv_fatarcs().
Definition at line 26 of file solver_fatarcs.hpp.
Referenced by solver_mv_fatarcs< C >::solver(), and solver_mv_fatarcs< C >::solver_mv_fatarcs().