Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <random>
- #include <iostream>
- #include <time.h>
- #include <limits>
- #include <cstddef>
- #include <iostream>
- #include "wektor.h"
- #include <limits>
- typedef std::numeric_limits< double > dbl;
- #define debug(x) std::cout << __LINE__ << ": " << #x << " == " << (x) << std::endl;
- using namespace std;
- bool toSamo(wektor3D w3d, double a, double b, double c)
- {
- if ((w3d.x == a) && (w3d.y == b) && (w3d.z == c))
- return true;
- return false;
- }
- int main(int argc, char* argv[])
- {
- //srand(time(NULL));
- //mnozenie
- double lower_bound = -1.0;
- double upper_bound = 1.0;// std::numeric_limits<double>::max();
- //std::uniform_real_distribution<double> unif(lower_bound, upper_bound);
- //std::default_random_engine re;
- std::random_device rd; //Will be used to obtain a seed for the random number engine
- std::mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd()
- std::uniform_real_distribution<> dis(lower_bound, upper_bound);
- int cnt = 0;
- while (1)
- {
- cnt++;
- wektor3D a(dis(gen), dis(gen), dis(gen));
- wektor3D b(dis(gen), dis(gen), dis(gen));
- //wektor3D a(1, 2, 3);
- //wektor3D b(2, 2, 2);
- if ((a * b != (a.x * b.x + a.y * b.y + a.z * b.z)))
- {
- cout << cnt << endl;
- debug(a);
- debug(b);
- break;
- }
- }
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement