<commit_before>/*
 * type.hpp
 *
 *  Created on: Feb 27, 2015
 *      Author: hugo
 */

#ifndef MFLASH_CPP_CORE_TYPE_HPP_
#define MFLASH_CPP_CORE_TYPE_HPP_

typedef long long int64;

namespace mflash {

template<class V>
class Element {
public:
	int64 id;
	V* value;

	void set_value(V value) {
		*(this->value) = value;
	}
};

class EmptyField {
};

enum ElementIdType {
	SIMPLE, DOUBLE,
};

enum Mode {
	UNSAFE, VECTOR_REPLICATION,
//ATOMIC
};

enum GraphFormatterMode {
	ADJACENCY_LIST, EDGE_LIST
};

enum FieldType {
	SOURCE, DESTINATION
};

enum BlockType {
	DENSE, SPARSE
};

enum MatrixProperty{
	VERTICES,
	PARTITIONS, // Beta
	VERTICES_PARTITION,
	EDGES_BLOCKS
};

struct MatrixProperties{
	int64 vertices;
	int64 idSize;
	int64 partitions;
	int64 vertices_partition;
	int64 *edges_by_block;

	MatrixProperties(int64 vertices, int64 idSize, int64 partitions, int64 vertices_partition, int64 edges_by_block[]){
		this->vertices = vertices;
		this->idSize = idSize;
		this->partitions = partitions;
		this->vertices_partition = vertices_partition;
		this->edges_by_block = edges_by_block;
	}
	MatrixProperties(){}
};

struct BlockProperties {
	BlockType type;
	int64 offset;
	int64 size;

	BlockProperties(BlockType type, int64 offset, int64 size) {
		this->type = type;
		this->offset = offset;
		this->size = size;
	}
};
}
#endif /* MFLASH_CPP_CORE_TYPE_HPP_ */<commit_msg>Adding method to get edges number within a block<commit_after>/*
 * type.hpp
 *
 *  Created on: Feb 27, 2015
 *      Author: hugo
 */

#ifndef MFLASH_CPP_CORE_TYPE_HPP_
#define MFLASH_CPP_CORE_TYPE_HPP_

typedef long long int64;

namespace mflash {

template<class V>
class Element {
public:
	int64 id;
	V* value;

	void set_value(V value) {
		*(this->value) = value;
	}
};

class EmptyField {
};

enum ElementIdType {
	SIMPLE, DOUBLE,
};

enum Mode {
	UNSAFE, VECTOR_REPLICATION,
//ATOMIC
};

enum GraphFormatterMode {
	ADJACENCY_LIST, EDGE_LIST
};

enum FieldType {
	SOURCE, DESTINATION
};

enum BlockType {
	DENSE, SPARSE
};

enum MatrixProperty{
	VERTICES,
	PARTITIONS, // Beta
	VERTICES_PARTITION,
	EDGES_BLOCKS
};

struct MatrixProperties{
	int64 vertices;
	int64 idSize;
	int64 partitions;
	int64 vertices_partition;
	int64 *edges_by_block;

	MatrixProperties(int64 vertices, int64 idSize, int64 partitions, int64 vertices_partition, int64 edges_by_block[]){
		this->vertices = vertices;
		this->idSize = idSize;
		this->partitions = partitions;
		this->vertices_partition = vertices_partition;
		this->edges_by_block = edges_by_block;
	}
	MatrixProperties(){}

	int64 getEdgesBlock(int row, int col){
		if(row >= 0 && row <partitions && col >= 0 && col <partitions){
			return edges_by_block[row * partitions + col];
		}
		assert(false);
		return 0;
	}
};

struct BlockProperties {
	BlockType type;
	int64 offset;
	int64 size;

	BlockProperties(BlockType type, int64 offset, int64 size) {
		this->type = type;
		this->offset = offset;
		this->size = size;
	}
};
}
#endif /* MFLASH_CPP_CORE_TYPE_HPP_ */
{'fraction_non_alphanumeric': 0.10828877005347594, 'fraction_numerical': 0.027072192513368985, 'mean_word_length': 4.461678832116788, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, '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': '3577791', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1095, 'n_words': 264}