Commit e32ddfee authored by Paul's avatar Paul
Browse files

Formatting

parent 8724a471
...@@ -117,14 +117,14 @@ std::size_t shape::index(std::size_t i) const ...@@ -117,14 +117,14 @@ std::size_t shape::index(std::size_t i) const
return i; return i;
else else
{ {
std::size_t s = 1; std::size_t s = 1;
std::size_t result = 0; std::size_t result = 0;
for(std::size_t j = 0;j < this->lens().size();j++) for(std::size_t j = 0; j < this->lens().size(); j++)
{ {
const std::size_t k = this->lens().size() - j - 1; const std::size_t k = this->lens().size() - j - 1;
const std::size_t stride = this->strides()[k]; const std::size_t stride = this->strides()[k];
const std::size_t len = this->lens()[k]; const std::size_t len = this->lens()[k];
const std::size_t idx = (i % (s * len)) / s; const std::size_t idx = (i % (s * len)) / s;
result += stride * idx; result += stride * idx;
s *= len; s *= len;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment