c++ - filling a boost vector or matrix -


Is there a single expression method that specifies the scalar for all the elements of the matrix or vector? I am trying to find a more compact way of representing:

  boost :: numeric :: ublas :: c_vector & lt; Float, N & gt; V; For (size_t i = 0; i  

The following do not work:

  Prompt: numeric :: ublas :: c_vector < Float, N & gt; V (myScalar, myScalar, ... and so on ..., myScalar); Promotion :: Numeric :: ublas :: c_vector & lt; Float, N & gt; V; V = myScalar;  

Because vector should be able to use a standard random access container model STL Algorithm something like this:

  c_vector & lt; Float, N & gt; Vec; Std :: fill_n (vec.begin (), n, 0.0f);  

or

  std :: fill (vec.begin (), vec.end (), 0.0f);  

This is probably compatible with Boost. Assign but you have to check.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -