Skip to content

Commit d9e6762

Browse files
Revert "chore: use iwyu on math/**.cpp"
This reverts commit c47117c.
1 parent 5b65101 commit d9e6762

23 files changed

+88
-102
lines changed

math/area.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
* @author [Focusucof](https://github.com/Focusucof)
1010
*/
1111
#define _USE_MATH_DEFINES
12-
#include <cassert> // for assert
13-
#include <cmath> // for NAN, M_PI, pow
14-
#include <cstdint> // for uint16_t
15-
#include <iostream> // for basic_ostream, operator<<, char_traits, endl, cout
12+
#include <cassert> /// for assert
13+
#include <cmath> /// for M_PI definition and pow()
14+
#include <cmath>
15+
#include <cstdint> /// for uint16_t datatype
16+
#include <iostream> /// for IO operations
1617

1718
/**
1819
* @namespace math

math/check_prime.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
* @author [ewd00010](https://github.com/ewd00010)
1515
*/
1616

17-
#include <stdint.h> // for int64_t
18-
#include <cassert> // for assert
19-
#include <iostream> // for char_traits, basic_ostream, operator<<, cout, endl
17+
#include <cassert> /// for assert
18+
#include <iostream> /// for IO operations
2019

2120
/**
2221
* @brief Mathematical algorithms

math/complex_numbers.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
* operators overloaded to accommodate (mathematical) field operations.
88
*/
99

10-
#include <cassert> // for assert
11-
#include <cmath> // for atan2, cos, sin, sqrt
12-
#include <complex> // for complex, abs, arg, conj, operator*, operator+
13-
#include <ctime> // for time
14-
#include <iostream> // for basic_ostream, operator<<, char_traits, cout, endl
15-
#include <stdexcept> // for invalid_argument
16-
#include <cstdlib> // for rand, srand
10+
#include <cassert>
11+
#include <cmath>
12+
#include <complex>
13+
#include <ctime>
14+
#include <iostream>
15+
#include <stdexcept>
1716

1817
/**
1918
* \brief Class Complex to represent complex numbers as a field.

math/eratosthenes.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
* @author [Keval Kapdee](https://github.com/thechubbypanda)
1414
*/
1515

16-
#include <bits/chrono.h> // for duration, duration_cast, high_resolution_clock
17-
#include <stdint.h> // for uint64_t
18-
#include <cassert> // for assert
19-
#include <iostream> // for basic_ostream, operator<<, cout, endl
20-
#include <string> // for char_traits, basic_string, operator==, string
21-
#include <vector> // for vector
22-
#include <ratio> // for ratio
16+
#include <cassert> /// For assert
17+
#include <chrono> /// For timing the sieve
18+
#include <iostream> /// For IO operations
19+
#include <string> /// For string handling
20+
#include <vector> /// For std::vector
2321

2422
/**
2523
* @namespace math

math/extended_euclid_algorithm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
* multiplicative inverse of a number. (A * B)%M == 1 Here B is the MMI of A for
1010
* given M, so extendedEuclid (A, M) gives B.
1111
*/
12-
#include <iostream> // for char_traits, basic_ostream, basic_ostream::opera...
13-
#include <cstdint> // for uint32_t, int32_t
14-
#include <utility> // for swap
12+
#include <algorithm> // for swap function
13+
#include <iostream>
14+
#include <cstdint>
1515

1616
/**
1717
* function to update the coefficients per iteration

math/factorial.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
* @author [Akshay Gupta](https://github.com/Akshay1910)
1212
*/
1313

14-
#include <cassert> // for assert
15-
#include <cstdint> // for uint64_t, uint8_t
16-
#include <iostream> // for operator<<, basic_ostream, cout
17-
#include <stdexcept> // for invalid_argument
18-
14+
#include <cassert> /// for assert
15+
#include <cstdint> /// for integral typedefs
16+
#include <iostream> /// for I/O operations
1917
/**
2018
* @namespace
2119
* @brief Mathematical algorithms

math/fibonacci_fast.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
* @see fibonacci_large.cpp, fibonacci.cpp, string_fibonacci.cpp
1616
*/
1717

18-
#include <cinttypes> // for uint64_t
19-
#include <iostream> // for char_traits, basic_ostream, operator<<, cerr, cout
18+
#include <cinttypes>
19+
#include <cstdio>
20+
#include <iostream>
2021

2122
/**
2223
* maximum number that can be computed - The result after 93 cannot be stored

math/fibonacci_large.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
* @see fibonacci.cpp, fibonacci_fast.cpp, string_fibonacci.cpp
1212
*/
1313

14-
#include <stdlib.h> // for strtoull
15-
#include <cinttypes> // for uint64_t
16-
#include <ctime> // for clock, clock_t, CLOCKS_PER_SEC, NULL
17-
#include <iostream> // for basic_ostream, char_traits, operator<<
14+
#include <cinttypes>
15+
#include <ctime>
16+
#include <iostream>
1817

19-
#include "./large_number.h" // for large_number, operator<<, operator==
18+
#include "./large_number.h"
2019

2120
/** Compute fibonacci numbers using the relation
2221
* \f[f(n)=f(n-1)+f(n-2)\f]

math/gcd_recursive_euclidean.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*
77
* @see gcd_iterative_euclidean.cpp, gcd_of_n_numbers.cpp
88
*/
9-
#include <iostream> // for basic_ostream, char_traits, operator<<, basic_o...
10-
#include <stdexcept> // for domain_error
9+
#include <iostream>
1110

1211
/**
1312
* algorithm

math/integral_approximation2.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222
*/
2323

2424
#define _USE_MATH_DEFINES /// for M_PI on windows
25-
#include <cmath> // for exp, M_PI, sin, sqrt
26-
#include <cstdint> // for uint32_t
27-
#include <ctime> // for time
28-
#include <functional> // for function
29-
#include <iostream> // for basic_ostream, char_traits, operator<<, endl
30-
#include <random> // for normal_distribution, uniform_real_distribution
31-
#include <vector> // for vector
32-
#include <algorithm> // for min
25+
#include <cmath> /// for math functions
26+
#include <cstdint> /// for fixed size data types
27+
#include <ctime> /// for time to initialize rng
28+
#include <functional> /// for function pointers
29+
#include <iostream> /// for std::cout
30+
#include <random> /// for random number generation
31+
#include <vector> /// for std::vector
3332

3433
/**
3534
* @namespace math

0 commit comments

Comments
 (0)