<commit_before>/* ---------------------------------------------------------------------------
** This software is implemented as part of the course Dynamic Algorithms 
** (Q4 2015) at Aarhus Univerity Denmark. 
**
** TD_EAGER.h
** Implementation of a truly dynamic algorithm for dynamic transitive closure
** based on Shankowsis randomized reduction of dynamic transitive closure to dynamic matrix adjoint.
**
** Author: <NAME> and <NAME>
** -------------------------------------------------------------------------*/

#ifndef _TD_EAGER_H
#define _TD_EAGER_H

#include "TC.h"
#include "utils.h"
#include <iostream>

class TD_EAGER : public TC {
private:
	uint32_t *adjacency_matrix; //this stores all the inserts/deletes that have happened
	uint32_t *inverse_matrix; //this stores the inverse that we want to maintain
	int n;
	int count;
	void updateInverseMatrix(int i, int j, uint32_t u);
	
public:
	const char* get_name() {
		return "Truly dynamic";
	}
	
	virtual void init(int n);
	virtual void ins(int i, int j);
	virtual void del(int i, int j);
	virtual unsigned int query();
	
	TD_EAGER() {
	}
	
	~TD_EAGER() {
		if(adjacency_matrix != NULL) delete[] adjacency_matrix;
	}
};

#endif //__EAGER_H<commit_msg>Changed count to unsigned int<commit_after>/* ---------------------------------------------------------------------------
** This software is implemented as part of the course Dynamic Algorithms 
** (Q4 2015) at Aarhus Univerity Denmark. 
**
** TD_EAGER.h
** Implementation of a truly dynamic algorithm for dynamic transitive closure
** based on Shankowsis randomized reduction of dynamic transitive closure to dynamic matrix adjoint.
**
** Author: <NAME> and <NAME>
** -------------------------------------------------------------------------*/

#ifndef _TD_EAGER_H
#define _TD_EAGER_H

#include "TC.h"
#include "utils.h"
#include <iostream>

class TD_EAGER : public TC {
private:
	uint32_t *adjacency_matrix; //this stores all the inserts/deletes that have happened
	uint32_t *inverse_matrix; //this stores the inverse that we want to maintain
	int n;
	uint32_t count;
	void updateInverseMatrix(int i, int j, uint32_t u);
	
public:
	const char* get_name() {
		return "Truly dynamic";
	}
	
	virtual void init(int n);
	virtual void ins(int i, int j);
	virtual void del(int i, int j);
	virtual unsigned int query();
	
	TD_EAGER() {
	}
	
	~TD_EAGER() {
		if(adjacency_matrix != NULL) delete[] adjacency_matrix;
	}
};

#endif //__EAGER_H
{'fraction_non_alphanumeric': 0.211687780956273, 'fraction_numerical': 0.009807928075194115, 'mean_word_length': 2.5426917510853837, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '162296', 'n_tokens_mistral': 787, 'n_tokens_neox': 729, 'n_words': 259}