]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/cml/vector/fixed.h
cml version bump to 1.0.1
[chaz/yoink] / src / Moof / cml / vector / fixed.h
index b0659383c580a2ed28efecdd8480069d43de98ca..6ec9d2076bd7116faa50447a1f8c7a99a292a25a 100644 (file)
@@ -39,6 +39,9 @@ class vector< Element, fixed<Size> >
     /* Shorthand for the type of this vector: */
     typedef vector<Element,generator_type> vector_type;
 
+    /* The vector coordinate type: */
+    typedef Element coordinate_type;
+
     /* For integration into the expression template code: */
     typedef vector_type expr_type;
 
@@ -68,6 +71,12 @@ class vector< Element, fixed<Size> >
     typedef cml::et::assignable_tag assignable_tag;
 
 
+  public:
+
+    /** Static constant containing the vector's space dimension. */
+    enum { dimension = Size };
+
+
   public:
 
     /** Return square of the length. */
@@ -124,6 +133,17 @@ class vector< Element, fixed<Size> >
         }
     }
 
+    /** Return a subvector by removing element i.
+     *
+     * @internal This is horribly inefficient...
+     */
+    subvector_type subvector(size_t i) const {
+        subvector_type s;
+        for(size_t m = 0, n = 0; m < this->size(); ++ m)
+            if(m != i) s[n++] = (*this)[m];
+        return s;
+    };
+
 
   public:
 
This page took 0.018708 seconds and 4 git commands to generate.