Commit 5dd061d4 authored by Christoph Saffer's avatar Christoph Saffer

Added addressing for iterating

parent 958931d8
#include <vector> #include <vector>
#include <random>
#include <cmath> #include <cmath>
const double pi = std::acos(-1); const double pi = std::acos(-1);
...@@ -6,21 +7,48 @@ const double pi = std::acos(-1); ...@@ -6,21 +7,48 @@ const double pi = std::acos(-1);
double f(double alpha, double x, double y) { double f(double alpha, double x, double y) {
return x + alpha*sin(2*pi*y); return x + alpha*sin(2*pi*y);
} }
double g(double beta, double x, double y) { double g(double beta, double x, double y) {
return y + beta*sin(2*pi*x); return y + beta*sin(2*pi*x);
} }
bool cond(double x, double y, double seedx, double seedy) {
return true;
}
int main(int argc, char** argv) { int main(int argc, char** argv) {
int n = 1000; // number of iterations int n = 1000; // number of iterations
int m = 10; // number of starting points int m = 10; // number of seed points
int alphamax = 1; int alphamax = 1;
int betamax = 1; int betamax = 1;
int steps = 1000; int steps = 1000;
double stepsize = alphamax/steps; double stepsize = alphamax/steps;
std::vector<double> x(n*m*steps); std::vector<double> x(m*steps*steps);
std::vector<double> y(n*m*steps); std::vector<double> y(m*steps*steps);
// Generating vector of random numbers
std::mt19937 gen(std::random_device{}());
std::uniform_real_distribution<> dis(0, 1);
std::vector<double> randv = {};
for(int i=0; i < m; ++i) {
double randn = dis(gen);
randv.push_back(randn);
}
// Iterating over all pixel in the grid
// Adressing: (i * stepsize) + j + randv(k)
for (int i=0; i < steps; ++i) {
for (int j=0; j < steps; ++j) {
for (int k=0; k < m; ++k) {
}
}
}
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment