text:
// Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
// HavoqGT Project Developers. See the top-level LICENSE file for details.
//
// SPDX-License-Identifier: MIT

#include <havoqgt/cache_utilities.hpp>
#include <havoqgt/delegate_partitioned_graph.hpp>
#include <havoqgt/ktruss_unroll.hpp>

#include <boost/bind.hpp>
#include <boost/function.hpp>

#include <assert.h>
#include <havoqgt/distributed_db.hpp>

#include <algorithm>
#include <deque>
#include <functional>
#include <string>
#include <utility>

#include <boost/interprocess/managed_heap_memory.hpp>

using namespace havoqgt;

void usage() {
  if (comm_world().rank() == 0) {
    std::cerr << "Usage: -i <string> -s <int>\n"
              << " -i <string>   - input graph base filename (required)\n"
              << " -b <string>   - backup graph base filename.  If set, "
                 "\"input\" graph will be deleted if it exists\n"
              << " -h            - print help and exit\n\n";
  }
}

void parse_cmd_line(int argc, char** argv, std::string& input_filename,
                    std::string& backup_filename) {
  if (comm_world().rank() == 0) {
    std::cout << "CMD line:";
    for (int i = 0; i < argc; ++i) {
      std::cout << " " << argv[i];
    }
    std::cout << std::endl;
  }

  bool found_input_filename = false;

  char c;
  bool prn_help = false;
  while ((c = getopt(argc, argv, "i:b:h ")) != -1) {
    switch (c) {
      case 'h':
        prn_help = true;
        break;
      case 'i':
        found_input_filename = true;
        input_filename       = optarg;
        break;
      case 'b':
        backup_filename = optarg;
        break;
      default:
        std::cerr << "Unrecognized option: " << c << ", ignore." << std::endl;
        prn_help = true;
        break;
    }
  }
  if (prn_help || !found_input_filename) {
    usage();
    exit(-1);
  }
}

int main(int argc, char** argv) {
  typedef delegate_partitioned_graph<distributed_db::allocator<>> graph_type;

  int mpi_rank(0), mpi_size(0);

  havoqgt::init(&argc, &argv);
  {
    CHK_MPI(MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank));
    CHK_MPI(MPI_Comm_size(MPI_COMM_WORLD, &mpi_size));

    if (mpi_rank == 0) {
      std::cout << "MPI initialized with " << mpi_size << " ranks."
                << std::endl;
      // print_system_info(false);
    }
    MPI_Barrier(MPI_COMM_WORLD);

    std::string graph_input;
    std::string backup_filename;

    parse_cmd_line(argc, argv, graph_input, backup_filename);

    MPI_Barrier(MPI_COMM_WORLD);
    if (backup_filename.size() > 0) {
      distributed_db::transfer(backup_filename.c_str(), graph_input.c_str());
    }

    distributed_db ddb(db_open_read_only(), graph_input.c_str());

    auto graph = ddb.get_manager()->find<graph_type>("graph_obj").first;
    assert(graph != nullptr);

    MPI_Barrier(MPI_COMM_WORLD);
    if (mpi_rank == 0) {
      std::cout << "Graph Loaded Ready." << std::endl;
    }
    graph->print_graph_statistics();
    MPI_Barrier(MPI_COMM_WORLD);

    ktruss_unroll(*graph);

  }  // END Main MPI
  ;

  return 0;
}

max_stars_repo_name: niklas-uhl/havoqgt

max_issues_repo_name: niklas-uhl/havoqgt

max_forks_repo_name: niklas-uhl/havoqgt


text:
#ifndef __C_AUTOM8_SIMPLE_DEVICE_HPP__
#define __C_AUTOM8_SIMPLE_DEVICE_HPP__

#include <boost/shared_ptr.hpp>
#include <boost/thread.hpp>

#include <autom8/device/device_base.hpp>

namespace autom8 {
    class simple_device: public device_base {
    public:
        simple_device(
            database_id id,
            const std::string& address,
            const std::string& label,
            const std::vector<std::string>& groups = std::vector<std::string>()
        );

        virtual ~simple_device();

        virtual device_status status();
        virtual std::string address();
        virtual std::string label();
        virtual database_id id();
        virtual void groups(std::vector<std::string>& target);

