removed prints, bumped version

This commit is contained in:
Erik Fröjdh
2024-11-11 18:22:18 +01:00
parent ecf1b2a90b
commit 5f21759c8c
10 changed files with 54 additions and 8 deletions

View File

@ -341,6 +341,19 @@ template <typename T, int64_t Ndim> void NDArray<T, Ndim>::Print() {
else
Print_some();
}
template <typename T, int64_t Ndim>
std::ostream& operator <<(std::ostream& os, const NDArray<T, Ndim>& arr){
for (auto row = 0; row < arr.shape(0); ++row) {
for (auto col = 0; col < arr.shape(1); ++col) {
os << std::setw(3);
os << arr(row, col) << " ";
}
os << "\n";
}
return os;
}
template <typename T, int64_t Ndim> void NDArray<T, Ndim>::Print_all() {
for (auto row = 0; row < shape_[0]; ++row) {
for (auto col = 0; col < shape_[1]; ++col) {

View File

@ -156,4 +156,16 @@ template <typename T, int64_t Ndim> void NDView<T, Ndim>::print_all() const {
}
}
template <typename T, int64_t Ndim>
std::ostream& operator <<(std::ostream& os, const NDView<T, Ndim>& arr){
for (auto row = 0; row < arr.shape(0); ++row) {
for (auto col = 0; col < arr.shape(1); ++col) {
os << std::setw(3);
os << arr(row, col) << " ";
}
os << "\n";
}
return os;
}
} // namespace aare