1

I've been using boost for two days now. I'm still trying to figure out how to do a couple of things. As an example. I'm going to use the following matrix and vectors defined below Matrix A and vector V1, V2 and V3 which is an empty vector.

 Matrix A=
 3 2 5 9
 4 2 8 2
 3 3 1 1
 1 2 1 1
 2 1 1 4

  V1
   4 5 6 3 1
  V2
   4 2 4 5 6
  V3
  []

Which would be the best way to insert V1 and V2 into the Matrix A without doing several for loops? Is there any similar push_back function that allows me to do this?

Which would be the best way to copy a row from Matrix A to V3? I was thinking about something like this

std::copy(V3.begin(), V3.end(), m.begin1());

This will copy the first row into V3. What about if I want to copy a different row from Matrix A? Let's say that I want to copy row 2 [3 3 1 1] into V3?

Any advice will be appreciate it. Thank you for your help.

0 Answers0