        virtual device_type type() = 0;
        virtual void turn_on() = 0;
        virtual void turn_off() = 0;

        virtual void update(
            const std::string& new_address,
            const std::string& new_label);

        virtual void update(
            const std::string& new_address,
            const std::string& new_label,
            const std::vector<std::string>& groups);

        virtual void set_groups(const std::vector<std::string>& groups);

    protected:
        virtual void on_updated();
        boost::recursive_mutex& state_mutex();

    protected:
        std::string label_;
        std::string address_;
        std::vector<std::string> groups_;
        device_status status_;
        database_id id_;
        boost::recursive_mutex state_mutex_;
    };
}

#endif

ext: hpp


text:
/**
 * Copyright (c) 2017, Laouen M. L. Belloli
 * Carleton University, Universidad de Buenos Aires
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 * 1. Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef CADMIUM_DYNAMIC_ATOMIC_HPP
#define CADMIUM_DYNAMIC_ATOMIC_HPP

#include <map>
#include <boost/any.hpp>
#include <cadmium/modeling/dynamic_model.hpp>
#include <cadmium/modeling/dynamic_message_bag.hpp>
#include <cadmium/concept/concept_helpers.hpp>
#include <cadmium/concept/atomic_model_assert.hpp>
#include <cadmium/modeling/dynamic_models_helpers.hpp>

namespace cadmium {
    namespace dynamic {
        namespace modeling {

            /**
             * @brief atomic is a derived class from the base classes atomic_bastract and ATOMIC<TIME>
             * this allow using any ATOMIC<TIME> valid class with pointers as an atomic_abstract
             * (first abase class) pointer.
             *
             * @details
             * Because ATOMIC<TIME> methods arity are template dependent, this wrapper class uses
             * cadmium::dynamic::message_bags as these methods parameter and it forwards a correct
             * translation to the corresponding type in the wrapped ATOMIC<TIME> base class method.
             *
             * @tparam ATOMIC a valid atomic model class
             * @tparam TIME a valid TIME class to use along with the atomic model class as ATOMIC<TIME>
             */
            template<template<typename T> class ATOMIC, typename TIME, typename... Args>
            class atomic : public atomic_abstract<TIME>, public ATOMIC<TIME> {
                cadmium::dynamic::modeling::Ports _input_ports;
                cadmium::dynamic::modeling::Ports _output_ports;

                std::string _id;

            public:
                using model_type=ATOMIC<TIME>;

                using output_ports = typename model_type::output_ports;
                using input_ports = typename model_type::input_ports;

                // Model input and output types
                using output_bags = typename make_message_bags<output_ports>::type;
                using input_bags = typename make_message_bags<input_ports>::type;

                atomic() {
                    static_assert(cadmium::concept::is_atomic<ATOMIC>::value, "This is not an atomic model");
                    cadmium::concept::pdevs::atomic_model_assert<ATOMIC>();
                    _id = boost::typeindex::type_id<model_type>().pretty_name();
                    _input_ports = cadmium::dynamic::modeling::create_dynamic_ports<input_ports>();
                    _output_ports = cadmium::dynamic::modeling::create_dynamic_ports<output_ports>();
                }

                atomic(const std::string& model_id, Args&&... args) : ATOMIC<TIME>(std::forward<Args>(args)...) {
                    static_assert(cadmium::concept::is_atomic<ATOMIC>::value, "This is not an atomic model");
                    cadmium::concept::pdevs::atomic_model_assert<ATOMIC>();
                    _id = model_id;
                    _input_ports = cadmium::dynamic::modeling::create_dynamic_ports<input_ports>();
                    _output_ports = cadmium::dynamic::modeling::create_dynamic_ports<output_ports>();
                }

                std::string get_id() const override {
                    return _id;
                }

                cadmium::dynamic::modeling::Ports get_input_ports() const override {
                    return _input_ports;
                }

                cadmium::dynamic::modeling::Ports get_output_ports() const override {
                    return _output_ports;
                }

                std::string model_state_as_string() const override {
                    std::ostringstream oss;
                    oss << this->state;
                    return oss.str();
                }

                std::string messages_by_port_as_string(cadmium::dynamic::message_bags outbox) const override {
                    std::ostringstream oss;
                    print_dynamic_messages_by_port<output_ports>(oss, outbox);
                    return oss.str();
                }

                // This method must be declared to declare all atomic_abstract virtual methods are defined
                void internal_transition() override {
                    model_type::internal_transition();
                }

                void external_transition(TIME e, cadmium::dynamic::message_bags bags) override {
                    // Translate from dynamic_message_bag to template dependent input_bags type.
                    input_bags tuple_bags;
                    cadmium::dynamic::modeling::fill_bags_from_map(bags, tuple_bags);

                    // Forwards the translated value to the wrapped model_type class method.
                    model_type::external_transition(e, tuple_bags);
                }

                void confluence_transition(TIME e, cadmium::dynamic::message_bags bags) override {
                    // Translate from dynamic_message_bag to template dependent input_bags type.
                    input_bags tuple_bags;
                    cadmium::dynamic::modeling::fill_bags_from_map(bags, tuple_bags);

                    // Forwards the translated value to the wrapped model_type class method.
                    model_type::confluence_transition(e, tuple_bags);
                }

                cadmium::dynamic::message_bags output() const override {
                    cadmium::dynamic::message_bags bags;
                    output_bags tuple_bags = model_type::output();

                    // Translate from template dependent output_bags type to dynamic_message_bag.
                    cadmium::dynamic::modeling::fill_map_from_bags(tuple_bags, bags);
                    return bags;
                }

                TIME time_advance() const override {
                    return model_type::time_advance();
                }
            };
        }
    }
}

