-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathLinearSystem.h
More file actions
48 lines (42 loc) · 1.02 KB
/
Copy pathLinearSystem.h
File metadata and controls
48 lines (42 loc) · 1.02 KB
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
#ifndef LINEAR_SYSTEM_H
#define LINEAR_SYSTEM_H
#include <vector>
#include <cuda_runtime_api.h>
#include "EigenUtil.h"
const int NUMBLOCKS = 300;
const int SYSTEM_SIZE = 27;
const int OUTPUT_SIZE = SYSTEM_SIZE * NUMBLOCKS;
class System;
class LinearSystem
{
public:
LinearSystem();
~LinearSystem();
void build(const float4* input, const float4* correspondence, const float4* correspondenceNormal, float mean,
float meanStdev, int width, int height, Matrix6x6f& ATA, Vector6f& ATb);
private:
float* d_generatedMatrixSystem;
float* h_accumulated_matrix;
std::vector<System> accumulated_matrix;
};
class System {
public:
float coefficients[SYSTEM_SIZE];
void reset() {
for(int i=0;i<SYSTEM_SIZE;++i) {
coefficients[i] = 0.0f;
}
}
void print() {
for(int i=0;i<SYSTEM_SIZE;++i) {
std::cout<<coefficients[i]<<" ";
}
std::cout<<"\n";
}
void add(const System& sys) {
for(int i=0;i<SYSTEM_SIZE;++i) {
coefficients[i] += sys.coefficients[i];
}
}
};
#endif //LINEAR_SYSTEM_H