Skip to content

Commit

Permalink
Enable github actions to build examples. Avoid passing a polytope as …
Browse files Browse the repository at this point in the history
…a const reference.
  • Loading branch information
vissarion committed Feb 11, 2023
1 parent 553cf55 commit e2617cd
Show file tree
Hide file tree
Showing 33 changed files with 118 additions and 356 deletions.
57 changes: 0 additions & 57 deletions .github/workflows/R-CMD-check-macOS.yml

This file was deleted.

60 changes: 0 additions & 60 deletions .github/workflows/R-CMD-check-ubuntu.yml

This file was deleted.

56 changes: 0 additions & 56 deletions .github/workflows/R-CMD-check-windows.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/cmake-clang.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# GitHub Actions Workflow for volesti to build tests with GCC
# GitHub Actions Workflow for volesti to build tests with Clang
#
# Copyright (c) 2020-2022 Vissarion Fisikopoulos
#
Expand Down Expand Up @@ -36,4 +36,4 @@ jobs:
cd build;
cmake -D CMAKE_CXX_COMPILER=${{ matrix.config.compiler }} -D CMAKE_CXX_FLAGS=-fsanitize=memory -D CMAKE_CXX_FLAGS=-fsanitize=undefined -D CMAKE_CXX_FLAGS=-g -D DISABLE_NLP_ORACLES=ON -D USE_MKL=OFF ../test;
make;
ctest --verbose;
ctest --verbose;
38 changes: 0 additions & 38 deletions .github/workflows/cmake-gcc.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/docs.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/hpolytope-volume/hpolytopeVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef typename Kernel::Point Point;
typedef BoostRandomNumberGenerator<boost::mt19937, NT, 3> RNGType;
typedef HPolytope <Point> HPOLYTOPE;

