Skip to content

Instantly share code, notes, and snippets.

#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
#include <vector>
using namespace std;
vector<double> x, y;
int get_file(string filename) {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
using namespace std;
struct rechteck {
double x, y;
};
rechteck rotation(rechteck r) {
rechteck rot = {r.y, r.x};
return rot;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <random>
using namespace std;
double random_number() {
return double (rand()) / RAND_MAX;
}
int partition(double A[], int s, int t) {
double pivot = A[s];
#include <iostream>
#include <cmath>
#include <random>
using namespace std;
class normal_generator {
bool status;
double cache;
public:
normal_generator() {
#include <iostream>
#include <cmath>
using namespace std;
bool signchange (double a, double b) {
return (a > 0 && b < 0) || (a < 0 && b > 0);
}
string bisection(double a, double b, double epsilon_x, double epsilon_y, double (*f)(double), int n) {
double average = (a + b) / 2.0;