X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2Fcml%2Fvector%2Ffixed.h;h=6ec9d2076bd7116faa50447a1f8c7a99a292a25a;hp=b0659383c580a2ed28efecdd8480069d43de98ca;hb=50c1239917f5e443b8ec91773c85ceb3db7da67b;hpb=1dd005530930657fd6216edc1dfcfa4c270a81c9 diff --git a/src/Moof/cml/vector/fixed.h b/src/Moof/cml/vector/fixed.h index b065938..6ec9d20 100644 --- a/src/Moof/cml/vector/fixed.h +++ b/src/Moof/cml/vector/fixed.h @@ -39,6 +39,9 @@ class vector< Element, fixed > /* Shorthand for the type of this vector: */ typedef vector 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 > 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 > } } + /** 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: