A library to build Subdividable Linear Equi-spaced Efficient Function Enclosures (SLEEFE)
This repository contains the source code and documentation files for
the library SLEEFE
. This library offers functionality to build tight
lower and upper piecewise-linear envelopes for the graph of univariate
polynomial functions in Bernstein-Bézier form. The picture below
illustrates a sleefe for a univariate polynomial function of degree 3.
The Bernstein-Bézier coefficients of the function are 3
, -2
, -1
,
and 0.5
. The lower and upper envelopes of the sleefe have three
line segments (i.e., four breakpoints) each.
The source code is organized as follows:
bin
- subdirectory where the executablesleefe-demo
will be installeddoc
- subdirectory whereDoxygen
documentation files areide
- subdirectory where ready-to-use project files for Visual Studio, Visual Code, and Xcode areinclude
- subdirectory where header files of the library will be installedlib
- subdirectory where the lib file of the library will be installedplots
- subdirectory containing plots of the anti-difference functionssrc
- subdirectory containing the library, demo, and uni tests source filestst
- subdirectory where the executablesleefe-tst
will be installedCMakeLists.txt
- input file for theCMake
build systemLICENSE.md
- copyright and license fileREADME.md
- this file
Detailed documentation on how to use the library can be found in the file refman.pdf
inside the directory doc
You will need CMake
3.15 or higher and a C++ compiler that supports
C++ 17 to build the library, the demo, and (optionally) the unit
tests. If you enable the generation of unit tests, then CMake
will
try to download and install the GTest library from
here. Both options have
successfully been built with CMake
version 3.22.1 on Linux (Ubuntu
22.04 LTS with GNU g++ 11.2.0), Windows 10 (MS Visual Studio 17), and
macOS Monterrey version 12.6.2 (clang version 14.0.0).
If you wish `CMake' to create an Xcode project, then 2 above should be
- Run
cmake -G Xcode -S . -B build
If you prefer not to use CMake
to install the library, you can
try the ready-to-use projects in directory ide
. There are
ready-to-use projects for Visual Studio (Windows), XCode (macOSX), and
Linux (Visual Code). In all cases, the paths are relative. So, do
not move these projects out of directory ide
nor did move their
files around. During the build, the projects will place the library
file and the executable demo file in the directories lib
and bin
,
respectively, using the relative paths.
To build and install the library, follow the steps below:
- Download or clone the code, and then enter the directory
SLEEFE
- Run
cmake -S . -B build
- Run
cmake --build build --config Release
- Run
cmake --install build --prefix <full path to your SLEEFE directory>
If all goes well, then you should see the executable sleefe-demo
(or sleefe-demo.exe
on Windows
) in subdirectory bin
and the library libslefe.a
(or slefe.lib
on
Windows
) in subdirectory lib
.
If you wish to build the unit tests, then execute the steps above with the following change to step 2:
- Run
cmake -S . -B build -D BUILD_UNIT_TESTS=ON
If all goes well, then you should see the application sleefe-tst
(or sleefe-tst.exe
on Windows) in subdirectory tst
.
Likewise, if you wish to build Doxygen
documentation files, then execute the
same steps above with the following change to step 2:
- Run
cmake -S . -B build -D BUILD_DOC=ON
or
- Run
cmake -S . -B build -D BUILD_UNIT_TESTS=ON -D BUILD_DOC=ON
Documentation is generated only if CMake
can find Doxygen
in your system. If
this is the case and the build succeeds, then the documentation files are placed
in subdirectory doc
.
If you wish `CMake' to create a Visual Studio project, then step 2 above should be
- Run
cmake -G "Visual Studio 15 2017" -A x64 -S . -B build
The exact generator depends on the version of your Visual Studio. Please, refer to the CMake documentation to determine which one is right for you.
-
Lutterkort, D., Envelopes for Nonlinear Geometry, PhD thesis, Purdue University, May 2000.
-
Lutterkort, D. and Peters, J., Linear envelopes for uniform B-spline curves, Curves and Surface Fitting, Saint-Malo, France, July 1-7, 1999, p. 239-246.
-
Lutterkort, D. and Peters, J., Optimized refinable enclosures of multivariate polynomial pieces, CAGD, 18(9), 2001, p. 851-863.
-
Wu, X. and Peters, J., On the Optimality of Piecewise Linear Max-norm Enclosures based on Slefes, Curves and Surface Design, Saint-Malo, France, 2002, p. 335-344.
If you run into trouble compiling or using the library, please email me at:
Have fun!
Marcelo Siqueira