views:

60

answers:

1

hi i've looked into the vector duplicate of this but couldn't find answer

ublas::matrix<int> input;
fill(input.begin1(), input.end1(), in_val);
fill(input.begin2(), input.end2(), in_val);

but it gives me

[2,3] {(3,3,3) (3,0,0)}

as you can guess i just want to fill all of it with init_val=3 , Thanks.

A: 

use http://www.boost.org/doc/libs/1_43_0/libs/numeric/ublas/doc/matrix.htm#scalar_matrix

you can also use array storage, matrix.data() which is range concept (began/end) directly, but I think it is not good idea in general

aaa
sorry tht's not working (error: no match for ‘operator=’ in ‘((Layer<int>*)this)->Layer<int>::input = in_val’/usr/include/boost/numeric/ublas/matrix.hpp:184:
ismail marmoush
@ism sorry, that was my local hack. I put update
aaa
thanks mate , i made a template function for matrix<T>
ismail marmoush