]> www.ginac.de Git - ginac.git/blobdiff - ginac/symmetry.h
- Cleanups: My evil plot of making ex::bp private may finally be carried
[ginac.git] / ginac / symmetry.h
index 440ece1883fae1b674a34bc0ac41bbcd214fdf11..bdcd261a7a45a0bf785b971723c823edf8ab6481 100644 (file)
@@ -99,15 +99,6 @@ private:
 
 
 // global functions
-inline const symmetry &ex_to_symmetry(const ex &e)
-{
-       return static_cast<const symmetry &>(*e.bp);
-}
-
-inline symmetry &ex_to_nonconst_symmetry(const ex &e)
-{
-       return static_cast<symmetry &>(*e.bp);
-}
 
 inline symmetry sy_none(void) { return symmetry(); }
 inline symmetry sy_none(const symmetry &c1, const symmetry &c2) { return symmetry(symmetry::none, c1, c2); }
@@ -167,6 +158,14 @@ inline ex symmetrize_cyclic(const ex & e, const exvector & v)
        return symmetrize(e, v.begin(), v.end());
 }
 
+// utility functions
+
+/** Specialization of is_exactly_a<symmetry>(obj) for symmetry objects. */
+template<> inline bool is_exactly_a<symmetry>(const basic & obj)
+{
+       return obj.tinfo()==TINFO_symmetry;
+}
+
 } // namespace GiNaC
 
 #endif // ndef __GINAC_SYMMETRY_H__