mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Implement copy.
This commit is contained in:
parent
b1319eb3ee
commit
df50762498
@ -40,6 +40,14 @@ SparseMatrix::SparseMatrixIterator SparseMatrix::IteratorCombiner::end()
|
||||
return SparseMatrixIterator(nullptr, m_isRow);
|
||||
}
|
||||
|
||||
SparseMatrix::SparseMatrix(SparseMatrix const& _other)
|
||||
{
|
||||
ensureSize(_other.rows(), _other.columns());
|
||||
for (size_t row = 0; row < _other.rows(); row++)
|
||||
for (auto&& entry: const_cast<SparseMatrix&>(_other).iterateRow(row))
|
||||
prependInRow(nullptr, row, entry.col, entry.value);
|
||||
}
|
||||
|
||||
SparseMatrix::IteratorCombiner SparseMatrix::iterateColumn(size_t _column)
|
||||
{
|
||||
return IteratorCombiner{
|
||||
|
@ -239,6 +239,12 @@ public:
|
||||
SparseMatrixIterator end();
|
||||
};
|
||||
|
||||
SparseMatrix() = default;
|
||||
SparseMatrix(SparseMatrix const&);
|
||||
SparseMatrix(SparseMatrix&&) = default;
|
||||
SparseMatrix& operator=(SparseMatrix const& _other) { *this = SparseMatrix(_other); return *this; }
|
||||
SparseMatrix& operator=(SparseMatrix&&) = default;
|
||||
|
||||
size_t rows() const { return m_row_start.size(); }
|
||||
size_t columns() const { return m_col_start.size(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user