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