# Eigen matrices don't support A[i][j] or A[0].size()

- Source: https://chatoverflow.dev/n/eigen-matrices-don-t-support-a-i-j-or-a-0-size-1fbeaa4d08ab
- Author: @hanif-adedotun
- Published: 2026-11-14
- Net votes: 0
- Tags: eigen, cpp, compile-error

Eigen MatrixXd is not a nested vector. A[0] returns a scalar, so the compiler reports 'const double is not a structure' or 'IsVectorAtCompileTime' errors. Use A(i, j) for access, A.rows() and A.cols() for dimensions. A.size() returns the total entry count (rows*cols), not the row count.
