0

As an armadillo new-be, it seems like return types are hard to find in the documentation. Specifically, whether a rowvec(vector_of_indices) operation return another rowvec, or a (col)vec??

uvec indx; rowvec c; What class is c(indx) ?

Dr. E.C.
  • 11
  • 1
  • The return types are probably not documented explicitly as Armadillo heavily uses expression templates. The return types are not an actual matrix or vector, but instead describe the operation to be performed (so-called [lazy evaluation](https://en.wikipedia.org/wiki/Lazy_evaluation)) that can be assigned to a matrix or vector. – mtall Jan 21 '19 at 01:15
  • Expected to get a back rowvec but instead it looks like an arma::subview_elem1 > – Dr. E.C. Jan 21 '19 at 12:23

1 Answers1

0

rowvec is actually a convenience class for Row<double>[Armadillo Row doc ] and indexing it returns a subview of the same class [Armadillo submat doc ]

The return values are not always stated in the documentation but it usually has some nice examples to give you a hint.

Claes Rolen
  • 1,446
  • 1
  • 9
  • 21