-
Notifications
You must be signed in to change notification settings - Fork 0
/
SupportXCol.h
60 lines (47 loc) · 1.54 KB
/
SupportXCol.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
/*
* File: SupportXCol.h
* Author: ivek
*
* Created on January 20, 2012, 10:52 AM
*/
#ifndef SUPPORTXCOL_H
#define SUPPORTXCOL_H
#include "UpdateFunctionDelegator.h"
#include <vector>
/* Wrapper related */
#include "VertexProxy.h"
class SupportXCol : public UpdateFunctionDelegator {
public:
/* One col of sparse matrix, Compressed Col Storage encoded
*/
unsigned int* support;
unsigned int numElements; // number of nonzero elements in this col
const unsigned int getNumElements() const { return numElements; }
// std::vector<unsigned int> support;
// const unsigned int getNumElements() const { return this->support.size(); }
SupportXCol(unsigned int numElements);
SupportXCol(const SupportXCol& orig);
~SupportXCol();
UpdateFunctionDelegator* clone();
void accept(VertexVisitor &v, gl::iscope& scope, gl::icallback& schedule);
void updateFunction(gl::iscope& scope, gl::icallback& scheduler);
unsigned int binarySearch(const unsigned int& rowIndex) const;
private:
SupportXCol() {}
};
class SupportXColWrapper : public VertexProxy {
public:
SupportXColWrapper(unsigned int numElements) {
essence = new SupportXCol(numElements);
}
SupportXColWrapper(const SupportXColWrapper& orig) {
// essence = new SupportXCol();
essence = orig.essence->clone();
}
~SupportXColWrapper() {
delete(essence);
}
private:
SupportXColWrapper() {}
};
#endif /* SUPPORTXCOL_H */