#endif // CADMIUM_DYNAMIC_ATOMIC_HPP

max_stars_repo_name: juanlanuzag/cadmium

max_issues_repo_name: juanlanuzag/cadmium

max_forks_repo_name: juanlanuzag/cadmium


text:
//
// Created by joshua on 9/11/17.
//

#include <boost/program_options.hpp>
//#include <sim_env/Box2DWorldViewer.h>
#include <functional>
#include <mps/planner/pushing/OraclePushPlanner.h>
#include <mps/planner/util/yaml/OracleParsing.h>
#include <sim_env/Box2DController.h>
#include <sim_env/Box2DWorld.h>
#include <string>
#include <thread>

namespace po = boost::program_options;

struct DataGenerator {
    std::thread thread;
    mps::planner::util::yaml::OraclePlanningProblemDesc problem_desc;
    mps::planner::pushing::OraclePushPlanner planner;
    sim_env::Box2DWorldPtr world;
    std::string output_file;
    unsigned int num_samples;
    void run()
    {
        auto robot = world->getBox2DRobot(problem_desc.robot_name);
        auto target_object = world->getBox2DObject(problem_desc.training_object_name);
        std::stringstream header;
        auto aabb = target_object->getLocalAABB();
        header << aabb.getWidth() << ", " << aabb.getHeight()
               << ", " << target_object->getMass()
               << ", " << target_object->getInertia()
               << ", " << target_object->getBaseLink()->getGroundFrictionCoefficient()
               << ", " << target_object->getName();
        auto controller = std::make_shared<sim_env::Box2DRobotVelocityController>(robot);
        using namespace std::placeholders;
        robot->setController(std::bind(&sim_env::Box2DRobotVelocityController::control, controller, _1, _2, _3, _4, _5));
        mps::planner::ompl::state::goal::RelocationGoalSpecification goal_spec(problem_desc.goals.at(0).obj_name,
            problem_desc.goals.at(0).goal_position,
            Eigen::Quaternionf(),
            problem_desc.goals.at(0).goal_region_radius,
            0.0f);
        mps::planner::pushing::PlanningProblem problem(world, robot, controller, goal_spec);
        mps::planner::util::yaml::configurePlanningProblem(problem, problem_desc);
        planner.setup(problem);
        planner.evaluateOracle(goal_spec, output_file, num_samples, header.str());
    }
};

struct RobotFilter {
    std::string name;
    bool filter(const sim_env::Box2DRobotDescription& robot_desc)
    {
        return robot_desc.object_description.name.compare(name) != 0;
    }
};

