]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/cml/matrix/external.h
cml version bump to 1.0.1
[chaz/yoink] / src / Moof / cml / matrix / external.h
index 36c225a067b84cdf4dc4b1533f501c398f59f820..1af926627344d107e4095b7ea805a8ba8bcd99d6 100644 (file)
@@ -221,6 +221,16 @@ class matrix<Element,external<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:
 
@@ -440,6 +450,8 @@ class matrix<Element,external<-1,-1>,BasisOrient,Layout>
      * responsible for doing any necessary memory management.
      *
      * @param ptr specify the external pointer.
+     * @param rows the number of rows in the C array.
+     * @param cols the number of columns in the C array.
      *
      * @throws same as the ArrayType constructor.
      */
This page took 0.019615 seconds and 4 git commands to generate.