mat<int> m{{1, 2, 3},
{4, 5, 6}};
EXPECT_EQ(m(1, 1), 5);
EXPECT_THAT(m(all, all), MatEq({{1, 2, 3}, {4, 5, 6}}));
EXPECT_THAT(m(all, 1), MatEq({{2}, {5}}));
EXPECT_THAT(m(first<1>, first(2)), MatEq({{1, 2}}));
EXPECT_THAT(m(0, last(2)), MatEq({{2, 3}}));
EXPECT_THAT(m(range(0, 1), 1), MatEq({{2}, {5}}));
EXPECT_THAT(m(range(0, 1), range<1, 2>), MatEq({{2, 3}, {5, 6}}));
EXPECT_THAT(m(static_sized_range<2>(0), 1), MatEq({{2}, {5}}));
Regarding API naming and convention, I also much prefer a matlab/STL like syntax of normalized(v) instead of v.normalized(), as well as writing cwise_max instead of cwiseMax, so I also have those aliases in my plugin. But I guess those are for another thread.