|
Ublas : |
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2007-09-10 14:41:42
Am Montag, 10. September 2007 17:05 schrieb Mei, Longyu:
> I have two arrays, say A(12,3,4,5) and B(5,4,3,2,1). If I want to
> create a matrix C with values inside those two arrays. Do I need to
> insert all values manually via C(0,0) = 1; C(0,1) = 2; ...?
I am not sure what you really mean - but there is no explicit
constructor from an array or set of arrays. Thus copying data is the
most convenient way to initialize a matrix.
If you really need a matrix that uses pre-allocated data then you have
to use the array_adaptor from storage.hpp. (There was a long discussion
about these on this list. Look for "carray_adaptor and array adaptors
in general" )
mfg
Gunter