You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.0 KiB
58 lines
1.0 KiB
//
|
|
// aatester.cpp
|
|
// AwesomeAttract0r
|
|
//
|
|
// Created by Joshua Moerman on 3/25/12.
|
|
// Copyright (c) 2012 Vadovas. All rights reserved.
|
|
//
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
#include "Logger.hpp"
|
|
#include "analyse.hpp"
|
|
|
|
#define LOG(s, p) \
|
|
logger.start(s); \
|
|
p \
|
|
logger.stop()
|
|
|
|
int verbose = 0;
|
|
Logger logger(std::cout, LOG_VERBOSE);
|
|
|
|
inline double test(const unsigned int dimension){
|
|
LOG("making vector",
|
|
std::vector<double *> buffer(10000000);
|
|
);
|
|
|
|
LOG("making random data",
|
|
for(auto & p : buffer){
|
|
p = new double[dimension];
|
|
for(unsigned int i = 0;i < dimension; ++i){
|
|
p[i] = rand() / (double) RAND_MAX - 0.5;
|
|
}
|
|
});
|
|
|
|
LOG("calculate fractal dimension",
|
|
double f = fractal_dimension(buffer.begin(), buffer.end(), dimension);
|
|
);
|
|
|
|
LOG("freeing data",
|
|
for(auto & p : buffer){
|
|
delete[] p;
|
|
p = 0;
|
|
});
|
|
|
|
return f;
|
|
}
|
|
|
|
int main(){
|
|
srand(time(0));
|
|
for (unsigned int i = 1; i <= 6; ++i) {
|
|
std::cout << i << " =>";
|
|
for(unsigned int j = 0; j < 10; ++j) {
|
|
std::cout << "\t" << test(i);
|
|
}
|
|
std::cout << std::endl;
|
|
}
|
|
}
|
|
|