Commit 58b4711b authored by Jason Rhinelander's avatar Jason Rhinelander

Applied include-what-you-use updates

This also adds eris.imp to handle implicit imports and various compiler
fixups for libstdc++, boost, and Eigen, and to avoid needing to include
<eris/types.hpp> everywhere, for example.
parent 4ba818fd
[
{ symbol: ["eris::eris_id_t", "private", "<eris/types.hpp>", "public"] },
{ symbol: ["eris::eris_id_t", "private", "<eris/Simulation.hpp>", "public"] },
{ symbol: ["eris::eris_id_t", "private", "<eris/Bundle.hpp>", "public"] },
{ symbol: ["eris::eris_id_t", "private", "<eris/SharedMember.hpp>", "public"] },
{ include: ["<eris/SharedMember.hpp>", "public", "<eris/Simulation.hpp>", "public"] },
{ include: ["\"eris/SharedMember.hpp\"", "public", "<eris/Simulation.hpp>", "public"] },
{ include: ["<eris/Simulation.hpp>", "public", "<eris/Member.hpp>", "public"] },
{ include: ["\"eris/Simulation.hpp\"", "public", "<eris/Member.hpp>", "public"] },
{ include: ["<eris/Member.hpp>", "public", "<eris/Agent.hpp>", "public"] },
{ include: ["<eris/Member.hpp>", "public", "<eris/Good.hpp>", "public"] },
{ include: ["<eris/Member.hpp>", "public", "<eris/Market.hpp>", "public"] },
{ include: ["\"eris/Member.hpp\"", "public", "<eris/Agent.hpp>", "public"] },
{ include: ["\"eris/Member.hpp\"", "public", "<eris/Good.hpp>", "public"] },
{ include: ["\"eris/Member.hpp\"", "public", "<eris/Market.hpp>", "public"] },
# Direct agent subclasses:
{ include: ["<eris/Agent.hpp>", "public", "<eris/agent/AssetAgent.hpp>", "public"] },
{ include: ["\"eris/Agent.hpp\"", "public", "<eris/agent/AssetAgent.hpp>", "public"] },
# Asset agent subclasses:
{ include: ["<eris/agent/AssetAgent.hpp>", "public", "<eris/Firm.hpp>", "public"] },
{ include: ["\"eris/agent/AssetAgent.hpp\"", "public", "<eris/Firm.hpp>", "public"] },
{ include: ["<eris/agent/AssetAgent.hpp>", "public", "<eris/Consumer.hpp>", "public"] },
{ include: ["\"eris/agent/AssetAgent.hpp\"", "public", "<eris/Consumer.hpp>", "public"] },
# Bundle is implicitly brought in by various means:
{ include: ["<eris/Bundle.hpp>", "public", "<eris/Firm.hpp>", "public"] },
{ include: ["\"eris/Bundle.hpp\"", "public", "<eris/Firm.hpp>", "public"] },
{ include: ["<eris/Bundle.hpp>", "public", "<eris/agent/AssetAgent.hpp>", "public"] },
{ include: ["\"eris/Bundle.hpp\"", "public", "<eris/agent/AssetAgent.hpp>", "public"] },
# Market implicitly includes Firm
{ include: ["<eris/Firm.hpp>", "public", "<eris/Market.hpp>", "public"] },
{ include: ["\"eris/Firm.hpp\"", "public", "<eris/Market.hpp>", "public"] },
# Market subclasses:
{ include: ["<eris/Market.hpp>", "public", "<eris/market/QMarket.hpp>", "public"] },
{ include: ["\"eris/Market.hpp\"", "public", "<eris/market/QMarket.hpp>", "public"] },
{ include: ["<eris/Market.hpp>", "public", "<eris/market/Bertrand.hpp>", "public"] },
{ include: ["\"eris/Market.hpp\"", "public", "<eris/market/Bertrand.hpp>", "public"] },
# Firm subclasses:
{ include: ["<eris/Firm.hpp>", "public", "<eris/firm/PriceFirm.hpp>", "public"] },
{ include: ["\"eris/Firm.hpp\"", "public", "<eris/firm/PriceFirm.hpp>", "public"] },
{ include: ["<eris/Firm.hpp>", "public", "<eris/firm/QFirm.hpp>", "public"] },
{ include: ["\"eris/Firm.hpp\"", "public", "<eris/firm/QFirm.hpp>", "public"] },
# Consumer subclasses:
{ include: ["<eris/Consumer.hpp>", "public", "<eris/consumer/CobbDouglas.hpp>", "public"] },
{ include: ["\"eris/Consumer.hpp\"", "public", "<eris/consumer/CobbDouglas.hpp>", "public"] },
{ include: ["<eris/Consumer.hpp>", "public", "<eris/consumer/Compound.hpp>", "public"] },
{ include: ["\"eris/Consumer.hpp\"", "public", "<eris/consumer/Compound.hpp>", "public"] },
{ include: ["<eris/Consumer.hpp>", "public", "<eris/consumer/Polynomial.hpp>", "public"] },
{ include: ["\"eris/Consumer.hpp\"", "public", "<eris/consumer/Polynomial.hpp>", "public"] },
{ include: ["<eris/Consumer.hpp>", "public", "<eris/consumer/Quadratic.hpp>", "public"] },
{ include: ["\"eris/Consumer.hpp\"", "public", "<eris/consumer/Quadratic.hpp>", "public"] },
# Positional includes Position
{ include: ["<eris/Position.hpp>", "public", "<eris/Positional.hpp>", "public"] },
{ include: ["<random>", "public", "<eris/Random.hpp>", "public"] },
{ include: ["<memory>", "public", "<eris/SharedMember.hpp>", "public"] },
# iwyu gets confused by some system headers; hack around them:
{ include: ["<ext/alloc_traits.h>", "private", "<vector>", "public"] },
{ include: ["<cxxabi.h>", "public", "<system_error>", "public"] },
{ include: ["<ext/new_allocator.h>", "private", "<memory>", "public"] },
{ symbol: ["hash", "private", "<functional>", "public"] },
# Hacks for boost:
{ include: ["<boost/core/explicit_operator_bool.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/format/alt_sstream.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/format/alt_sstream_impl.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/format/format_implementation.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/math/distributions/detail/derived_accessors.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/math/policies/policy.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/math/special_functions/fpclassify.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
{ include: ["<boost/optional/optional.hpp>", "private", "<boost/math/distributions/normal.hpp>", "public"] },
# Eigen:
{ include: ["@\"Eigen/src/Core/.*\"", "private", "<Eigen/Core>", "public"] },
{ include: ["@\"Eigen/src/Cholesky/.*\"", "private", "<Eigen/Cholesky>", "public"] },
{ include: ["@\"Eigen/src/QR/.*\"", "private", "<Eigen/QR>", "public"] },
{ include: ["@\"Eigen/src/SVD/.*\"", "private", "<Eigen/SVD>", "public"] },
{ include: ["@\"Eigen/src/Householder/.*\"", "private", "<Eigen/Householder>", "public"] },
{ include: ["\"Eigen/Householder\"", "public", "<Eigen/QR>", "public"] },
]
#pragma once
#include <eris/Bundle.hpp>
#include <eris/Member.hpp>
#include <utility>
namespace eris {
......
#pragma once
#include <eris/types.hpp>
#include <algorithm>
#include <exception>
#include <stdexcept>
#include <limits>
#include <ostream>
#include <unordered_map>
#include <forward_list>
#include <initializer_list>
#include <string>
#include <utility>
namespace eris {
......
#pragma once
#include <eris/types.hpp>
#include <eris/agent/AssetAgent.hpp>
#include <eris/Bundle.hpp>
#include <map>
#include <vector>
#include <functional>
namespace eris {
......
#pragma once
#include <eris/agent/AssetAgent.hpp>
#include <eris/Bundle.hpp>
#include <algorithm>
#include <exception>
#include <initializer_list>
#include <stdexcept>
#include <string>
namespace eris {
......
#pragma once
#include <eris/Member.hpp>
#include <eris/agent/AssetAgent.hpp>
#include <eris/Firm.hpp>
#include <eris/Good.hpp>
#include <eris/Bundle.hpp>
#include <exception>
#include <limits>
#include <unordered_set>
#include <memory>
#include <forward_list>
namespace eris {
......@@ -13,8 +11,6 @@ namespace eris {
/// Namespace for eris market implementations inheriting from eris::Market.
namespace market {}
using agent::AssetAgent;
/** Abstract base class for markets in Eris.
*
* At this basic level, a market has an output bundle and a price unit bundle (typically a bundle of
......@@ -125,7 +121,7 @@ class Market : public Member {
/// The market to which this Reservation applies.
const SharedMember<Market> market;
/// The agent for which this Reservation is being held.
const SharedMember<AssetAgent> agent;
const SharedMember<agent::AssetAgent> agent;
/** Reserves the given BundleNegative transfer from the given firm and stores the
* result, to be transferred if buy() is called, and aborted if release() is called.
* Positive amounts are to be transferred from the firm, negative amounts are to be
......@@ -229,7 +225,7 @@ class Market : public Member {
* when assets are less than p_max*price: the actual transaction price could be low enough
* that assets is sufficient.
*/
virtual Reservation reserve(SharedMember<AssetAgent> agent, double q, double p_max = std::numeric_limits<double>::infinity()) = 0;
virtual Reservation reserve(SharedMember<agent::AssetAgent> agent, double q, double p_max = std::numeric_limits<double>::infinity()) = 0;
/** Completes a reservation made with reserve(). Transfers the reserved assets into the
* assets() Bundle of the AssetAgent supplied when creating the reservation, and transfers
......@@ -310,7 +306,7 @@ class Market : public Member {
* (i.e. p*price_unit) will be transferred out of the AssetAgent's assets() Bundle and held
* in the Reservation until completed or cancelled.
*/
Reservation createReservation(SharedMember<AssetAgent> agent, double q, double p);
Reservation createReservation(SharedMember<agent::AssetAgent> agent, double q, double p);
/** Overridden to automatically remove a firm from the market when the firm is removed from
* the simulation.
......
......@@ -3,13 +3,13 @@
#include <eris/types.hpp>
#include <eris/noncopyable.hpp>
#include <stdexcept>
#include <thread>
#include <memory>
#include <mutex>
#include <atomic>
#include <set>
#include <condition_variable>
#include <type_traits>
#include <algorithm>
#include <string>
namespace eris {
......
#pragma once
#include <cstddef>
#include <algorithm>
#include <initializer_list>
#include <string>
#include <type_traits>
#include <stdexcept>
#include <vector>
#include <ostream>
......
#pragma once
#include <eris/Position.hpp>
#include <eris/noncopyable.hpp>
#include <stdexcept>
#include <algorithm>
#include <type_traits>
namespace eris {
......@@ -11,8 +12,6 @@ class PositionalBoundaryError : public std::range_error {
PositionalBoundaryError() : std::range_error("Cannot move outside bounding box") {}
};
class WrappedPositionalBase;
/** Handles positioning. Should not be used directly but rather by inheriting from Positional<T>.
*/
class PositionalBase {
......
#pragma once
#include <random>
#include <thread>
#include <mutex>
#include <cmath>
#include <limits>
#include <stdexcept>
#include <type_traits>
#include <eris/noncopyable.hpp>
namespace eris {
......
#pragma once
#include <eris/types.hpp>
#include <cstddef>
#include <memory>
#include <stdexcept>
#include <typeinfo>
#include <functional>
#include <utility>
#include <type_traits>
namespace eris {
......
#pragma once
#include <eris/types.hpp>
#include <eris/SharedMember.hpp>
#include <eris/debug.hpp>
#include <eris/noncopyable.hpp>
#include <cstddef>
#include <algorithm>
#include <stdexcept>
#include <type_traits>
#include <functional>
#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <vector>
#include <memory>
#include <typeinfo>
#include <typeindex>
#include <vector>
#include <thread>
#include <atomic>
#include <condition_variable>
......
#pragma once
#include <eris/Position.hpp>
#include <eris/Positional.hpp>
#include <set>
#include <cstddef>
#include <algorithm>
#include <initializer_list>
#include <stdexcept>
#include <type_traits>
#include <vector>
namespace eris {
......
#pragma once
#include <eris/Agent.hpp>
#include <eris/Bundle.hpp>
#include <eris/Optimize.hpp>
namespace eris { namespace agent {
......
......@@ -5,6 +5,7 @@
#include <type_traits>
#include <vector>
#include <limits>
#include <utility>
namespace eris {
......
......@@ -3,6 +3,8 @@
#include <memory>
#include <ostream>
#include <vector>
#include <stdexcept>
#include <string>
/** This macro is provided to easily provide versions of update() and weaken() that return a proper
* Derived type (instead of the base class BayesianLinear type), so that expressions such as
......
#pragma once
#include <unordered_map>
#include <limits>
#include <Eigen/Core>
#include <Eigen/Cholesky>
#include <eris/noncopyable.hpp>
#include <eris/Random.hpp>
#include <eris/belief/BayesianLinear.hpp>
#include <Eigen/Core>
#include <algorithm>
#include <cstddef>
#include <memory>
#include <limits>
#include <string>
#include <utility>
namespace eris { namespace belief {
......
#pragma once
#include <unordered_map>
#include <eris/Consumer.hpp>
#include <eris/Bundle.hpp>
#include <eris/types.hpp>
#include <unordered_map>
namespace eris { namespace consumer {
......
#pragma once
#include <eris/Bundle.hpp>
#include <eris/Consumer.hpp>
#include <eris/types.hpp>
#include <memory>
namespace eris { namespace consumer {
......
#pragma once
#include <eris/Consumer.hpp>
#include <eris/Bundle.hpp>
#include <eris/types.hpp>
#include <map>
#include <vector>
......
#pragma once
#include <map>
#include <eris/Consumer.hpp>
#include <eris/Bundle.hpp>
#include <eris/types.hpp>
namespace eris { namespace consumer {
......
#pragma once
#include <cstdio>
#include <iostream>
#include <ctime>
#include <sstream>
#include <string>
#ifdef ERIS_DEBUG
#define ERIS_DEBUG_BOOL true
......
#pragma once
#include <eris/Optimize.hpp>
#include <eris/Firm.hpp>
#include <limits>
......
#pragma once
#include <eris/Optimize.hpp>
#include <eris/Firm.hpp>
#include <eris/Bundle.hpp>
namespace eris { namespace firm {
......
......@@ -8,6 +8,7 @@
*/
#include <eris/Optimize.hpp>
#include <eris/Member.hpp>
#include <functional>
namespace eris { namespace interopt {
......
#pragma once
#include <eris/firm/PriceFirm.hpp>
#include <eris/interopt/InterStepper.hpp>
#include <eris/interopt/ProfitStepper.hpp>
namespace eris { namespace firm { class PriceFirm; } }
namespace eris { namespace interopt {
using eris::firm::PriceFirm;
......
#pragma once
#include <eris/Firm.hpp>
#include <eris/firm/PriceFirm.hpp>
#include <eris/Bundle.hpp>
#include <eris/interopt/InterStepper.hpp>
namespace eris { class Firm; namespace firm { class PriceFirm; } }
namespace eris { namespace interopt {
/** Abstract eris::interopt::Stepper subclass for a firm that decides which direction to step based
......
#pragma once
#include <eris/firm/QFirm.hpp>
#include <eris/Bundle.hpp>
#include <eris/interopt/ProfitStepper.hpp>
namespace eris { namespace firm { class QFirm; } }
namespace eris { namespace interopt {
using eris::firm::QFirm;
......
......@@ -8,6 +8,7 @@
*/
#include <eris/Optimize.hpp>
#include <eris/Member.hpp>
#include <functional>
namespace eris { namespace intraopt {
......
#pragma once
#include <eris/agent/AssetAgent.hpp>
#include <eris/Member.hpp>
#include <eris/Bundle.hpp>
#include <eris/Optimize.hpp>
namespace eris { namespace agent { class AssetAgent; } }
namespace eris { namespace intraopt {
/** Simple period initializer that adds a fixed bundle (i.e. income) to its agent's assets at the
......
#pragma once
#include <eris/Consumer.hpp>
#include <eris/Member.hpp>
#include <eris/Market.hpp>
#include <eris/Optimize.hpp>
#include <forward_list>
namespace eris { class Consumer; }
namespace eris { namespace intraopt {
/** Simple buyer that has a single 'money' good and uses it to buy from the Simulation's Markets
......
#pragma once
#include <eris/Consumer.hpp>
#include <eris/Optimize.hpp>
#include <eris/Market.hpp>
#include <stdexcept>
#include <unordered_map>
#include <unordered_set>
#include <forward_list>
......
#pragma once
#include <eris/Market.hpp>
#include <eris/firm/PriceFirm.hpp>
#include <vector>
#include <random>
#include <limits>
#include <unordered_map>
namespace eris { namespace market {
......@@ -35,7 +34,7 @@ class Bertrand : public Market {
virtual quantity_info quantity(double p) const override;
/// Reserves q units, paying at most p_max for them.
virtual Reservation reserve(
SharedMember<AssetAgent> agent,
SharedMember<agent::AssetAgent> agent,
double q,
double p_max = std::numeric_limits<double>::infinity()) override;
/// Adds a firm to this market. The Firm must be a PriceFirm object (or subclass)
......
#pragma once
#include <eris/types.hpp>
#include <eris/Optimize.hpp>
#include <eris/Market.hpp>
#include <eris/firm/QFirm.hpp>
#include <eris/algorithms.hpp>
#include <limits>
......@@ -97,7 +96,7 @@ class QMarket : public Market,
double firmQuantities(double max = std::numeric_limits<double>::infinity()) const;
/// Reserves q units, paying at most p_max for them.
virtual Reservation reserve(SharedMember<AssetAgent> agent, double q, double p_max = std::numeric_limits<double>::infinity()) override;
virtual Reservation reserve(SharedMember<agent::AssetAgent> agent, double q, double p_max = std::numeric_limits<double>::infinity()) override;
/// Adds a firm to this market. The Firm must be a QFirm object (or subclass)
virtual void addFirm(SharedMember<Firm> f) override;
......
#pragma once
#include <cstdint>
#include <functional>
/** \file eris/types.hpp basic type and class forward declarations
*
......
......@@ -2,12 +2,13 @@
// declared in Bundle.hpp).
#include <eris/Bundle.hpp>
#include <cstddef>
#include <algorithm>
#include <limits>
#include <unordered_set>
#include <set>
#include <cmath>
#include <iostream>
namespace eris {
BundleNegative::BundleNegative() {}
......
#include "eris/Consumer.hpp"
#include <eris/Consumer.hpp>
namespace eris {
......
#include <eris/Firm.hpp>
#include <eris/Simulation.hpp>
#include <utility>
namespace eris {
......
#include <eris/Market.hpp>
#include <eris/Simulation.hpp>
#include <vector>
namespace eris {
using agent::AssetAgent;
Market::Market(Bundle output_unit, Bundle price_unit) : output_unit(output_unit), price_unit(price_unit) {}
void Market::addFirm(SharedMember<Firm> f) {
......
#include <eris/Member.hpp>
#include <eris/Agent.hpp>
#include <eris/Good.hpp>
#include <eris/Market.hpp>
#include <system_error>
#include <vector>
namespace eris {
......
#include <eris/Positional.hpp>
#include <eris/Position.hpp>
#include <cstddef>
#include <algorithm>
#include <limits>
......
#include <eris/Member.hpp>
#include <eris/Simulation.hpp>
#include <eris/SharedMember.hpp>
#include <eris/Agent.hpp>
#include <eris/Good.hpp>
#include <eris/Market.hpp>
#include <eris/Optimize.hpp>
#include <algorithm>
#include <utility>
namespace eris {
......@@ -382,7 +383,7 @@ void Simulation::run() {
running_ = false;
}
RunStage Simulation::runStage() const {
Simulation::RunStage Simulation::runStage() const {
return stage_;
}
......
#include <eris/WrappedPositional.hpp>
#include <algorithm>
#include <eris/Position.hpp>
#include <eris/Positional.hpp>
#include <limits>
#include <cmath>
......
#include <eris/algorithms.hpp>
#include <cmath>
#include <algorithm>
namespace eris {
......
......@@ -2,6 +2,9 @@
#include <eris/Random.hpp>
#include <Eigen/QR>
#include <Eigen/SVD>
#include <Eigen/Cholesky>
#include <cmath>
#include <algorithm>
namespace eris { namespace belief {
......
#include <eris/belief/BayesianLinearRestricted.hpp>
#include <eris/belief/BayesianLinear.hpp>
#include <eris/Random.hpp>
#include <cmath>
#include <Eigen/QR>
#include <boost/math/distributions/normal.hpp>
#include <boost/math/distributions/chi_squared.hpp>
#include <eris/debug.hpp>
#include <boost/math/distributions/complement.hpp>
#include <stdexcept>
#include <vector>
#include <ostream>
using namespace Eigen;
......
#include <eris/consumer/CobbDouglas.hpp>
#include <limits>
#include <utility>
#include <cmath>
namespace eris { namespace consumer {
......
#include <eris/consumer/Polynomial.hpp>
#include <utility>
namespace eris { namespace consumer {
......
#include <eris/consumer/Quadratic.hpp>
#include <utility>
#include <unordered_map>
namespace eris { namespace consumer {
......
#include <eris/firm/PriceFirm.hpp>
#include <algorithm>
namespace eris { namespace firm {
......
#include <eris/firm/QFirm.hpp>
#include <cmath>
#include <utility>
namespace eris { namespace firm {
......
#include <eris/interopt/Callback.hpp>
#include <algorithm>
namespace eris { namespace interopt {
......
#include <eris/interopt/InterStepper.hpp>
#include <eris/algorithms.hpp>
namespace eris { namespace interopt {
......
#include <eris/interopt/PriceStepper.hpp>
#include <eris/firm/PriceFirm.hpp>
#include <eris/interopt/ProfitStepper.hpp>
namespace eris { namespace interopt {
......
#include <eris/interopt/ProfitStepper.hpp>
#include <eris/interopt/InterStepper.hpp>
#include <eris/firm/PriceFirm.hpp>
#include <eris/algorithms.hpp>
namespace eris { namespace interopt {
......