From 1f62f3d27e26638e89996fb128203b5e132d7a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Holzm=C3=BCller?= Date: Wed, 31 Mar 2021 10:58:09 +0200 Subject: [PATCH] added more precise requirements in the README file, updated relative paths in the python files --- README.md | 10 ++++++---- test/surf_plot.py | 4 ++-- test/tex_line_plot.py | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index ec9ceef..1ba8982 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -This is a header-only library providing a fast matrix-vector product and linear system solver for tensor product matrices with a downward-closed index set restriction. This can especially be applied to compute interpolation coefficients for a sparse grid basis or evaluate a sparse interpolant at sparse grid points. The library code is located in the src folder. +This is a header-only library providing a fast matrix-vector product and linear system solver for tensor product matrices with a downward-closed index set restriction. It can especially be applied to compute interpolation coefficients for a sparse grid basis or evaluate a sparse interpolant at sparse grid points. The library code is located in the src folder. The fast_sparse_interpolation library is published under an Apache 2.0 license. If you use this project for research purposes, please cite the following publication which describes the mathematical background: -- David Holzmüller, Dirk Pflüger: Fast Sparse Grid Operations using the Unidirectional Principle: A Generalized and Unified Framework (currently submitted). +- David Holzmüller and Dirk Pflüger. Fast Sparse Grid Operations using the Unidirectional Principle: A Generalized and Unified Framework. Sparse Grids and Applications - Munich 2018 (to appear in 2021). The essential ideas behind the algorithm were first proposed in: -- Gustavo Avila and Tucker Carrington Jr.: A multi-dimensional Smolyak collocation method in curvilinear coordinates for computing vibrational spectra (2015). +- Gustavo Avila and Tucker Carrington Jr. A multi-dimensional Smolyak collocation method in curvilinear coordinates for computing vibrational spectra (2015). -Example code for usage can be found in test/main.cpp. This file can be compiled by executing the top-level Makefile (make debug / make release). This Makefile executes cmake on CMakeLists.txt to generate a Makefile in the build folder, which is then automatically executed using make to compile the executable test code. The test folder also contains code for performance measurement and plotting of performance data, which we used for our 2019 paper. +Example code for usage can be found in test/main.cpp. This file can be compiled by executing the top-level Makefile (make debug / make release). This Makefile executes cmake on CMakeLists.txt to generate a Makefile in the build folder, which is then automatically executed using make to compile the executable test code. The test folder also contains code for performance measurement and plotting of performance data, which we used for our paper. + +The C++ code requires the `boost` library and the python code requires the `numpy` and `matplotlib` libraries. The code has been tested on Ubuntu 20.10 with gcc 10.2.0, cmake 3.16.3, boost 1.71.0, Python 3.8.6, numpy 1.18.5 and matplotlib 3.2.2. It should be relative flexible with respect to software versions and operating systems, however. The resulting test and plotting code can be executed from the command line using the top-level folder as a working directory via `./build/fsi-test`, `python3 test/tex_line_plot.py` and `python3 test/surf_plot.py`. All functions and classes lie inside the namespace fsi (short for fast_sparse_interpolation). The basic structure is as follows: - The class MultiDimVector stores vectors indexed by multi-indices. diff --git a/test/surf_plot.py b/test/surf_plot.py index 41edef8..cccc1a3 100644 --- a/test/surf_plot.py +++ b/test/surf_plot.py @@ -14,10 +14,10 @@ def readFromFile(filename): file.close() return result -datastr = readFromFile("../performance_data.csv") +datastr = readFromFile("performance_data.csv") rows = datastr.split("\n")[:-1] values = np.array([[float(s) for s in r.split(', ')] for r in rows]) -# print(values) +#print(values) dimensions = values[:, 0] bounds = values[:, 1] diff --git a/test/tex_line_plot.py b/test/tex_line_plot.py index 906da59..9812ba2 100644 --- a/test/tex_line_plot.py +++ b/test/tex_line_plot.py @@ -16,7 +16,7 @@ def writeToFile(filename, content): file.write(content) file.close() -datastr = readFromFile("../performance_data.csv") +datastr = readFromFile("performance_data.csv") rows = datastr.split("\n")[:-1] values = [[s for s in r.split(', ')] for r in rows] @@ -29,5 +29,5 @@ for d in dimensions: lines = ['({}, {})'.format(r[2], r[3]) for r in values if int(r[0]) == d] tex_str += '\\addplot coordinates {\n' + '\n'.join(lines) + '};\n\\addlegendentry{$d = ' + str(d) + '$}\n' -tex_str = readFromFile('tex_head.txt') + tex_str + readFromFile('tex_tail.txt') +tex_str = readFromFile('test/tex_head.txt') + tex_str + readFromFile('test/tex_tail.txt') writeToFile('runtime_plot.tex', tex_str)