Skip to content

Commit e35c1d2

Browse files
author
Luca Geretti
authored
Merge output-gnuplot#441
Add Gnuplot output functionality
2 parents cd4129f + eb47595 commit e35c1d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3522
-524
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- name: Set Up Dependencies
2020
run: |
21-
sudo apt install -y cmake ninja-build pkg-config lcov g++-10 libcairo2-dev libmpfr-dev python3-pip python3-dev
21+
sudo apt install -y cmake ninja-build pkg-config lcov g++-10 libcairo2-dev gnuplot libmpfr-dev python3-pip python3-dev gnuplot
2222
sudo pip3 install coverage pytest
2323
2424
- name: Create Build Environment

.github/workflows/debug.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- name: Set Up macOS Dependencies
4848
if: runner.os == 'macOS'
4949
run: |
50-
brew install ninja gcc@10 python3 mpfr cairo
50+
brew install ninja gcc@10 python3 mpfr cairo gnuplot
5151
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
5252
sudo easy_install pip
5353
sudo pip3 install --upgrade pip
@@ -56,7 +56,7 @@ jobs:
5656
- name: Set Up Linux Dependencies
5757
if: runner.os == 'Linux'
5858
run: |
59-
sudo apt install -y cmake ninja-build pkg-config clang-11 libcairo2-dev libmpfr-dev python3-pip python3-dev
59+
sudo apt install -y cmake ninja-build pkg-config clang-11 libcairo2-dev gnuplot libmpfr-dev python3-pip python3-dev
6060
sudo pip3 install pytest
6161
6262
- name: Create Build Environment

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ jobs:
5252
- name: Set Up macOS Dependencies
5353
if: runner.os == 'macOS'
5454
run: |
55-
brew install ninja gcc@10 python3 mpfr cairo
55+
brew install ninja gcc@10 python3 mpfr cairo gnuplot
5656
export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig
5757
5858
- name: Set Up Linux Dependencies
5959
if: runner.os == 'Linux'
6060
run: |
61-
sudo apt install -y cmake ninja-build pkg-config clang-11 g++-10 libcairo2-dev libmpfr-dev python3-pip python3-dev
61+
sudo apt install -y cmake ninja-build pkg-config clang-11 g++-10 libcairo2-dev gnuplot libmpfr-dev python3-pip python3-dev
6262
6363
- name: Create Build Environment
6464
run: cmake -E make_directory ${{runner.workspace}}/build

CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,21 @@ else()
118118
message(WARNING "Unable to find Cairo. You will not be able to use graphics.")
119119
endif()
120120

121-
configure_file(${PROJECT_SOURCE_DIR}/cmake/config.hpp.cmake ${PROJECT_SOURCE_DIR}/source/config.hpp)
122-
123-
include_directories(${PROJECT_SOURCE_DIR}/source)
121+
find_package(Gnuplot 5.2.8)
122+
if(GNUPLOT_FOUND)
123+
set(HAVE_GNUPLOT_H ON)
124+
else()
125+
message(WARNING "Unable to find GNUPLOT 5.2.8. You will not be able to use GNUPLOT.")
126+
set(HAVE_GNUPLOT_H OFF)
127+
endif()
124128

125129
add_custom_target(everything)
126130
add_custom_target(tests)
127131

132+
configure_file(${PROJECT_SOURCE_DIR}/cmake/config.hpp.cmake ${PROJECT_SOURCE_DIR}/source/config.hpp)
133+
134+
include_directories(${PROJECT_SOURCE_DIR}/source)
135+
128136
add_subdirectory(source)
129137
add_subdirectory(python)
130138

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Official packages are available for Ubuntu derivatives and macOS, but if your ar
1414

1515
### Official packages
1616

17-
Supplied packages are published using the official Launchpad platform for Ubuntu, and a custom Homebrew tap repository for macOS. Packages simply require all the dependencies, namely: MPFR, Cairo and Python 3.
17+
Supplied packages are published using the official Launchpad platform for Ubuntu, and a custom Homebrew tap repository for macOS. Packages simply require all the dependencies, namely: MPFR, Cairo, Gnuplot and Python 3.
1818

1919
#### Ubuntu
2020

@@ -44,7 +44,7 @@ which in one line both sets up the "tap" for Ariadne and installs the package al
4444

4545
### Dependencies
4646

