Exercise 5

bug fix
This commit is contained in:
Alessandro Ferro
2021-05-31 17:46:48 +02:00
parent 4aa82d6108
commit 980fce4cb7
6 changed files with 26 additions and 18 deletions

View File

@@ -218,6 +218,7 @@ Data& MatrixCSR<Data>::operator()(const ulong& r, const ulong& c){
struct List<std::pair<Data,ulong>>::Node* nextNode = *ptr;
*ptr = newNode;
newNode->next = nextNode;
(newNode->value).second = c;
if(last == ptr){ // the newely inserted element is the last one in its row
for(ulong i=r+1 ; i<R.Size() ; ++i){ // then for each next row