void calculateVolumes(const HPOLYTOPE &HP) {
void calculateVolumes(HPOLYTOPE &HP) {
// Setup parameters for calculating volume
int walk_len = 10 + HP.dimension()/10;
NT e=0.1;
Expand Down
2 changes: 1 addition & 1 deletion examples/mmcs_method/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgslcblas")
#add_definitions( "-O3 -lgsl -lm -ldl -lgslcblas" )

find_package(OpenMP REQUIRED)

add_executable (skinny_cube_10_dim skinny_cube_10_dim.cpp)
Expand Down
6 changes: 3 additions & 3 deletions examples/multithread_sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ else ()
endif ()


add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
#add_definitions(${CMAKE_CXX_FLAGS} "-std=c++11") # enable C++11 standard
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-ldl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgslcblas")
#add_definitions( "-O3 -lgsl -lm -ldl -lgslcblas" )

find_package(OpenMP REQUIRED)

add_executable (sampling_multithread_walks sampling_multithread_walks.cpp)

TARGET_LINK_LIBRARIES(sampling_multithread_walks ${LP_SOLVE} OpenMP::OpenMP_CXX)


Expand Down
11 changes: 5 additions & 6 deletions examples/multithread_sampling/sampling_multithread_walks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ MT get_uniform_samples(Polytope &P,
std::list<Point> randPoints;

typedef RandomPointGeneratorMultiThread <walk> _RandomPointGeneratorMultiThread;

_RandomPointGeneratorMultiThread::apply(P, p, N, walk_len, num_threads, randPoints,
push_back_policy, rng);

unsigned int d = P.dimension();

MT samples(d, N);
unsigned int jj = 0;

Expand Down Expand Up @@ -92,7 +92,7 @@ MT get_gaussian_samples(Polytope &P,
std::list<Point> randPoints;

typedef GaussianPointGeneratorMultiThread <walk> _GaussianPointGeneratorMultiThread;

_GaussianPointGeneratorMultiThread::apply(P, p, a_i, N, walk_len, num_threads, randPoints,
push_back_policy, rng);

Expand All @@ -118,11 +118,10 @@ void test_uniform_random_walk(std::string random_walk, unsigned int const& num_t
typedef Eigen::Matrix<NT,Eigen::Dynamic,Eigen::Dynamic> MT;
typedef Eigen::Matrix<NT,Eigen::Dynamic,1> VT;
typedef BoostRandomNumberGenerator<boost::mt19937, NT, 3> RNGType;
Hpolytope P;
unsigned int d = 10, walk_len = 5, N = 5000;

std::cout << "--- Sampling with " + random_walk + " walk from H-cube10" << std::endl;
P = generate_cube<Hpolytope>(d, false);
Hpolytope P = generate_cube<Hpolytope>(d, false);
RNGType rng(P.dimension());

MT samples = get_uniform_samples<MT, WalkType, Point>(P, rng, walk_len, N, num_threads);
Expand Down Expand Up @@ -155,7 +154,7 @@ void test_gaussian_random_walk(std::string random_walk, unsigned int const& num_


int main() {

unsigned int num_threads = 2;

test_uniform_random_walk<double, BRDHRWalk_multithread>("BRDHR", num_threads);
Expand Down
9 changes: 5 additions & 4 deletions examples/optimization_spectrahedra/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ IF (OPENBLAS_LIB)
IF (GFORTRAN_LIB)
message( STATUS "GFORTRAN_LIB found: ${GFORTRAN_LIB}" )

add_executable (boltzmann_hmc_walk boltzmann_hmc_walk.cpp)
TARGET_LINK_LIBRARIES(boltzmann_hmc_walk ${ARPACK_LIB} ${LAPACK_LIBRARIES} ${GFORTRAN_LIB})
# These are not compiling, see issue https://github.com/GeomScale/volesti/issues/264
#add_executable (boltzmann_hmc_walk boltzmann_hmc_walk.cpp)
#TARGET_LINK_LIBRARIES(boltzmann_hmc_walk ${ARPACK_LIB} ${LAPACK_LIBRARIES} ${GFORTRAN_LIB})

add_executable (solve_sdp solve_sdp.cpp)
TARGET_LINK_LIBRARIES(solve_sdp ${GFORTRAN_LIB} ${LAPACK_LIBRARIES} ${ARPACK_LIB})
#add_executable (solve_sdp solve_sdp.cpp)
#TARGET_LINK_LIBRARIES(solve_sdp ${GFORTRAN_LIB} ${LAPACK_LIBRARIES} ${ARPACK_LIB})

ELSE()
MESSAGE(STATUS "gfortran is required but it could not be found")
Expand Down
6 changes: 3 additions & 3 deletions examples/sampling-hpolytope-with-billiard-walks/sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void write_to_file(std::string filename, std::vector<Point> const& randPoints) {
}


void sample_using_uniform_billiard_walk(HPOLYTOPE const& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
void sample_using_uniform_billiard_walk(HPOLYTOPE& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
std::string filename = "uniform_billiard_walk.txt";
typedef RandomPointGenerator<BilliardWalkType> Generator;

Expand All @@ -49,7 +49,7 @@ void sample_using_uniform_billiard_walk(HPOLYTOPE const& HP, RNGType& rng, unsig
}


void sample_using_uniform_accelerated_billiard_walk(HPOLYTOPE const& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
void sample_using_uniform_accelerated_billiard_walk(HPOLYTOPE& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
std::string filename = "uniform_accelerated_billiard_walk.txt";
typedef RandomPointGenerator<AcceleratedBilliardWalkType> Generator;

Expand All @@ -61,7 +61,7 @@ void sample_using_uniform_accelerated_billiard_walk(HPOLYTOPE const& HP, RNGType
}


void sample_using_gaussian_billiard_walk(HPOLYTOPE const& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
void sample_using_gaussian_billiard_walk(HPOLYTOPE& HP, RNGType& rng, unsigned int walk_len, unsigned int num_points) {
std::string filename = "gaussian_billiard_walk.txt";
typedef MultivariateGaussianRandomPointGenerator<GaussianAcceleratedWalkType> Generator;

Expand Down
4 changes: 2 additions & 2 deletions examples/vpolytope-volume/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-ldl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable (vpolytopeVolume vpolytopeVolume.cpp)
TARGET_LINK_LIBRARIES(vpolytopeVolume ${LP_SOLVE})
add_executable (vpolytopevolume vpolytopevolume.cpp)
TARGET_LINK_LIBRARIES(vpolytopevolume ${LP_SOLVE})

endif()
Loading

0 comments on commit e2617cd

Please sign in to comment.