Skip to content
This repository has been archived by the owner on Oct 25, 2019. It is now read-only.

Commit

Permalink
Minor bugfix: used reference to static const
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed May 5, 2018
1 parent c9a6c4a commit 621c86a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/cppmat/cppmat.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#define CPPMAT_WORLD_VERSION 0
#define CPPMAT_MAJOR_VERSION 6
#define CPPMAT_MINOR_VERSION 3
#define CPPMAT_MINOR_VERSION 4

#define CPPMAT_VERSION_AT_LEAST(x,y,z) \
(CPPMAT_WORLD_VERSION>x || (CPPMAT_WORLD_VERSION>=x && \
Expand Down
9 changes: 6 additions & 3 deletions src/cppmat/tensor2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ inline std::vector<size_t> tensor4<X>::shape() const
{
std::vector<size_t> out(4);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 4 ; ++i )
out[i] = mNd;

return out;
}
Expand All @@ -818,7 +819,8 @@ inline std::vector<size_t> tensor2<X>::shape() const
{
std::vector<size_t> out(2);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 2 ; ++i )
out[i] = mNd;

return out;
}
Expand All @@ -830,7 +832,8 @@ inline std::vector<size_t> vector<X>::shape() const
{
std::vector<size_t> out(1);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 1 ; ++i )
out[i] = mNd;

return out;
}
Expand Down
9 changes: 6 additions & 3 deletions src/cppmat/tensor3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,8 @@ inline std::vector<size_t> tensor4<X>::shape() const
{
std::vector<size_t> out(4);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 4 ; ++i )
out[i] = mNd;

return out;
}
Expand All @@ -833,7 +834,8 @@ inline std::vector<size_t> tensor2<X>::shape() const
{
std::vector<size_t> out(2);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 2 ; ++i )
out[i] = mNd;

return out;
}
Expand All @@ -845,7 +847,8 @@ inline std::vector<size_t> vector<X>::shape() const
{
std::vector<size_t> out(1);

std::fill(out.begin(), out.end(), mNd);
for ( size_t i = 0 ; i < 1 ; ++i )
out[i] = mNd;

return out;
}
Expand Down

0 comments on commit 621c86a

Please sign in to comment.