oILAB
Loading...
Searching...
No Matches
Farey.h
Go to the documentation of this file.
1#ifndef gbLAB_Farey_h_
2#define gbLAB_Farey_h_
3
4#include <iostream>
5#include <numeric>
6#include <vector>
7
8namespace gbLAB {
9 // Define a struct to store the current and previous mediant fractions
10 struct Fraction {
11 int n, d, N, D;
12
13 Fraction(int n_, int d_, int N_, int D_) {
14 n = n_;
15 d = d_;
16 N = N_;
17 D = D_;
18 }
19 };
20 std::vector<std::pair<int, int>> farey(int limit, const bool firstQuadrant=true);
21
22}
23
24#endif
std::vector< std::pair< int, int > > farey(int limit, const bool firstQuadrant)
Definition Farey.cpp:6
Fraction(int n_, int d_, int N_, int D_)
Definition Farey.h:13