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
8
namespace
oILAB
{
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
}
// namespace oILAB
23
24
#endif
oILAB
Definition
BiCrystal.cpp:13
oILAB::farey
std::vector< std::pair< int, int > > farey(int limit, const bool firstQuadrant)
Definition
Farey.cpp:5
oILAB::Fraction
Definition
Farey.h:10
oILAB::Fraction::Fraction
Fraction(int n_, int d_, int N_, int D_)
Definition
Farey.h:13
oILAB::Fraction::D
int D
Definition
Farey.h:11
oILAB::Fraction::n
int n
Definition
Farey.h:11
oILAB::Fraction::N
int N
Definition
Farey.h:11
oILAB::Fraction::d
int d
Definition
Farey.h:11
include
Math
Farey.h
Generated on Sat Mar 28 2026 00:15:04 for oILAB by
1.9.8