-
Notifications
You must be signed in to change notification settings - Fork 3
/
Ram.h
36 lines (32 loc) · 742 Bytes
/
Ram.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Ram.h
//
//
// Created by Maurizio Giordano on 25/05/18.
//
#ifndef Ram_h
#define Ram_h
#include <string>
#include <sstream>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
typedef std::pair<unsigned long, double> Wentry;
namespace wnn {
class Ram {
protected:
int n_locs;
public:
std::vector<Wentry> wentries;
int idx;
Ram(int Idx, int NLocs);
~Ram();
double getEntry(unsigned long long key);
void setEntry(unsigned long long key, double value);
void incrEntry(unsigned long long key, double value);
void decrEntry(unsigned long long key, double value);
std::string toString();
};
}
#endif /* Ram_h */