Library 5

fixed compile issues
This commit is contained in:
Alessandro Ferro
2021-05-31 11:26:27 +02:00
parent fe51a1b547
commit 4aa82d6108
42 changed files with 130 additions and 49 deletions

11
librerie/exercise5/matrix/csr/matrixcsr.hpp Normal file → Executable file
View File

@@ -12,7 +12,7 @@
namespace lasd {
template <typename Data>
class MatrixCSR : virtual public List<Data>,
class MatrixCSR : virtual public List<std::pair<Data,ulong>>,
virtual public Matrix<Data>{ // Must extend Matrix<Data>
protected:
@@ -20,11 +20,10 @@ protected:
using Matrix<Data>::rows;
using Matrix<Data>::columns;
using List<std::pair<Data,ulong>>::size;
Vector<struct List<std::pair<Data,ulong>>::Node**> R(1);
Vector<struct List<std::pair<Data,ulong>>::Node**> R;
using List<std::pair<Data,ulong>>::head;
using struct List<std::pair<Data,ulong>>::Node;
using typename List<std::pair<Data,ulong>>::Node;
/*
Node
@@ -42,7 +41,7 @@ public:
/* ************************************************************************ */
// Specific constructors
MatrixCSR(const ulong&, const ulong&); // A matrix of some specified dimension
MatrixCSR(const ulong, const ulong); // A matrix of some specified dimension
/* ************************************************************************ */
@@ -78,7 +77,7 @@ public:
void RowResize(const ulong&) override; // Override Matrix member
void ColumnResize(const ulong&) override; // Override Matrix member
bool ExistsCell(const ulong&, const ulong&) override noexcept; // Override Matrix member (should not throw exceptions)
bool ExistsCell(const ulong&, const ulong&) const noexcept override; // Override Matrix member (should not throw exceptions)
Data& operator()(const ulong&, const ulong&) override; // Override Matrix member (mutable access to the element; throw out_of_range when out of range)
const Data& operator()(const ulong&, const ulong&) const override; // Override Matrix member (immutable access to the element; throw out_of_range when out of range and length_error when not present)