struct ObjectFilter {
    std::string name;
    bool filter(const sim_env::Box2DObjectDescription& obj_desc)
    {
        return obj_desc.name.compare(name) != 0;
    }
};

int main(int argc, const char* const* argv)
{
    // declare program options
    bool verbose = false;
    po::options_description desc("Allowed options");
    desc.add_options()("help", "Show help message")("output_file", po::value<std::string>(), "path to file where to write results to")("planning_problem", po::value<std::string>(), "yaml file containing a planning problem definition")("num_samples", po::value<unsigned int>()->default_value(1000), "number of samples")("verbose", po::bool_switch(&verbose), "Set whether debug outputs should be printed")("threads", po::value<unsigned int>()->default_value(1), "number of threads");
    po::variables_map vm;
    po::store(po::parse_command_line(argc, argv, desc), vm);
    po::notify(vm);
    if (vm.count("help")) {
        std::cout << desc << std::endl;
        return 1;
    }
    if (!vm.count("output_file")) {
        std::cout << "Please specify an output file" << std::endl;
        return 1;
    }
    if (!vm.count("planning_problem")) {
        std::cout << "Please specify the planning problem to generate data for." << std::endl;
        return 1;
    }
    std::string planning_probl_file = vm["planning_problem"].as<std::string>();
    boost::filesystem::path root_path(planning_probl_file);
    if (not boost::filesystem::exists(root_path)) {
        std::cerr << "Could not open the file " << planning_probl_file << " because it does not exist." << std::endl;
        return 1;
    }
    root_path = root_path.parent_path();

    YAML::Node node = YAML::LoadFile(planning_probl_file);
    auto planning_desc = node.as<mps::planner::util::yaml::OraclePlanningProblemDesc>();

    sim_env::Box2DEnvironmentDescription env_desc;
    parseYAML(sim_env::resolveFileName(planning_desc.world_file, root_path), env_desc);
    // remove any object other than the robot and the target object from the scene
    RobotFilter robot_filter;
    robot_filter.name = planning_desc.robot_name;
    std::remove_if(env_desc.robots.begin(), env_desc.robots.end(),
        std::bind(&RobotFilter::filter, &robot_filter, std::placeholders::_1));
    assert(env_desc.robots.size() == 1);
    // remove objects
    ObjectFilter obj_filter;
    obj_filter.name = planning_desc.training_object_name;
    std::remove_if(env_desc.objects.begin(), env_desc.objects.end(),
        std::bind(&ObjectFilter::filter, &obj_filter, std::placeholders::_1));
    assert(env_desc.objects.size() == 1);
    // create workers
    std::string output_file = vm["output_file"].as<std::string>();
    unsigned int num_threads = std::max(vm["threads"].as<unsigned int>(), 1u);
    std::vector<DataGenerator> data_generators(num_threads);
    for (unsigned int t = 0; t < data_generators.size(); ++t) {
        std::cout << "Launching thread " << (t + 1) << "/" << num_threads << " for data generation" << std::endl;
        DataGenerator& data_generator = data_generators.at(t);
        data_generator.output_file = output_file + std::to_string(t);
        data_generator.num_samples = vm["num_samples"].as<unsigned int>();
        data_generator.problem_desc = planning_desc;
        data_generator.world = std::make_shared<sim_env::Box2DWorld>();
        data_generator.world->loadWorld(env_desc);
        if (verbose) {
            data_generator.world->getLogger()->setLevel(sim_env::Logger::LogLevel::Debug);
        }
        data_generator.thread = std::thread(std::bind(&DataGenerator::run, std::ref(data_generator)));
    }
    //    auto viewer = data_generators[0].world->getViewer();
    //    auto box2d_viewer = std::dynamic_pointer_cast<sim_env::Box2DWorldViewer>(viewer);
    //    box2d_viewer->show(argc, argv);
    //    int a = box2d_viewer->run();
    for (auto& data_gen : data_generators) {
        data_gen.thread.join();
        std::cout << "Joined a thread" << std::endl;
    }
    std::cout << "All done" << std::endl;
    return 0;
}

ext: cpp


