Revision c0cc48c3328d0a7ea990cf43c01fb3b08c0b0c24 authored by Marios Papachristou on 17 July 2020, 07:44:29 UTC, committed by GitHub on 17 July 2020, 07:44:29 UTC
* Initialize report

* Add solvers file

* WIP: Add Euler ODE Solver

* WIP: Add Euler Method

* Add boundary reflections to Euler

* Fix boundary reflections

* Add test for ODE dx/dt = -x for Euler Method

* Add test for dx/dt = x in [0, 1]

* Add is_in for multiple reflections

* Add normalize flag to get_direction

* Minor modifications

* WIP: Add HMC for log-concave densities

* Add tests for HMC

* Add details to README

* Add tests for leapfrog method

* Add leapfrog method

* Add HMC and HMC tests

* Separate Euler and Leapfrog

* Remove ode_solvers.h

* Refactor solver implementations

1. Move solvers to separate file
2. Fix includes. The ode_solvers.h base file
includes the rest of the solvers and is respon-
sible for doing the correct includes.

* Add RK methods header file

* WIP: Add generic RK methods

* Implement RK methods with testing

* Add collocation method header files

* Fix bug in RK methods

* WIP: Collocation method constructors

* WIP: Implement collocation method

* Add root_finders header file

* Add CHECK() statements and fix minor bugs

* Bug fix for boundary oracle

* Add CHEK() for constrained leapfrog

* Add Newton-Raphson method for root finding

* Add return statement

* Add notice

* Add regularization (smoothing) and max_iters

* Add const where needed

* Add BS method

* Add Bulirsch-Stoer implementation

* Add Bulirsch-Stoer implementation

* Add constrained BS method

* WIP: Debug collocation method

* WIP: Debug collocation method

* Add rational fcn and grad of rational fcn functors

* WIP: Add testcase for collocation methods

* Fix BS method

* Minor changes

* Add resources to ODE solvers

* Initialize curve_intersect for Hpoly

* WIP: Boundary oracles

* WIP: Boundary oracles

* WIP: Boundary oracles

* WIP: Boundary oracles

* WIP: Boundary oracles

* WIP: Add isinf for well-posedness of denominator in NR

* Move func template one level above (for ULD to work later)

* Initialize boundary oracles test

* Add boundary oracle test CMake targets

* Initialize boundary oracles tests

* Working boundary oracle for H-polytope

1. Uses Newton-Raphson for solving transcendental equations
2. Can find multiple/one root
3. Tests are implemented for the curves (t, t) and (t, 2t^2)

* Initialize NLP oracles (general curve w/ polytope)

* Finish boundary oracle tests for H-polytope

* Add ifopt and ipopt to CMakeLists.txt

* Add wrapper function for nlp oracles

* Working nlp H-polyoracle

* Rename nlp polyoracles to avoid confusion with lp oracles

* Remove old polyoracles file

* Document NLP hpolyoracles

* Minor refactoring

* Add wrapper function

* WIP: Initialize NLP oracle for V-polytope

* Update readme with GSoC information

* Add benchmarks with random polynomials

* Modify membership condition

* Restrain test to t only

* Bug fixes

* Code cleanup

* Move to old commit (before merge)

* Merge ode solvers

* Rename testcases

* Merge root finders test

* Move hmc to sampling/ directory

* Partial fix for V polyoracles with ipopt

* Fix linear collocation method

* Fix collocation with approximate computation

* Improve README file

* Add precomputation flag

* Improve NR solver

* Add central method for curve_intersect

* Change return type of nlp vpolyoracle to return dummy facet

* WIP: Integrate boundary oracles to collocation

* Fix collocation method boundary oracles (w/ tests)

* Bug fixes

* Add mpsolve and gmp to CMakeLists.txt

* Implement mpsolve wrapper

* WIP: Integrate mpsolve

* Fix preprocessor directives

* Add boundary oracle with mpsolve

* Fix minor issues

* Fix existing working tests

* Add min_pos optimization problem

* WIP: Minor changes in way of reflection

* Remove hmc sampler temporarily (move it to temp branch)

* Fix reflections

* Add dependencies(mpsolve, ipopt/ifopt) to CircleCI

* Fix config

* Fix config

* Fix config

* Add dependency at circleci config

* Add dependency at circleci config

* Add dependency at circleci config

* Add dependency at circleci config

* Add dependency at circleci config

* Add root finders test

* Minor fixes in boundary oracles

* Fix bounded collocation

* Typo fix

* Add missing test to cmakelists

* Add #undef where it is needed

* Remove extraneous dynamic linking

* Fix erroneous flag

* Remove hmc tests (moved to other branch)

* Update clang and g++ workflows

* Fix failing R tests

* Fix failing R tests

