diff --git a/mlpp/lin_alg/mlpp_tensor3.cpp b/mlpp/lin_alg/mlpp_tensor3.cpp index 7639e8e..82a80dc 100644 --- a/mlpp/lin_alg/mlpp_tensor3.cpp +++ b/mlpp/lin_alg/mlpp_tensor3.cpp @@ -2223,26 +2223,25 @@ void MLPPTensor3::set_from_std_vectors(const std::vector> &fm = p_from[k]; + for (uint32_t z = 0; z < p_from.size(); ++z) { + const std::vector> &vxy = p_from[z]; - for (uint32_t i = 0; i < p_from.size(); ++i) { - const std::vector &r = fm[i]; + for (uint32_t y = 0; y < vxy.size(); ++y) { + ERR_CONTINUE(vxy.size() != static_cast(_size.y)); - ERR_CONTINUE(r.size() != static_cast(_size.x)); + const std::vector &vx = vxy[y]; - int start_index = i * _size.x; + ERR_CONTINUE(vx.size() != static_cast(_size.x)); - const real_t *from_ptr = &r[0]; - for (int j = 0; j < _size.x; j++) { - _data[start_index + j] = from_ptr[j]; + for (uint32_t x = 0; x < vx.size(); ++x) { + element_set(y, x, z, vx[x]); } } }