-
Notifications
You must be signed in to change notification settings - Fork 0
/
DiscreteCol.h
63 lines (48 loc) · 1.57 KB
/
DiscreteCol.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* File: DiscreteCol.h
* Author: ivek
*
* Created on January 31, 2012, 5:50 PM
*/
#ifndef DISCRETECOL_H
#define DISCRETECOL_H
#include "UpdateFunctionDelegator.h"
/* Wrapper related*/
#include "VertexProxy.h"
#include <iostream>
#include <string>
#include <vector>
class DiscreteCol : public UpdateFunctionDelegator
{
public:
DiscreteCol(unsigned int mixtureSize);
DiscreteCol(const DiscreteCol& orig);
~DiscreteCol();
UpdateFunctionDelegator* clone();
element_type* values; // organised per element of mixtures, accross rows
unsigned int mixtureSize;
const unsigned int getMixtureSize() const { return mixtureSize; }
// std::vector<element_type> values; /* Order: ascending indices */
// const unsigned int getMixtureSize() const { return values.size()/VertexProxy::K->get_val(); }
/* UpdateFUnctionDelegator */
void accept(VertexVisitor& v, gl::iscope& scope, gl::icallback& schedule);
void updateFunction(gl::iscope& scope, gl::icallback& scheduler);
/* UpdateFUnctionDelegator ends */
private:
DiscreteCol() {}
};
class DiscreteColWrapper : public VertexProxy {
public:
DiscreteColWrapper(unsigned int mixtureSize){
this->essence = new DiscreteCol(mixtureSize);
}
DiscreteColWrapper(const DiscreteColWrapper& orig) {
this->essence = orig.essence->clone();
};
~DiscreteColWrapper() {
delete(this->essence);
}
private:
DiscreteColWrapper() {}
};
#endif /* DISCRETECOL_H */