text:
//
//  Copyright (c) 2000-2002
//  Joerg Walter, Mathias Koch
//
//  Permission to use, copy, modify, distribute and sell this software
//  and its documentation for any purpose is hereby granted without fee,
//  provided that the above copyright notice appear in all copies and
//  that both that copyright notice and this permission notice appear
//  in supporting documentation.  The authors make no representations
//  about the suitability of this software for any purpose.
//  It is provided "as is" without express or implied warranty.
//
//  The authors gratefully acknowledge the support of
//  GeNeSys mbH & Co. KG in producing this work.
//

#ifndef BOOST_UBLAS_CONFIG_H
#define BOOST_UBLAS_CONFIG_H

#include <memory>
#include <cassert>
#include <cstddef>

#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/limits.hpp>
#include <boost/noncopyable.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/remove_reference.hpp>

// Microsoft Visual C++
#if defined (BOOST_MSVC) && ! defined (BOOST_STRICT_CONFIG)

// Version 6.0
#if BOOST_MSVC < 1300
// Cannot access private members from member class
#define BOOST_UBLAS_NESTED_CLASS_DR45
#endif

// Version 6.0 & 7.0
#if BOOST_MSVC <= 1300

// Disable some MSVC specific warnings.
#pragma warning (disable: 4355)
#pragma warning (disable: 4503)
#pragma warning (disable: 4786)

// static member data initialisers require = syntax
#define BOOST_UBLAS_STATIC_OLD_INIT
// Member friend syntax works but lookup sometime fails on VC7
#define BOOST_UBLAS_NO_MEMBER_FRIENDS
// Base traits templates syntax not supported
#define BOOST_UBLAS_NO_ITERATOR_BASE_TRAITS
// MSVC doesn't always accept the 'typename' keyword
#define BOOST_UBLAS_TYPENAME
// MSVC doesn't accept the 'using' keyword (at least for importing base members)
#define BOOST_UBLAS_USING
// MSVC doesn't support long double
#define BOOST_UBLAS_NO_LONG_DOUBLE

#ifdef NDEBUG
// MSVC has special inlining options
#pragma inline_recursion (on)
#pragma inline_depth (255)
#pragma auto_inline (on)
// #define BOOST_UBLAS_INLINE __forceinline
#define BOOST_UBLAS_INLINE __inline
#endif

// MSVC extensions seem to disable abs () overloads in <cmath>.
#ifdef _MSC_EXTENSIONS
#define BOOST_UBLAS_CMATH_BAD_STD
#endif

// We must disable element proxies as they require template partial specialisation
#define BOOST_UBLAS_NO_ELEMENT_PROXIES

// This seems to be a problem in boost.config, but won't be fixed.
#ifdef __SGI_STL_PORT
#define BOOST_MSVC_STD_ITERATOR
#endif

#endif

// Version 7.1
#if BOOST_MSVC == 1310

// Seeming still some problems with function templates
#define BOOST_UBLAS_MSVC71_FUNCTION_TEMPLATE_ORDERING
// One of these workarounds is needed for MSVC 7.1 AFAIK
// (thanks to John Maddock and Martin Lauer).
// The second workaround looks like BOOST_UBLAS_QUALIFIED_TYPENAME.
#if !(defined(BOOST_UBLAS_NO_NESTED_CLASS_RELATION) || defined(BOOST_UBLAS_MSVC_NESTED_CLASS_RELATION))
#define BOOST_UBLAS_NO_NESTED_CLASS_RELATION
#endif

#endif

#endif

// GNU Compiler Collection
#if defined (__GNUC__) && ! defined (BOOST_STRICT_CONFIG)

#if __GNUC__ >= 3 && __GNUC_MINOR__ >= 4
// By ABI definition see GCC bug id 9982
#define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
#endif

#if __GNUC__ <= 2 && __GNUC_MINOR__ <= 95
#define BOOST_UBLAS_NO_PROXY_SHORTCUTS
#define BOOST_UBLAS_NO_MEMBER_FRIENDS
// Cannot overload basic_stream
#define BOOST_UBLAS_USE_STREAM
// Cannot access private members from member class
#define BOOST_UBLAS_NESTED_CLASS_DR45
#endif

#endif

// Intel Compiler
#if defined (BOOST_INTEL) && ! defined (BOOST_STRICT_CONFIG)

