sturm.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002     
00003     sturm.hpp -- The Sturm algorithm for location of roots.
00004 
00005     This file is a part of the Arageli library.
00006 
00007     Copyright (C) Nikolai Yu. Zolotykh, 1999--2006
00008     Copyright (C) Sergey S. Lyalin, 2005 -- 2006
00009     University of Nizhni Novgorod, Russia
00010 
00011 *****************************************************************************/
00012 
00021 #ifndef _ARAGELI_sturm_hpp_
00022 #define _ARAGELI_sturm_hpp_
00023 
00024 #include "config.hpp"
00025 
00026 #include "exception.hpp"
00027 #include "factory.hpp"
00028 #include "vector.hpp"
00029 
00030 
00031 namespace Arageli
00032 {
00033 
00034 
00036 
00037 template <typename P, typename SS>
00038 void sturm_diff_sys (const P& p, SS& ss);
00039 
00040 
00042 
00047 template <typename SS, typename T>
00048 typename SS::size_type sturm_sign_changes
00049 (const SS& ss, const T& x, int signpx);
00050 
00051 
00053 template <typename SS, typename T>
00054 inline typename SS::size_type sturm_sign_changes (const SS& ss, const T& x)
00055 {
00056     ARAGELI_ASSERT_0(!ss.is_empty());
00057     return sturm_sign_changes(ss, x, sign(ss.front().subs(x)));
00058 }
00059 
00060 
00062 template <typename SS, typename Seg>
00063 typename SS::size_type sturm_number_roots (const SS& ss, const Seg& seg);
00064 
00065 
00067 template <typename SS, typename SegT, bool SegREFCNT>
00068 vector<typename SS::size_type> sturm_number_roots
00069 (
00070     const SS& ss,
00071     const vector<SegT, SegREFCNT>& lims // WARNING! We need to replace explicit vector.
00072 );
00073 
00074 
00076 
00080 template <typename T, typename P, typename LIMS, typename SegBound>
00081 void sturm (const P& p, LIMS& lims, SegBound bs);
00082 
00083 
00085 
00086 template <typename T, typename P, typename LIMS>
00087 inline void sturm (const P& p, LIMS& lims)
00088 { sturm<T>(p, lims, interval<T>(unit<T>(), null<T>())); }
00089 
00090 
00092 
00094 template <typename P, typename Lims>
00095 bool interval_root_dichotomy (const P& p, int lsign, Lims& lims);
00096 
00097 
00099 
00101 template <typename P, typename Lims, typename T>
00102 bool interval_root_precise (const P& p, Lims& lims, const T& e);
00103 
00104 
00106 
00107 template <typename T, typename P, typename Roots, typename Prec>
00108 void roots_poly_real
00109 (
00110     const P& p, Roots& roots,
00111     Prec& prec, const T& e = null<T>()
00112 );
00113 
00114 
00115 } // namesapce Arageli
00116 
00117 
00118 #ifdef ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE
00119     #define ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_STURM
00120     #include "sturm.cpp"
00121     #undef  ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_STURM
00122 #endif
00123 
00124 #endif

Generated on Thu Aug 31 17:38:11 2006 for Arageli by  doxygen 1.4.7