|
Ublas : |
From: Dima Sorkin (dsorkin_at_[hidden])
Date: 2006-03-05 04:18:06
Quoting Eddie Vedder :
> searching the archive I couldn't make it clear how the initialization of new
> matrix elements is working, when using resize.
>
> I use a matrix<int> and calling resize initializes the new elements with the
> value -842150451. Is there a way to initialize new elements with zero?
It seems that you cant resize with "0". Assign "0" to each entry manually,
after resize.
You can "std::fill" into
"matrix<int>::array_type& matrix<int>::data ()", if you don't want loops.
Regards,
Dima.