X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2Fcml%2Fmatrix%2Ffixed.h;h=1a64938db45e48e31b8862ec3ae270b3f6cf25f0;hp=d20ccfaba4841b7259c5a2a17fde2530e92a5faa;hb=40755d4c6251206c18ce4784967d3a910cee096f;hpb=c2321281bf12a7efaedde930422c7ddbc92080d4 diff --git a/src/Moof/cml/matrix/fixed.h b/src/Moof/cml/matrix/fixed.h index d20ccfa..1a64938 100644 --- a/src/Moof/cml/matrix/fixed.h +++ b/src/Moof/cml/matrix/fixed.h @@ -71,10 +71,9 @@ class matrix,BasisOrient,Layout> /* To simplify the matrix transpose operator: */ typedef matrix< - Element, + typename cml::remove_const::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,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: