Skip to content

Commit ef74ade

Browse files
committed
add stats
1 parent 6e4c82a commit ef74ade

16 files changed

+12192
-33
lines changed

include/Conv2D.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ class Conv2D {
99
Conv2D(std::vector<std::vector<double>> kernel, int inputWidth, int inputHeight);
1010

1111
virtual std::vector<std::vector<double>> apply(std::vector<std::vector<double>> input);
12-
private:
12+
protected:
1313
std::vector<std::vector<double>> kernel;
1414
};

include/Grid.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,14 @@ class Grid {
2424
unsigned int width, height;
2525
std::vector<std::vector<double>> data;
2626

27+
int generation = 0;
28+
2729
public:
2830
Grid(unsigned int width, unsigned int height);
2931
virtual ~Grid();
3032
void draw();
3133
virtual void update() = 0;
34+
virtual void updateStats(bool shouldCalc) = 0;
3235
virtual void drawImGui() = 0;
3336
void setWidth(unsigned int width);
3437
void setHeight(unsigned int height);

include/Math.hpp

+13-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ const double EPSILON = 0.0000001;
88

99
const int PRECISION = 1000000;
1010

11+
struct TwoPointsData {
12+
double distance;
13+
double angle;
14+
double angleDiff;
15+
};
16+
1117
double bell(double x, double m, double s);
1218
double polynomial(double x, double m, double s, double a);
1319
int wrap(int x, int n);
@@ -26,4 +32,10 @@ double Round(double x);
2632

2733
int RandomInt(int min, int max);
2834

29-
std::vector<std::vector<double>> convolve2D(const std::vector<std::vector<double>>& grid, const std::vector<std::vector<double>>& kernel);
35+
std::vector<std::vector<double>> convolve2D(const std::vector<std::vector<double>>& grid, const std::vector<std::vector<double>>& kernel);
36+
37+
bool IsZero(double x);
38+
bool IsPos(double x);
39+
bool IsNeg(double x);
40+
41+
TwoPointsData TwoPoints(double x1, double y1, double x2, double y2, double olda);

include/defines.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#pragma once
2-
// #define OPENMP
2+
#define OPENMP

include/imgui/implot.h

+1,297
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)