Skip to content

Commit 3b86feb

Browse files
Revert "chore: use iwyu on machine_learning/**.cpp"
This reverts commit c3897d3.
1 parent d9e6762 commit 3b86feb

File tree

5 files changed

+43
-55
lines changed

5 files changed

+43
-55
lines changed

machine_learning/a_star_search.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,15 @@
1919
* values having minimum F(state).
2020
* @author [Ashish Daulatabad](https://github.com/AshishYUO)
2121
*/
22-
#include <stdint.h> // for uint32_t, int8_t
23-
24-
#include <algorithm> // for max, min
25-
#include <array> // for array, operator==
26-
#include <cassert> // for assert
27-
#include <cstddef> // for size_t
28-
#include <functional> // for function
29-
#include <iostream> // for operator<<, basic_ostream, char_traits, cout
30-
#include <map> // for operator!=, map, operator==
31-
#include <memory> // for shared_ptr, make_shared, operator!=
32-
#include <set> // for set
33-
#include <tuple> // for tie, tuple
34-
#include <utility> // for pair, move, make_pair, swap
35-
#include <vector> // for vector
36-
22+
#include <algorithm> /// for `std::reverse` function
23+
#include <array> /// for `std::array`, representing `EightPuzzle` board
24+
#include <cassert> /// for `assert`
25+
#include <functional> /// for `std::function` STL
26+
#include <iostream> /// for IO operations
27+
#include <map> /// for `std::map` STL
28+
#include <memory> /// for `std::shared_ptr`
29+
#include <set> /// for `std::set` STL
30+
#include <vector> /// for `std::vector` STL
3731
/**
3832
* @namespace machine_learning
3933
* @brief Machine learning algorithms

machine_learning/adaline_learning.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@
2626
* computed using stochastic gradient descent method.
2727
*/
2828

29-
#include <bits/std_abs.h> // for abs
30-
#include <array> // for array
31-
#include <cassert> // for assert
32-
#include <cstdlib> // for rand, exit, srand, strtof, EXIT_FAILURE
33-
#include <ctime> // for time
34-
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
35-
#include <numeric> // for inner_product
36-
#include <vector> // for vector
29+
#include <array>
30+
#include <cassert>
31+
#include <climits>
32+
#include <cmath>
33+
#include <cstdlib>
34+
#include <ctime>
35+
#include <iostream>
36+
#include <numeric>
37+
#include <vector>
3738

3839
/** Maximum number of iterations to learn */
3940
constexpr int MAX_ITER = 500; // INT_MAX

machine_learning/k_nearest_neighbors.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@
99
* the K-nearest neighbors.
1010
*/
1111

12-
#include <algorithm> // for sort, transform
13-
#include <cassert> // for assert
14-
#include <cmath> // for sqrt, pow
15-
#include <cstddef> // for size_t
16-
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
17-
#include <iterator> // for back_inserter
18-
#include <numeric> // for accumulate
19-
#include <unordered_map> // for unordered_map, _Node_iterator
20-
#include <utility> // for pair
21-
#include <vector> // for vector
12+
#include <algorithm> /// for std::transform and std::sort
13+
#include <cassert> /// for assert
14+
#include <cmath> /// for std::pow and std::sqrt
15+
#include <iostream> /// for std::cout
16+
#include <numeric> /// for std::accumulate
17+
#include <unordered_map> /// for std::unordered_map
18+
#include <vector> /// for std::vector
2219

2320
/**
2421
* @namespace machine_learning
@@ -68,7 +65,7 @@ class Knn {
6865
* @param Y labels vector
6966
*/
7067
explicit Knn(std::vector<std::vector<double>>& X, std::vector<int>& Y)
71-
: X_(X), Y_(Y) {};
68+
: X_(X), Y_(Y){};
7269

7370
/**
7471
* Copy Constructor for class Knn.

machine_learning/neural_network.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,18 @@
2727
* MSE as loss function. Bias is also not included.
2828
*/
2929

30-
#include <bits/chrono.h> // for duration, duration_cast, high_resolution_c...
31-
#include <algorithm> // for max, min
32-
#include <cassert> // for assert
33-
#include <cmath> // for exp
34-
#include <fstream> // for basic_ostream, operator<<, endl, basic_ist...
35-
#include <iostream> // for cerr, cout
36-
#include <sstream> // for basic_stringstream
37-
#include <string> // for char_traits, basic_string, operator<<, ope...
38-
#include <valarray> // for valarray
39-
#include <vector> // for vector
40-
#include <cstdlib> // for exit, size_t, EXIT_FAILURE
41-
#include <utility> // for pair, make_pair
42-
43-
#include "vector_ops.hpp" // for argmax, apply_function, get_shape, multiply
30+
#include <algorithm>
31+
#include <cassert>
32+
#include <chrono>
33+
#include <cmath>
34+
#include <fstream>
35+
#include <iostream>
36+
#include <sstream>
37+
#include <string>
38+
#include <valarray>
39+
#include <vector>
40+
41+
#include "vector_ops.hpp" // Custom header file for vector operations
4442

4543
/** \namespace machine_learning
4644
* \brief Machine learning algorithms

machine_learning/ordinary_least_squares_regressor.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
*
1010
* \author [Krishna Vedala](https://github.com/kvedala)
1111
*/
12-
#include <bits/std_abs.h> // for abs
13-
14-
#include <cassert> // for assert
15-
#include <cstddef> // for size_t
16-
#include <iomanip> // for operator<<, setfill, setw, _Setfill, _Setw
17-
#include <iostream> // for basic_ostream, operator<<, char_traits, cout
18-
#include <vector> // for vector
12+
#include <cassert>
13+
#include <cmath> // for std::abs
14+
#include <iomanip> // for print formatting
15+
#include <iostream>
16+
#include <vector>
1917

2018
/**
2119
* operator to print a matrix

0 commit comments

Comments
 (0)