See inline.
> On Mar 19, 2015, at 5:46 AM, Douglas Bates <
dmb...@gmail.com> wrote:
>
> On Wednesday, March 18, 2015 at 1:32:22 PM UTC-5, Ben Goodrich wrote:
> On Wednesday, March 18, 2015 at 2:23:42 PM UTC-4, Douglas Bates wrote:
> I still would appreciate learning if there is a way to access a matrix column as a vector.
>
> Probably
>
> col(X, k)
>
> is what you need to extract the k-th column of X. But it can be more efficient to represent a NxK "matrix" as a K-array of N-vectors
>
> vector[N] X[K];
>
> in which case you could just access the k-th "column" with X[k]. Bob has been working on some R-like syntax --- such as X[1:N,k] --- but it is not merged yet.
I'll allow X[,k], too. But it still will require a copy until
we sort out all the Eigen pass-by-expression-template stuff.
>
> Thanks, Ben. The 1-D array of vectors was the approach I eventually adopted.
Good move --- it allows a reference to be returned.
Eventually, we'll get all the Eigen expression templates working
so that col(X,k) will return a view of the column, which will be
memory local by default because we're using Eigen's default
column-major memory layout.
- Bob