47-
If installed from sources, the only required library dependency is MPFR. To enable the graphical output you will require Cairo in order to save into png files. Finally, the Python bindings require the Python headers (version 3 is only supported, since version 2 is discontinued). In particular for Python, there is an internal Git submodule dependency on the header-only [pybind11](https://github.com/pybind/pybind11) library. Therefore in order to build the Python interface, Git must be installed even if Ariadne has been downloaded as an archive. Download of the dependency is automatic though.
47+
If installed from sources, the only required library dependency is MPFR. To enable the graphical output you will require either Cairo or Gnuplot in order to save into png files. Finally, the Python bindings require the Python headers (version 3 is only supported, since version 2 is discontinued). In particular for Python, there is an internal Git submodule dependency on the header-only [pybind11](https://github.com/pybind/pybind11) library. Therefore in order to build the Python interface, Git must be installed even if Ariadne has been downloaded as an archive. Download of the dependency is automatic though.
4848

4949
Finally, if you want to build the documentation, you need Doxygen and a working Latex distribution (including the Math packages).
5050

@@ -54,15 +54,15 @@ Specific instructions for Ubuntu and macOS follow, starting from installation fr
5454

5555
#### Ubuntu
5656

57-
Aptitude packages: `cmake pkg-config git libmpfr-dev libcairo2-dev` and either `clang-11` or `g++-10` for the compiler toolchain.
57+
Aptitude packages: `cmake pkg-config git libmpfr-dev libcairo2-dev gnuplot` and either `clang-11` or `g++-10` for the compiler toolchain.
5858

5959
Additional package required for the Python interface: `python3-dev`.
6060

6161
Additional packages required for documentation: `doxygen doxygen-latex`
6262

6363
#### macOS
6464

65-
Homebrew packages: `cmake git mpfr cairo` and `gcc@10` if using GCC.
65+
Homebrew packages: `cmake git mpfr cairo gnuplot` and `gcc@10` if using GCC.
6666

6767
For Cairo support, you may need to set up a permanent variable for the path of pkgconfig by adding the following line in your `~\.bash_profile`:
6868

cmake/config.hpp.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
#cmakedefine ARIADNE_ENABLE_STACK_TRACE
1414

1515
#cmakedefine HAVE_CAIRO_H
16+
#cmakedefine HAVE_GNUPLOT_H
1617

1718
#endif /* ARIADNE_CONFIG_HPP */

examples/continuous/noisy/noisy-utilities.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void run_noisy_system(String name, const DottedRealAssignments& dynamics, const
119119
ThresholdSweeperDP sweeper(DoublePrecision(),sw_threshold);
120120

121121
bool draw = false;
122-
DRAWING_METHOD = DrawingMethod::AFFINE;
123122

124123
List<InputApproximation> approximations;
125124
approximations.append(ZeroApproximation());

examples/hybrid/heating.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ Int main(Int argc, const char* argv[])
135135

136136

137137
// Set colours for drawing
138-
DRAWING_METHOD = DrawingMethod::AFFINE;
139-
DRAWING_ACCURACY += 1;
140-
141138
Colour guard_colour(0.5,0.5,0.5);
142139
Colour midnight_guard_colour(0.75,0.75,0.75);
143140
Colour picard_orbit_colour(0.0,1.0,1.0);

experimental/examples/continuous/noisy/noisy-utilities.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void run_noisy_system(String name, const DottedRealAssignments& dynamics, const
119119
ThresholdSweeperDP sweeper(DoublePrecision(),sw_threshold);
120120

121121
bool draw = true;
122-
DRAWING_METHOD = DrawingMethod::AFFINE;
123122

124123
List<InputApproximation> approximations;
125124
approximations.append(ZeroApproximation());

python/source/evolution_submodule.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace Ariadne;
3838
template<class ORB>
3939
Void export_orbit(pybind11::module& module, const char* name)
4040
{
41-
pybind11::class_<ORB,pybind11::bases<LabelledDrawableInterface>> orbit_class(module,name);
41+
pybind11::class_<ORB,pybind11::bases<LabelledDrawable2dInterface>> orbit_class(module,name);
4242
orbit_class.def("reach", &ORB::reach);
4343
orbit_class.def("evolve", &ORB::final);
4444
orbit_class.def("final", &ORB::final);
@@ -65,10 +65,10 @@ template<> Void export_simulator<VectorFieldSimulator>(pybind11::module& module,
6565

6666
auto const& reference_internal = pybind11::return_value_policy::reference_internal;
6767

68-
pybind11::class_<LabelledDrawableInterface> labelled_drawable_interface_class(module,"LabelledDrawableInterface");
69-
pybind11::class_<LabelledInterpolatedCurve,pybind11::bases<LabelledDrawableInterface>> labelled_interpolated_curve_class(module,"LabelledInterpolatedCurve");
68+
pybind11::class_<LabelledDrawable2dInterface> labelled_drawable_interface_class(module,"LabelledDrawable2dInterface");
69+
pybind11::class_<LabelledInterpolatedCurve,pybind11::bases<LabelledDrawable2dInterface>> labelled_interpolated_curve_class(module,"LabelledInterpolatedCurve");
7070

71-
pybind11::class_<OrbitType,pybind11::bases<LabelledDrawableInterface>> simulator_orbit_class(module,"ApproximatePointOrbit");
71+
pybind11::class_<OrbitType,pybind11::bases<LabelledDrawable2dInterface>> simulator_orbit_class(module,"ApproximatePointOrbit");
7272
simulator_orbit_class.def("curve", &OrbitType::curve);
7373

7474
pybind11::class_<VectorFieldSimulator> simulator_class(module,name);
@@ -125,7 +125,7 @@ Void export_vector_field_evolver_configuration(pybind11::module& module) {
125125
}
126126

127127
Void export_labelled_storage(pybind11::module& module) {
128-
pybind11::class_<LabelledStorage,pybind11::bases<LabelledDrawableInterface>> labelled_storage_class(module,"LabelledStorage");
128+
pybind11::class_<LabelledStorage,pybind11::bases<LabelledDrawable2dInterface>> labelled_storage_class(module,"LabelledStorage");
129129
}
130130

131131
template<class RA> Void export_safety_certificate(pybind11::module& module, const char* name) {

0 commit comments

Comments
 (0)