00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00026 #ifndef _ARAGELI_resultant_hpp_
00027 #define _ARAGELI_resultant_hpp_
00028
00029 #include "config.hpp"
00030
00031 #include "polyalg.hpp"
00032 #include "matrix.hpp"
00033
00034
00035 namespace Arageli
00036 {
00037
00038
00040
00043 template <typename P1, typename P2, typename M>
00044 M& sylvester_fill (const P1& p1, const P2& p2, M& res);
00045
00046
00048
00052 template <typename P1, typename P2, typename M, typename MTFactory>
00053 M& sylvester (const P1& p1, const P2& p2, M& res, MTFactory fctr);
00054
00055
00057 template <typename P1, typename P2, typename M>
00058 inline M& sylvester (const P1& p1, const P2& p2, M& res)
00059 { return sylvester(p1, p2, res, factory<typename M::element_type>()); }
00060
00061
00063 template <typename P1, typename P2>
00064 inline matrix<typename P1::coef_type> sylvester
00065 (const P1& p1, const P2& p2)
00066 {
00067
00068
00069
00070 matrix<typename P1::coef_type> res;
00071 return sylvester(p1, p2, res);
00072 }
00073
00074
00076
00080 template <typename P1, typename P2, typename SRChain, typename PCFactory>
00081 void subresultants_nonmodular
00082 (const P1& p1, const P2& p2, SRChain& s, PCFactory fctr);
00083
00084
00086
00087 template <typename P1, typename P2, typename SRChain>
00088 inline void subresultants_nonmodular
00089 (const P1& p1, const P2& p2, SRChain& s)
00090 {
00091
00092
00093
00094 subresultants_nonmodular(p1, p2, s, factory<typename P1::coef_type>());
00095 }
00096
00098
00100 template <typename P1, typename P2, typename PCFactory>
00101 typename P1::coef_type resultant_nonmodular
00102 (const P1& p1, const P2& p2, PCFactory fctr);
00103
00104
00106
00107 template <typename P1, typename P2>
00108 inline typename P1::coef_type resultant_nonmodular
00109 (const P1& p1, const P2& p2)
00110 {
00111
00112
00113
00114 return resultant_nonmodular(p1, p2, factory<typename P1::coef_type>());
00115 }
00116
00117
00119 template <typename P1, typename P2, typename PCFactory>
00120 inline typename P1::coef_type resultant
00121 (const P1& p1, const P2& p2, PCFactory fctr)
00122 {
00123
00124
00125
00126 return resultant_nonmodular(p1, p2, fctr);
00127 }
00128
00130 template <typename P1, typename P2>
00131 inline typename P1::coef_type resultant
00132 (const P1& p1, const P2& p2)
00133 {
00134
00135
00136
00137
00138 return resultant(p1, p2, factory<typename P1::coef_type>());
00139 }
00140
00141
00142 }
00143
00144
00145 #ifdef ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE
00146 #define ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_resultant
00147 #include "resultant.cpp"
00148 #undef ARAGELI_INCLUDE_CPP_WITH_EXPORT_TEMPLATE_resultant
00149 #endif
00150
00151 #endif // #ifndef _ARAGELI_resultant_hpp_