* Split checking for ubuntu/macOS

* Remove misplaced if statement

* Add CMAKE_CXX_COMPILER flag to ifopt

* Correct test name

* Remove sudo in front of brew cmd

* Add automake dependency

* Change error_on from "warning" to "error"

* Add preprocessor directive to disable NLP oracles

* Add flag for disabling oracles

* Add macro definitions for disabling oracles

* Add windows workflow

* Modify windows workflow

* Change Makevars.win

* Change Makevars.win

* Change Makevars.win

* Disable NLP oracles to all tests

* Modify circleci build

* Modify circleci build

* Add preprocessor directive

* Remove report

* Remove GSoC details

* Move macro

* Remove unused typedefs

* Modify copyright notices

* Fix typo

* Rename rk.h to runge_kutta.hpp

* Minor correction

* Rename .h to .hpp in ODE solvers

* Rename nlp oracles from .h to .hpp

* Rename root finders

* Remove duplicate include

* Reorder #include directives

* Refactoring

* Rename file

* Add velocity reflections

* Remove extraneous constructors

* Add general docs for solvers

* Temp refactoring

* Fix minor bugs

* Remove flag from richardson implementation

* Add facet ignore

* Finish oracles refactoring

* Consistent copyright notices

* Add accidentally removed templates

* Consistent copyright notices

* Add nlp_oracles.hpp main header file

* Minor modifications

* Change variable name from oracle to intersection_oracle

* Remove unused file

* Add higher-order reflections

* Add missing ignore_facet

* Wrap long lines

* Remove print statement

* Impose sticky boundary conditions for collocation

* Impose sticky boundary conditions for collocation

* WIP: Add integral collocation method class prototype

* Delete integral_collocation.hpp

* Modifications to collocation method

* Iteratively solve non-linear equations

* Fix bugs

* Minor modifications to test routines

* Optimize function oracles

* Comment for future work

* Minor changes

* Remove comments from yaml

* Restore README

* Restore README
1 parent 21c6bf5
Raw File
CONTRIBUTING.md
# Contributing to `volesti`

:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:

The following is a set of guidelines for contributing to volesti, 
which are hosted in the [GeomScale Organization](https://github.com/GeomScale) on GitHub. 
These are mostly guidelines, not rules. 
Use your best judgment, and feel free to propose changes to this document in a pull request.

## Table of Contents

  * [Prerequisites (how to start)](#prerequisites--how-to-start-)
  * [Testing the development branch of volesti (get the tools ready)](#testing-the-development-branch-of-volesti--get-the-tools-ready-)
  * [Fork  volesti repository (this is your repo now!)](#fork--volesti-repository--this-is-your-repo-now--)
    + [Verify if your fork works (optional)](#verify-if-your-fork-works--optional-)
  * [Working with volesti (get ready to contribute)](#working-with-volesti--get-ready-to-contribute-)
    + [GitFlow workflow](#gitflow-workflow)
    + [Create new branch for your work](#create-new-branch-for-your-work)
    + [Verify your new branch (optional)](#verify-your-new-branch--optional-)
  * [Modify the branch (implement, implement, implement)](#modify-the-branch--implement--implement--implement-)
    + [Tests](#tests)
    + [Push](#push)
  * [Pull request (the joy of sharing)](#pull-request--the-joy-of-sharing-)
  * [Review (ok this is not an exam)](#review--ok-this-is-not-an-exam-)
  
## Prerequisites (how to start)

* git (see [Getting Started with Git](https://help.github.com/en/github/using-git/getting-started-with-git-and-github))
* a compiler to run tests - gcc, clang, etc.
* configured GitHub account
 
Other helpful links:

* http://git-scm.com/documentation
* https://help.github.com/articles/set-up-git
* https://opensource.com/article/18/1/step-step-guide-git

## Testing the development branch of volesti (get the tools ready)

Clone the repository, 

    git clone git@github.com:GeomScale/volume_approximation.git volesti
    cd volesti
    git branch -vv

the last command should tell you that you are in `develop` branch.

To compile the `C++` code you have to specify the path to external library `liblpsolve55.so`, by running, in folder test:

    cmake -DLP_SOLVE=_PATH_TO_LIB_FILE_ .  
    make  

Run the tests, 
    
    cmake test 

or 

    ctest -jK 
    
where `K`  is the number of CPU threads. By adding the option `--verbose` to `ctest` you get more information about the tests, 
*e.g.* time per test, volume computed and the name of the polytope or convex body.

![test_cube](https://user-images.githubusercontent.com/3660366/72348403-0524df00-36e3-11ea-9b6d-288a2bddc22c.png)

If everything works for you, you may move forward.

## Fork  volesti repository (this is your repo now!)

You can't work directly in the original volesti repository, therefore you should create your fork of this library. 
This way you can modify the code and when the job is done send a pull request to merge your changes with the original 
repository.

![fork](https://user-images.githubusercontent.com/3660366/72348562-57fe9680-36e3-11ea-9746-385ff61c752a.png)

1. login on `GitHub`
2. go to [volesti repository](https://github.com/GeomScale/volume_approximation)
3. click the 'Fork' button
4. choose your profile
5. wait
6. ready to contribute!

More info: [Forking Projects](https://guides.github.com/activities/forking/)

### Verify if your fork works (optional)

Go out of `volesti` directory

    cd ..

clone your repository and checkout develop branch

    git clone git@github.com:vissarion/volume_approximation.git volesti_fork
    cd volesti_fork
    git checkout develop
    git branch -vv
    git pull

see commits

    git log
    gitk

For now you should see exactly the same commits as in `volesti` repository.

## Working with volesti (get ready to contribute)

### GitFlow workflow

Volesit is using the [GitFlow](http://nvie.com/posts/a-successful-git-branching-model/) workflow. 
It's because it is very well suited to collaboration and scaling the development team. 
Each repository using this model should contain two main branches:

* master - release-ready version of the library
* develop - development version of the library
 
and could contain various supporting branches for new features and hotfixes. 

As a contributor you'll most likely be adding new features or fixing bugs in the development version of the library. 
This means that for each contribution you should create a new branch originating from the develop branch, 
modify it and send a pull request in order to merge it, again with the develop branch.

### Create new branch for your work

Make sure you're in develop branch running

    git branch -vv

you should see

![branch -vv](https://user-images.githubusercontent.com/3660366/72348696-a1e77c80-36e3-11ea-93ec-70f5622c0675.png)

Now you should pick a name for your new branch that doesn't already exist. 
The following checks for existing remote branches

    git branch -a

![List of branches](https://user-images.githubusercontent.com/3660366/72348763-c5aac280-36e3-11ea-8f2c-c66e2c107929.png)
Alternatively, you can check them on `GitHub`.

Assume you want to add some new functionality (i.e. a new feature) for example a new sampling algorithm. Then you have 
to create a new branch e.g. `feature/the_fastest_sampling_algo_ever`

Create new local branch

    git branch feature/the_fastest_sampling_algo_ever
    git checkout feature/the_fastest_sampling_algo_ever

push it to your fork

    git push -u my_fork feature/the_fastest_sampling_algo_ever

Note that the `-u` switch also sets up the tracking of the remote branch. Your new branch now is created!

### Verify your new branch (optional)

Now with the command

    git branch -vv

you see

![branch-picked](https://user-images.githubusercontent.com/3660366/72348881-09053100-36e4-11ea-8187-c5a2fc7004b2.png)

Note that without the `-u` switch you wouldn't see the tracking information for your new branch.

Alternatively, your newly created remote branch is also available on GitHub

![new-feature-branch-github](https://user-images.githubusercontent.com/3660366/72349060-76b15d00-36e4-11ea-8065-e2367d5a2696.png)

## Modify the branch (implement, implement, implement)

Before contributiong to a library by adding a new feature, or a bugfix, or improving documentation, 
it is always wise to interact with the community of developers, for example by opening an issue.

### Tests

Tests are placed in the `test` directory and use the [doctest](https://github.com/onqtam/doctest) library. 

It is recommended to add new test whenever you contribute a new functionality/feature.
Also if your contribution is a bugfix then consider adding this case to the test-suite.

### Push

At the end, push your changes to the remote branch

    git push my_fork feature/the_fastest_sampling_algo_ever

or if your local branch is tracking the remote one, just

    git push

## Pull request (the joy of sharing)

After pushing your work you should be able to see it on `GitHub`.

Click "Compare and pull request" button or the "New pull request" button.

Add title and description

![RP](https://user-images.githubusercontent.com/3660366/72349397-21298000-36e5-11ea-9932-c8759c34ab2f.png)

and click the "Create pull request" button.

## Review (ok this is not an exam)

After creating a pull request your code will be reviewed. You can propose one or more reviewers 
by clicking on the "Reviewers" button

![reviewer](https://user-images.githubusercontent.com/3660366/72349476-44ecc600-36e5-11ea-81cd-d0938d923529.png)

If there are no objections your changes will be merged. 
Otherwise you'll see some comments under the pull request and/or under specific lines of your code.
Then you have to make the required changes, commit them and push to your branch. 
Those changes will automatically be a part of the same pull request. This procedure will be repeated until the code 
is ready for merging.

If you're curious how it looks like you may see one of the open or closed 
[pull requests](https://github.com/GeomScale/volume_approximation/pulls).
back to top