]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/cml/matrix/fixed.h
version bump cml to version 1.0.2
[chaz/yoink] / src / Moof / cml / matrix / fixed.h
index d20ccfaba4841b7259c5a2a17fde2530e92a5faa..1a64938db45e48e31b8862ec3ae270b3f6cf25f0 100644 (file)
@@ -71,10 +71,9 @@ class matrix<Element,fixed<Rows,Cols>,BasisOrient,Layout>
 
     /* To simplify the matrix transpose operator: */
     typedef matrix<
-        Element,
+        typename cml::remove_const<Element>::type,
         typename array_type::transposed_type::generator_type,
-        BasisOrient,
-        Layout
+        BasisOrient, Layout
     > transposed_type;
 
     /* To simplify the matrix row and column operators: */
@@ -198,6 +197,16 @@ class matrix<Element,fixed<Rows,Cols>,BasisOrient,Layout>
         set_basis_element(i,j,s,basis_orient());
     }
 
+    /** Set the matrix row from the given vector. */
+    void set_row(size_t i, const row_vector_type& row) {
+      for(size_t j = 0; j < this->cols(); ++ j) (*this)(i,j) = row[j];
+    }
+
+    /** Set the matrix column from the given vector. */
+    void set_col(size_t j, const col_vector_type& col) {
+      for(size_t i = 0; i < this->rows(); ++ i) (*this)(i,j) = col[i];
+    }
+
 
   public:
 
This page took 0.017435 seconds and 4 git commands to generate.