synaps/usolve/ContFrac.h

00001 
00002 #ifndef _SYNAPS_SOLVE_CONTFRAC_H_
00003 #define _SYNAPS_SOLVE_CONTFRAC_H_
00004 
00005 #include <synaps/init.h>
00006 #include <synaps/arithm/Interval.h>
00007 #include <synaps/arithm/NumberTraits.h>
00008 #include <synaps/arithm/RealOf.h>
00009 #include <synaps/upol/UPolDse.h>
00010 #include <synaps/usolve.h>
00011 
00012 #include <synaps/usolve/solver_base.h>
00013 #include <synaps/usolve/Small_degree.h>
00014 #include <synaps/usolve/sturm/common.h>
00015 #include <synaps/usolve/sturm/solve_sturm_contfrac.h>
00016 
00017 
00018 __BEGIN_NAMESPACE_SYNAPS
00019 
00020 
00022 template < class NT >
00023 struct ContFrac : public Small_degree<NT>
00024 {
00025     typedef ContFrac          self_t;
00026 };
00027 
00028 
00029 
00030 template < class NT > inline
00031 Seq< typename ContFrac<NT>::RO_t > 
00032 solve( const typename ContFrac<NT>::Poly& f, ContFrac<NT>)
00033 {
00034     typedef ContFrac<NT>            K;
00035     typedef typename K::RO_t     RO_t;
00036     
00037     Seq<RO_t> sol;
00038     
00039     ALGEBRAIC::solve_contfrac(f, std::back_inserter(sol.rep()), K());
00040     std::stable_sort( sol.begin(), sol.end(), ALGEBRAIC::Refine_compare());
00041     
00042     return sol;
00043 }
00044 
00045 
00046 
00047 __END_NAMESPACE_SYNAPS
00048 
00049 #endif // _SYNAPS_SOLVE_CONTFRAC_H_
00050 

SYNAPS DOCUMENTATION
logo