Array of vector

I’m confused with multiple indexing for “array of vector”. Very much appreciate if you can help explain the following problem:

For example, let’s say an array of vector “vector[5] A [6]”.
Then, is A[:, 1] an array or array of (1-element) vector?

Similarly, is “rep_array(0, 5, 1)” an array or array of vector?

  • A[:, 1] is an array of 6 reals (the first elements of each of the 6 vectors).
  • A[1, :] (or just A[1] for short) would be a vector of length 5 (the first of the 6 vectors of length 5).

Since 0 is just a scalar of type real this results in a real array, not an array of vectors. If you put something declared as type vector into rep_array you can get an array of vectors. More details here:

Thanks a lot!