#if (BOOST_INTEL_LINUX >= 700)
// By inspection of compiler results
#define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
#endif

#if (BOOST_INTEL < 800)
// Base traits templates syntax untested
#define BOOST_UBLAS_NO_ITERATOR_BASE_TRAITS
#endif

// Define swap for index_pair and triple.
#if (BOOST_INTEL <= 800)
namespace boost { namespace numeric { namespace ublas {
    template<class C, class IC>
    class indexed_iterator;

    template<class V>
    class index_pair;
    template<class M>
    class index_triple;
}}}

namespace std {
    template<class V>
    inline
    void swap (boost::numeric::ublas::index_pair<V> i1, boost::numeric::ublas::index_pair<V> i2) {
        i1.swap (i2);
    }
    template<class M>
    inline
    void swap (boost::numeric::ublas::index_triple<M> i1, boost::numeric::ublas::index_triple<M> i2) {
        i1.swap (i2);
    }
    // iter_swap also needed for ICC on Itanium?
    template<class C, class IC>
    inline
    void iter_swap (boost::numeric::ublas::indexed_iterator<C, IC> it1,
                    boost::numeric::ublas::indexed_iterator<C, IC> it2) {
        swap (*it1, *it2);
    }
}
#endif

#endif

// Comeau compiler - thanks to Kresimir Fresl
#if defined (__COMO__) && ! defined (BOOST_STRICT_CONFIG)

// Missing std::abs overloads for float types in <cmath> are in <cstdlib>
#if defined(__LIBCOMO__) && (__LIBCOMO_VERSION__ <= 31)
#include <cstdlib>
#endif

#endif

//  HP aCC C++ compiler
#if defined (__HP_aCC) && ! defined (BOOST_STRICT_CONFIG)
// No version specific configuration
// #if (__HP_aCC <= 53800)
#endif

//  SGI MIPSpro C++ compiler
#if defined (__sgi) && ! defined (BOOST_STRICT_CONFIG)

// Missing std::abs overloads for float types in <cmath> are in <cstdlib>
// This should should be library version specific.
#include <cstdlib>

#if __COMPILER_VERSION >=650
// By inspection of compiler results - thanks to Peter Schmitteckert
#define BOOST_UBLAS_USEFUL_ARRAY_PLACEMENT_NEW
#endif

#endif

// Metrowerks Codewarrior
#if defined (__MWERKS__) && ! defined (BOOST_STRICT_CONFIG)

// 8.x
#if __MWERKS__ <= 0x3003
#define BOOST_UBLAS_NO_MEMBER_FRIENDS
// Problems with basic_stream imbue
#define BOOST_UBLAS_USE_STREAM
// Base traits templates syntax untested
#define BOOST_UBLAS_NO_ITERATOR_BASE_TRAITS
// Problems type check debug functor syntax
#define BOOST_UBLAS_TYPE_CHECK 0
#endif

#endif

// Default configuration without compiler problems
#ifndef BOOST_UBLAS_TYPENAME
#define BOOST_UBLAS_TYPENAME typename
#endif
#ifndef BOOST_UBLAS_USING
#define BOOST_UBLAS_USING using
#endif

// Enable performance options in RELEASE mode
#ifdef NDEBUG

#ifndef BOOST_UBLAS_INLINE
#define BOOST_UBLAS_INLINE inline
#endif

// Do not check sizes!
#define BOOST_UBLAS_USE_FAST_SAME

// NO runtime error checks with BOOST_UBLAS_CHECK macro
#ifndef BOOST_UBLAS_CHECK_ENABLE
#define BOOST_UBLAS_CHECK_ENABLE 0
#endif

// NO type compatibility numeric checks
#ifndef BOOST_UBLAS_TYPE_CHECK
#define BOOST_UBLAS_TYPE_CHECK 0
#endif

// Disable performance options in DEBUG mode
#else

#ifndef BOOST_UBLAS_INLINE
#define BOOST_UBLAS_INLINE
#endif

// Enable runtime error checks with BOOST_UBLAS_CHECK macro. Check bounds etc
#ifndef BOOST_UBLAS_CHECK_ENABLE
#define BOOST_UBLAS_CHECK_ENABLE 1
#endif

