00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __MMX_SHAPE_ALGEBRAIC_CURVE_GLUE_HPP
00012 #define __MMX_SHAPE_ALGEBRAIC_CURVE_GLUE_HPP
00013 #include <basix/glue.hpp>
00014 #include <basix/tuple.hpp>
00015 #include <realroot/ring_sparse_glue.hpp>
00016 #include <shape/MGXK.hpp>
00017 #include <shape/axel_glue.hpp>
00018 #include <shape/bounding_box.hpp>
00019 #include <shape/algebraic_curve.hpp>
00020
00021 #define shape_algebraic_curve shape::algebraic_curve<rational,shape::MGXK>
00022 #define Polynomial polynomial< rational, with<Sparse,DegRevLex> >
00023 #define CURVE shape_algebraic_curve
00024
00025
00026 namespace mmx {
00027 namespace shape {
00028
00029 inline bool operator ==(const CURVE& v1, const CURVE& v2) {return true;}
00030 inline bool operator !=(const CURVE& v1, const CURVE& v2) {return !(v1==v2);}
00031 inline bool exact_eq(const CURVE& v1, const CURVE& v2) {return v1==v2;}
00032 inline bool exact_neq(const CURVE& v1, const CURVE& v2) {return v1!=v2;}
00033
00034 inline unsigned hash (const CURVE& v)
00035 {
00036 register unsigned i, h= 214365, n=1;
00037 for (i=0; i<n; i++) h= (h<<1) ^ (h<<5) ^ (h>>27) ;
00038 return h;
00039 }
00040 inline unsigned exact_hash (const CURVE& m) {return hash(m);}
00041 inline unsigned soft_hash (const CURVE& m) {return hash(m);}
00042
00043 inline syntactic flatten (const CURVE& s)
00044 {
00045 using namespace shape;
00046
00047 syntactic res = "AlgebraicCurve";
00048 if(s.nbequation()>1)
00049 return apply(res, mmx::flatten(s.equation(0)), mmx::flatten(s.equation(1)));
00050 else
00051 return apply(res, mmx::flatten(s.equation(0)));
00052 }
00053 }
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #undef CURVE
00074 #undef Polynomial
00075
00076 }
00077 #endif // __MMX_ALGEBRAIC_CURVE_GLUE_HPP