00001 #include "matrix.h"
00002 #include <algorithm>
00003 #include "vecdouble.h"
00004
00005 void Matrix::fill(double value)
00006 {
00007 std::fill_n (val, n_elements(), value);
00008 }
00009
00010
00011 void Matrix::fill_row (unsigned row, double value)
00012 {
00013 assert(row < this->m());
00014
00015 for (unsigned i=0; i < this->n() ; i++)
00016 {
00017 (*this)(row, i)=value;
00018 }
00019 }
00020
00021
00022 void Matrix::copyColumn(VecDouble &vc,unsigned col)
00023 {
00024 assert(vc.size() == m());
00025 assert(col < n());
00026 for (unsigned i=0;i<m();i++)
00027 {
00028 vc(i)=operator()(i,col);
00029 }
00030 }