// Type compatibiltity numeric checks
#ifndef BOOST_UBLAS_TYPE_CHECK
#define BOOST_UBLAS_TYPE_CHECK 1
#endif

#endif

/*
 * Type compatibility checks
 *  Control type compatibility numeric runtime checks for non dense matrices.
 *  Require additional storage and complexity
 */
#if BOOST_UBLAS_TYPE_CHECK
template <class Dummy>
struct disable_type_check
{
    static bool value;
};
template <class Dummy>
bool disable_type_check<Dummy>::value = false;
#endif
#ifndef BOOST_UBLAS_TYPE_CHECK_EPSILON
#define BOOST_UBLAS_TYPE_CHECK_EPSILON (type_traits<real_type>::sqrt (std::numeric_limits<real_type>::epsilon ()))
#endif
#ifndef BOOST_UBLAS_TYPE_CHECK_MIN
#define BOOST_UBLAS_TYPE_CHECK_MIN (type_traits<real_type>::sqrt ( (std::numeric_limits<real_type>::min) ()))
#endif

/*
 * General Configuration
 */

// Operator () is alreadly heavily over used. Use project member function for proxies
//#define BOOST_UBLAS_NO_PROXY_SHORTCUTS

// In order to simplify debugging is is possible to simplify expression template
// so they are restricted to a single operation
// #define BOOST_UBLAS_SIMPLE_ET_DEBUG

// Select stream types defined for IO
#if !defined(BOOST_UBLAS_USE_STREAM) && !defined(BOOST_UBLAS_USE_BASIC_STREAM)
#define BOOST_UBLAS_USE_BASIC_STREAM
#endif

// Use invariant hoisting.
// #define BOOST_UBLAS_USE_INVARIANT_HOISTING

// Use Duff's device in element access loops
// #define BOOST_UBLAS_USE_DUFF_DEVICE

// Choose evaluation method for dense vectors and matrices
#if !(defined(BOOST_UBLAS_USE_INDEXING) || defined(BOOST_UBLAS_USE_ITERATING))
#define BOOST_UBLAS_USE_INDEXING
#endif
// #define BOOST_UBLAS_USE_ITERATING
// #define BOOST_UBLAS_ITERATOR_THRESHOLD 0
// #define BOOST_UBLAS_ITERATOR_THRESHOLD ((std::numeric_limits<std::ptrdiff_t>::max) ())

// Use indexed iterators.
// #define BOOST_UBLAS_USE_INDEXED_ITERATOR

// Alignment of bounded arrays. align(16) possibly useful for ICC
#ifndef BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
#define BOOST_UBLAS_BOUNDED_ARRAY_ALIGN
#endif

// Enable assignment of non conformant proxies
#define BOOST_UBLAS_NON_CONFORMANT_PROXIES

// Enable different sparse element proxies
#ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES
// Sparse proxies prevent reference invalidation problems in expressions such as:
// a [1] = a [0] = 1        Thanks to Marc Duflot for spotting this.
// #define BOOST_UBLAS_STRICT_MAP_ARRAY
#define BOOST_UBLAS_STRICT_VECTOR_SPARSE
#define BOOST_UBLAS_STRICT_MATRIX_SPARSE
// Hermitian matrices use element proxies to allow assignment to conjugate triangle
#define BOOST_UBLAS_STRICT_HERMITIAN
#endif

// Define to enable compile time const propagation for reference, proxy and closure types
#define BOOST_UBLAS_CT_REFERENCE_BASE_TYPEDEFS
#define BOOST_UBLAS_CT_PROXY_BASE_TYPEDEFS
#define BOOST_UBLAS_CT_PROXY_CLOSURE_TYPEDEFS

// Define to configure special settings for reference returning members
// #define BOOST_UBLAS_REFERENCE_CONST_MEMBER
// #define BOOST_UBLAS_PROXY_CONST_MEMBER

// Include declerations and functions
#include <boost/numeric/ublas/fwd.hpp>
#include <boost/numeric/ublas/definitions.hpp>

#endif

max_stars_repo_name: macaurther/DOCUSA

max_issues_repo_name: macaurther/DOCUSA

max_forks_repo_name: dguenms/Dawn-of-Civilization