LibRapid / librapid

A highly optimised C++ library for mathematical applications and neural networks.
http://librapid.rtfd.io
MIT License
164 stars 10 forks source link

Array iterators #198

Closed Pencilcaseman closed 1 year ago

Pencilcaseman commented 1 year ago

Add support for iterating over Array classes. This includes Array types (CPU and GPU), function types, more complex operations and ArrayViews.

Example:

auto myArr = lrc::fromData({{1, 2, 3}, {4, 5, 6}});
for (const auto &row : myArr) {
    fmt::print("{}\n", row);
}
// [1 2 3]
// [4 5 6]