Boost logo

Boost :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-05-21 14:25:19


Lars Schouw skrev:
> Is there any easy way to assign values to a boost::multi_array?
>
> boost::multi_array<double, 2> abd(boost::extents[4][33]);
> abd[0][0] = 1.00; abd[0][1] = 0.00; abd[0][2] = 0.00; abd[0][3] = 0.10;
> ...
>
>
> I would like to do
>
> abd = boost::assign::list_of(1.00)(0.00)(0.00)(0.10)
>
> But realize this might be a little more tricky with higher dimensions but still possible.
>

What do you want to do with non-provided values? Zero-initialize them?

-Thorsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk