Commit c01933b3 authored by Martin Marinov's avatar Martin Marinov
Browse files

Merged the research branch into ReForm. No behaviour changes.

[git-p4: depot-paths = "//ReForm/ReForm/main/CoMISo/": change = 13190]
parent 76543168
......@@ -50,6 +50,10 @@ DEB_module("CBCSolver")
#define CBC_INFINITY COIN_DBL_MAX
#ifndef _MSC_VER
#define sprintf_s snprintf
#endif
//== NAMESPACES ===============================================================
namespace COMISO {
......@@ -252,7 +256,7 @@ void solve_impl(
{
static int n_mps_dumps = 0;
char filename[64];
sprintf_s(filename, "CBC_problem_dump_%04i", n_mps_dumps);
sprintf_s(filename, sizeof(filename), "CBC_problem_dump_%04i", n_mps_dumps++);
si.writeMps(filename); //output problem as .MPS
}
// Pass the OsiSolver with the problem to be solved to CbcModel
......
......@@ -14,10 +14,9 @@
#include "BoundConstraint.hh"
#include "ConeConstraint.hh"
#include <Base/Debug/DebTime.hh>
#include <Base/Utils/StopWatch.hh>
#if COMISO_CPLEX_AVAILABLE
//=============================================================================
......@@ -929,7 +928,7 @@ solve(NProblemInterface* _problem,
// std::copy(_constraints.begin(),_constraints.end(),std::back_inserter(C));
// return solve(_problem, C, _time_limit, _silent);
StopWatch sw; sw.start();
Base::StopWatch sw; sw.start();
bool feasible_point_found = false;
int cur_pass = 0;
......@@ -1346,4 +1345,4 @@ CPLEXSolver()
} // namespace COMISO
//=============================================================================
#endif // COMISO_CPLEX_AVAILABLE
//=============================================================================
\ No newline at end of file
//=============================================================================
......@@ -4,7 +4,7 @@
//
//=============================================================================
#include "DOcloudJob.hh"
#include "DOCloudJob.hh"
#if COMISO_DOCLOUD_AVAILABLE
#include "DOCloudConfig.hh"
#include "CoMISo/Utils/CoMISoError.hh"
......@@ -29,9 +29,7 @@ static const char* gen_app_type__ = "Content-Type: application/octet-stream";
Config::Config()
: root_url_("https://api-oaas.docloud.ibmcloud.com/job_manager/rest/v1/jobs"),
api_key_("X-IBM-Client-Id: api_cc4223a4-ecad-4dd0-a1a5-59dac8db0b41"),
infs_time_(300), fsbl_time_(15),
cache_loc_("\\\\camfs1\\General_access\\Martin_Marinov\\ReForm\\Cache\\")
infs_time_(300), fsbl_time_(15)
{
const char* env_cache_dir = getenv("ReFormCacheDir");
if (env_cache_dir != nullptr && env_cache_dir[0] != 0)
......
......@@ -14,7 +14,7 @@
#include "GUROBISolver.hh"
#if (COMISO_QT_AVAILABLE)
#include "GUROBIHelper.hh"
#include "GurobiHelper.hh"
#endif//COMISO_QT_AVAILABLE
#include <CoMISo/Utils/CoMISoError.hh>
......
......@@ -16,6 +16,7 @@ SET(my_t_impls
${CMAKE_CURRENT_SOURCE_DIR}/CholmodSolverT.cc
${CMAKE_CURRENT_SOURCE_DIR}/ConstrainedSolverT.cc
${CMAKE_CURRENT_SOURCE_DIR}/EigenLDLTSolverT.cc
${CMAKE_CURRENT_SOURCE_DIR}/Eigen_ToolsT.cc
${CMAKE_CURRENT_SOURCE_DIR}/IterativeSolverT.cc
${CMAKE_CURRENT_SOURCE_DIR}/SparseQRSolverT.cc
${CMAKE_CURRENT_SOURCE_DIR}/MISolverT.cc
......
......@@ -22,9 +22,7 @@
* *
\*===========================================================================*/
#include "EigenLDLTSolver.hh"
#include "EigenLDLTSolverT.cc"
//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#if (COMISO_EIGEN3_AVAILABLE)
......@@ -115,8 +113,6 @@ show_timings()
//////////////////////////////////////////////////////////////////////////
// explicit instantiation
#include "EigenLDLTSolverT.cc"
namespace COMISO
{
......
......@@ -92,6 +92,7 @@ bool EigenLDLTSolver::update_system_eigen( const Eigen_MatrixT& _mat)
}
//=============================================================================
#endif // COMISO_EIGEN3_AVAILABLE
//=============================================================================
This diff is collapsed.
......@@ -118,7 +118,7 @@ void gmm_to_eigen( const GMM_MatrixT& _G, EIGEN_MatrixT& _E);
//=============================================================================
#if defined(INCLUDE_TEMPLATES) && !defined(COMISO_Eigen_TOOLS_C)
#define COMISO_Eigen_TOOLS_TEMPLATES
#include "Eigen_Tools.cc"
#include "Eigen_ToolsT.cc"
#endif
//=============================================================================
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
#include <CoMISo/Config/CoMISoDefines.hh>
#include <CoMISo/Config/config.hh>
#include "GMM_Tools.hh"
#include <Base/Utils/StopWatch.hh>
#include <iostream>
#include <vector>
......@@ -154,6 +155,8 @@ private:
std::vector<Int> rowind_;
bool show_timings_;
Base:StopWatch sw_;
};
//=============================================================================
......
......@@ -59,7 +59,8 @@ inline int isfinite(double x)
}// namespace std
#endif
//TODO: round_to_int (or a better name)
inline int round(double _x) { return int(_x >= 0.0 ? _x + 0.5 : _x - 0.5); }
inline bool same(const double _x, const double _y, const double _tol)
{
......
//=============================================================================
//
// HELPER for OpenMP include
//
//=============================================================================
#ifndef COMISO_OMP_HH
#define COMISO_OMP_HH
// use openmp if available
#if defined(_OPENMP)
#include <omp.h>
#else // define behavior of single thread
typedef int omp_int_t;
inline omp_int_t omp_get_thread_num() { return 0;}
inline omp_int_t omp_get_max_threads() { return 1;}
inline omp_int_t omp_get_num_procs() { return 1;}
inline void omp_set_dynamic (omp_int_t _n) {}
inline void omp_set_num_threads_nested (omp_int_t _n) {}
inline void omp_set_nested (omp_int_t _n) {}
#endif
//=============================================================================
#endif // COMISO_OMP_HH defined
//=============================================================================
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment