Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto whitespace=trailing-space
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@
*.exe
*.out
*.app

# macOS
.DS_Store
16 changes: 8 additions & 8 deletions lib/monomial_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ namespace gb
{}

monomial_static_t(const monomial_static& m)
: _size(m._size)
{
_size = m.size();
memcpy(_data, m._data, (std::size_t)(_size)*sizeof(pair_t));
std::copy(m._data, m._data + _size, _data);
}

monomial_static_t(const monomial_dynamic& m)
: _size(m.data()._size)
{
_size = m.size();
memcpy(_data, m.data()._data, (std::size_t)(_size)*sizeof(pair_t));
std::copy(m.data()._data, m.data()._data + _size, _data);
}

template<typename int_type>
Expand Down Expand Up @@ -264,15 +264,15 @@ namespace gb

monomial_static_t& operator=(const monomial_static& m)
{
_size = m.size();
memcpy(_data, m._data, (std::size_t)(_size)*sizeof(pair_t));
return *this;
_size = m._size;
std::copy(m._data, m._data + _size, _data);
return *this;
}

monomial_static_t& operator=(const monomial_dynamic& m)
{
_size = m.size();
memcpy(_data, m.data()._data, (std::size_t)(_size)*sizeof(pair_t));
std::copy(m.data()._data, m.data()._data + _size, _data);
return *this;
}

Expand Down
17 changes: 12 additions & 5 deletions lib/monomial_degrevlex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,19 @@ namespace gb

struct const_iterator_end {};
class const_iterator
: public std::iterator<std::forward_iterator_tag, pair_t>
{
int _d;
unsigned _li;
int_type _v;
pair_t _ve;
public:
using iterator_category = std::forward_iterator_tag;
using value_type = pair_t;
using difference_type = std::ptrdiff_t;
using pointer = const pair_t*;
using reference = const pair_t&;

private:
int _d;
unsigned _li;
int_type _v;
pair_t _ve;
public:
const_iterator()
: _d(-1)
Expand Down
2 changes: 1 addition & 1 deletion src/m4gb.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ namespace gb
barrier_t& barrier;
std::atomic_size_t& index;
};
for (int i = 0; i < threadpool.size() + 1; ++i)
for (std::size_t i = 0; i < threadpool.size() + 1; ++i)
threadpool.push(worker_t(*this, mat, barrier, index));
threadpool.wait_work();
for (int i = 0; i < (int)(mat.size());)
Expand Down