Update CGAL to 5.1
parent
821285de82
commit
5b7c9dbc44
31
.travis.yml
31
.travis.yml
|
@ -9,7 +9,7 @@ language: cpp
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
dist: trusty
|
dist: xenial
|
||||||
sudo: required
|
sudo: required
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
addons:
|
addons:
|
||||||
|
@ -21,31 +21,26 @@ matrix:
|
||||||
osx_image: xcode9.3
|
osx_image: xcode9.3
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# (Mac) Install CGAL
|
|
||||||
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
|
|
||||||
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew upgrade --verbose boost --without-single --without-static; fi
|
|
||||||
#- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose cgal; fi
|
|
||||||
|
|
||||||
# (Linux) Prepare build environment
|
# (Linux) Prepare build environment
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:beineri/opt-qt591-trusty; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository --yes ppa:beineri/opt-qt591-xenial; fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
|
||||||
#- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gcc-4.9 g++-4.9; fi
|
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install cmake; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt install cmake; fi
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libgl-dev; fi
|
||||||
|
|
||||||
# (Linux) Install CGAL
|
# (Linux) Install CGAL
|
||||||
# (Linux) First install a maybe old version CGAL to resolve dependencies
|
# (Linux) First install a maybe old version CGAL to resolve dependencies
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install libcgal-dev; fi
|
||||||
|
|
||||||
# (Linux) Build CGAL from source
|
# (Linux) Build CGAL from source
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.13/CGAL-4.13.zip; fi
|
- wget https://github.com/CGAL/cgal/releases/download/releases/CGAL-5.1/CGAL-5.1.zip
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then unzip CGAL-4.13.zip; fi
|
- unzip CGAL-5.1.zip
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd CGAL-4.13; fi
|
- cd CGAL-5.1
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then mkdir build; fi
|
- mkdir build
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd build; fi
|
- cd build
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake ../; fi
|
- cmake ../
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make; fi
|
- make
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo make install; fi
|
- sudo make install
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd ../../; fi
|
- cd "$TRAVIS_BUILD_DIR"
|
||||||
|
|
||||||
# Build Instant-Meshes from source
|
# Build Instant-Meshes from source
|
||||||
- cd thirdparty/instant-meshes
|
- cd thirdparty/instant-meshes
|
||||||
|
@ -53,7 +48,7 @@ install:
|
||||||
- cd build
|
- cd build
|
||||||
- cmake ../
|
- cmake ../
|
||||||
- make -j 4
|
- make -j 4
|
||||||
- cd ../../../
|
- cd "$TRAVIS_BUILD_DIR"
|
||||||
|
|
||||||
# (Mac) Install Qt5
|
# (Mac) Install Qt5
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt; fi
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then HOMEBREW_VERBOSE_USING_DOTS=1 brew reinstall --verbose qt; fi
|
||||||
|
|
40
appveyor.yml
40
appveyor.yml
|
@ -13,28 +13,18 @@ environment:
|
||||||
sysdirname: system32
|
sysdirname: system32
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
CGAL-4.13-Setup.exe -> appveyor.yml
|
CGAL-5.1-Setup.exe -> appveyor.yml
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
|
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
|
||||||
- if not exist CGAL-4.13-Setup.exe
|
|
||||||
appveyor DownloadFile https://github.com/CGAL/cgal/releases/download/releases/CGAL-4.13/CGAL-4.13-Setup.exe -FileName CGAL-4.13-Setup.exe
|
- if not exist CGAL-5.1-Setup.exe
|
||||||
- if "%PLATFORM%" == "x64"
|
appveyor DownloadFile https://github.com/CGAL/cgal/releases/download/releases/CGAL-5.1/CGAL-5.1-Setup.exe -FileName CGAL-5.1-Setup.exe
|
||||||
cd thirdparty/cgal/CGAL-4.13
|
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
CGAL-4.13-Setup.exe /S /D=%APPVEYOR_BUILD_FOLDER%\CGAL-4.13
|
CGAL-5.1-Setup.exe /S /D=%APPVEYOR_BUILD_FOLDER%\CGAL-5.1
|
||||||
- if "%PLATFORM%" == "x86"
|
|
||||||
cd CGAL-4.13
|
|
||||||
- mkdir build
|
|
||||||
- cd build
|
|
||||||
- if "%PLATFORM%" == "x64"
|
|
||||||
cmake -G "Visual Studio 15 2017" -A %PLATFORM% ../ -DBOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0
|
|
||||||
- if "%PLATFORM%" == "x86"
|
|
||||||
cmake -G "Visual Studio 15 2017" ../ -DBOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0
|
|
||||||
- msbuild /p:Configuration=Release ALL_BUILD.vcxproj
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
|
|
||||||
- cd thirdparty/instant-meshes
|
- cd thirdparty/instant-meshes
|
||||||
|
@ -53,16 +43,16 @@ test_script:
|
||||||
- set PATH=%PATH%;%QTDIR%\bin
|
- set PATH=%PATH%;%QTDIR%\bin
|
||||||
|
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-4.13"
|
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-5.1"
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\CGAL-4.13"
|
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\CGAL-5.1"
|
||||||
- nmake -f Makefile.Release
|
- nmake -f Makefile.Release
|
||||||
|
|
||||||
- cd lib
|
- cd lib
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-4.13"
|
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-5.1"
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\CGAL-4.13"
|
qmake "BOOST_INCLUDEDIR=C:\Libraries\boost_1_66_0" "CGAL_DIR=%APPVEYOR_BUILD_FOLDER%\CGAL-5.1"
|
||||||
- nmake -f Makefile.Release
|
- nmake -f Makefile.Release
|
||||||
|
|
||||||
- cd %APPVEYOR_BUILD_FOLDER%
|
- cd %APPVEYOR_BUILD_FOLDER%
|
||||||
|
@ -92,17 +82,13 @@ after_test:
|
||||||
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\instant-meshes\build\ext_build\tbb\RelWithDebInfo\tbb.pdb
|
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\instant-meshes\build\ext_build\tbb\RelWithDebInfo\tbb.pdb
|
||||||
- 7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\instant-meshes\build\ext_build\tbb\RelWithDebInfo\tbb.dll
|
- 7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\instant-meshes\build\ext_build\tbb\RelWithDebInfo\tbb.dll
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-4.13\build\bin\Release\CGAL-vc140-mt-4.13.dll
|
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-5.1\auxiliary\gmp\lib\libgmp-10.dll
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
7z a dust3d-%TAG%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.13\build\bin\Release\CGAL-vc140-mt-4.13.dll
|
7z a dust3d-%TAG%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-5.1\auxiliary\gmp\lib\libgmp-10.dll
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-4.13\auxiliary\gmp\lib\libgmp-10.dll
|
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-5.1\auxiliary\gmp\lib\libmpfr-4.dll
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
7z a dust3d-%TAG%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.13\auxiliary\gmp\lib\libgmp-10.dll
|
7z a dust3d-%TAG%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-5.1\auxiliary\gmp\lib\libmpfr-4.dll
|
||||||
- if "%PLATFORM%" == "x64"
|
|
||||||
7z a %RELEASE_FILENAME% %APPVEYOR_BUILD_FOLDER%\thirdparty\cgal\CGAL-4.13\auxiliary\gmp\lib\libmpfr-4.dll
|
|
||||||
- if "%PLATFORM%" == "x86"
|
|
||||||
7z a dust3d-%TAG%-%PLATFORM%.zip %APPVEYOR_BUILD_FOLDER%\CGAL-4.13\auxiliary\gmp\lib\libmpfr-4.dll
|
|
||||||
- if "%PLATFORM%" == "x64"
|
- if "%PLATFORM%" == "x64"
|
||||||
7z a %RELEASE_FILENAME% C:\OpenSSL-v111-Win64\bin\libcrypto-1_1-x64.dll
|
7z a %RELEASE_FILENAME% C:\OpenSSL-v111-Win64\bin\libcrypto-1_1-x64.dll
|
||||||
- if "%PLATFORM%" == "x86"
|
- if "%PLATFORM%" == "x86"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,208 +0,0 @@
|
||||||
INTRODUCTION
|
|
||||||
============
|
|
||||||
|
|
||||||
This file describes how to install CGAL. The instructions in this file
|
|
||||||
are for the most common use cases, and cover the command line tools.
|
|
||||||
|
|
||||||
For further information, or in case of problems, please see the
|
|
||||||
detailed installation instructions, which can be found in this
|
|
||||||
distribution in the file ./doc_html/index.html or on the CGAL website
|
|
||||||
https://doc.cgal.org/latest/Manual/installation.html
|
|
||||||
|
|
||||||
The documentation of CGAL is available in PDF and HTML formats.
|
|
||||||
It is not bundled with the software but can be downloaded separately
|
|
||||||
at <https://www.cgal.org/Manual>.
|
|
||||||
|
|
||||||
For more information about CGAL, see the <https://www.cgal.org/>.
|
|
||||||
|
|
||||||
In the current file, x.y is an implicit replacement for the current version
|
|
||||||
of CGAL (3.5.1, 3.6, and so on).
|
|
||||||
|
|
||||||
|
|
||||||
PREREQUISITES
|
|
||||||
=============
|
|
||||||
|
|
||||||
To install CGAL, you need 'cmake' and several third-party libraries.
|
|
||||||
Some are essential for entire CGAL, some are mandatory for particular
|
|
||||||
CGAL packages, some are only needed for demos.
|
|
||||||
|
|
||||||
* CMake (>= 3.1), the build system used by CGAL
|
|
||||||
Required for building CGAL
|
|
||||||
|
|
||||||
* Boost (>= 1.48)
|
|
||||||
Required for building CGAL and for applications using CGAL
|
|
||||||
Required compiled Boost library: Boost.Thread, Boost.System
|
|
||||||
Optional compiled Boost library: Boost.Program_options
|
|
||||||
http://www.boost.org/ or http://www.boostpro.com/products/free/
|
|
||||||
You need the former if you plan to compile the boost libraries yourself,
|
|
||||||
for example because you target 64 bit applications for XP64
|
|
||||||
|
|
||||||
* Exact Arithmetic
|
|
||||||
CGAL combines floating point arithmetic with exact arithmetic, in order
|
|
||||||
to be fast and reliable. CGAL offers support for GMP and MPFR, for LEDA
|
|
||||||
exact number types, as well as a built-in exact number type used when
|
|
||||||
none of the other two is installed.
|
|
||||||
Required by several examples which have hard coded the number type.
|
|
||||||
|
|
||||||
- GMP (>= 4.1.4)
|
|
||||||
http://gmplib.org/
|
|
||||||
or precompiled version that can be downloaded with CGAL-x.y-Setup.exe
|
|
||||||
based on http://fp.gladman.plus.com/computing/gmp4win.htm
|
|
||||||
|
|
||||||
- MPFR (>= 2.2.1)
|
|
||||||
http://www.mpfr.org/
|
|
||||||
or precompiled version that can be downloaded with CGAL-x.y-Setup.exe
|
|
||||||
based on http://fp.gladman.plus.com/computing/gmp4win.htm
|
|
||||||
|
|
||||||
- LEDA (>= 6.2)
|
|
||||||
http://www.algorithmic-solutions.com/leda/index.htm
|
|
||||||
|
|
||||||
* Visualization
|
|
||||||
Required for most demos
|
|
||||||
|
|
||||||
- Qt5 (>= 5.3)
|
|
||||||
http://qt-project.org/
|
|
||||||
|
|
||||||
- Geomview
|
|
||||||
http://www.geomview.org/
|
|
||||||
Not supported with Visual C++
|
|
||||||
|
|
||||||
* Numerical Libraries
|
|
||||||
- EIGEN (>=3.1)
|
|
||||||
Required by the packages:
|
|
||||||
* Estimation of Local Differential Properties of Point-Sampled Surfaces
|
|
||||||
* Approximation of Ridges and Umbilics on Triangulated Surface Meshes
|
|
||||||
* Planar Parameterization of Triangulated Surface Meshes
|
|
||||||
* Surface Reconstruction from Point Sets
|
|
||||||
http://eigen.tuxfamily.org
|
|
||||||
|
|
||||||
- BLAS, LAPACK, ATLAS
|
|
||||||
Required by the packages (if EIGEN is not available):
|
|
||||||
* Estimation of Local Differential Properties of Point-Sampled Surfaces
|
|
||||||
* Approximation of Ridges and Umbilics on Triangulated Surface Meshes
|
|
||||||
* Planar Parameterization of Triangulated Surface Meshes
|
|
||||||
http://www.netlib.org/blas/, http://www.netlib.org/lapack/
|
|
||||||
or precompiled version that can be downloaded with CGAL-x.y-Setup.exe
|
|
||||||
|
|
||||||
- MPFI
|
|
||||||
Required by the package:
|
|
||||||
* Algebraic Kernel
|
|
||||||
https://gforge.inria.fr/projects/mpfi/
|
|
||||||
(or shipped with RS http://vegas.loria.fr/rs/)
|
|
||||||
|
|
||||||
- RS (root isolation)
|
|
||||||
Required by the package:
|
|
||||||
* Algebraic Kernel
|
|
||||||
http://vegas.loria.fr/rs/
|
|
||||||
|
|
||||||
- NTL (Number Type Theory)
|
|
||||||
Optional for the packages:
|
|
||||||
* Polynomial
|
|
||||||
* Algebraic Kernel
|
|
||||||
http://www.shoup.net/ntl/
|
|
||||||
|
|
||||||
* Miscellaneous
|
|
||||||
|
|
||||||
- zlib
|
|
||||||
Optional for the package:
|
|
||||||
* Surface Mesh Generator can read compressed images directly
|
|
||||||
http://www.zlib.net/
|
|
||||||
|
|
||||||
- ESBTL
|
|
||||||
Optional to read PDB files:
|
|
||||||
* Import data from a PDB file as CGAL points or weighted points.
|
|
||||||
An example is given in package Skin_surface (see example skin_surface_pdb_reader.cpp)
|
|
||||||
http://esbtl.sourceforge.net/
|
|
||||||
|
|
||||||
CONFIGURATION
|
|
||||||
=============
|
|
||||||
|
|
||||||
To configure CGAL, type
|
|
||||||
```
|
|
||||||
cmake .
|
|
||||||
```
|
|
||||||
in the directory that contains this INSTALL file. You can add several options
|
|
||||||
to this command. The most important ones are
|
|
||||||
|
|
||||||
* `-DCMAKE_INSTALL_PREFIX=<dir>` installation directory [/usr/local]
|
|
||||||
* `-DCMAKE_BUILD_TYPE=<Debug|Release>` build type [Release]
|
|
||||||
* `-DBUILD_SHARED_LIBS=<TRUE|FALSE>` shared or static libraries [TRUE]
|
|
||||||
* `-DCMAKE_C_COMPILER=<program>` C compiler [gcc]
|
|
||||||
* `-DCMAKE_CXX_COMPILER=<program>` C++ compiler [g++]
|
|
||||||
|
|
||||||
In case you want to add additional compiler and linker flags, you can use
|
|
||||||
|
|
||||||
* `-DCGAL_CXX_FLAGS` additional compiler flags
|
|
||||||
* `-DCGAL_MODULE_LINKER_FLAGS` add. linker flags (static libraries)
|
|
||||||
* `-DCGAL_SHARED_LINKER_FLAGS` add. linker flags (shared libraries)
|
|
||||||
* `-DCGAL_EXE_LINKER_FLAGS` add. linker flags (executables)
|
|
||||||
|
|
||||||
Variants with the additional suffix "_DEBUG" and "_RELEASE" allow to set
|
|
||||||
separate values for debug and release builds. In case you do not want to add
|
|
||||||
additional flags, but to override the default flags, replace "CGAL" by
|
|
||||||
"CMAKE" in the variable names above.
|
|
||||||
|
|
||||||
By default demos and examples are not configured. If you want to configure
|
|
||||||
them at the same time as the CGAL library, you can use
|
|
||||||
|
|
||||||
* `-DWITH_examples=true`
|
|
||||||
* `-DWITH_demos=true`
|
|
||||||
|
|
||||||
Note that CMake maintains a cache name `CMakeCache.txt`. If you change options
|
|
||||||
(or your environment changes), it is best to remove that file to avoid
|
|
||||||
problems.
|
|
||||||
|
|
||||||
|
|
||||||
BUILDING
|
|
||||||
========
|
|
||||||
|
|
||||||
To build the CGAL libraries, type
|
|
||||||
```
|
|
||||||
make
|
|
||||||
```
|
|
||||||
(or nmake in a Windows command prompt).
|
|
||||||
If you want, you can install the CGAL header and libraries. To do so, type
|
|
||||||
```
|
|
||||||
make install
|
|
||||||
```
|
|
||||||
You can build all demos or examples by typing
|
|
||||||
```
|
|
||||||
make demos
|
|
||||||
make examples
|
|
||||||
```
|
|
||||||
If you are interested in the demos or examples of just a particular module,
|
|
||||||
you can build them in the following way:
|
|
||||||
```
|
|
||||||
make -C demo/Alpha_shapes_2 (or: cd demo/Alpha_shapes_2; make)
|
|
||||||
make -C examples/Alpha_shapes_2 (or: cd examples/Alpha_shapes_2; make)
|
|
||||||
```
|
|
||||||
A list of all available make targets can be obtained by
|
|
||||||
```
|
|
||||||
make help
|
|
||||||
```
|
|
||||||
|
|
||||||
OUT-OF-SOURCE BUILDS
|
|
||||||
====================
|
|
||||||
|
|
||||||
The above instructions build the CGAL library in the same directory tree as
|
|
||||||
the CGAL sources. Sometimes it is advisable to place all the generated files
|
|
||||||
somewhere else. For example, if you want to build the library in several
|
|
||||||
configurations (debug and release, different compilers, and so on). Using
|
|
||||||
different build directories keeps all the generated files separated for each
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
In the following, `$CGAL_SRC` denotes the directory with the CGAL sources;
|
|
||||||
`$CGAL_BUILD` is an arbitrary directory where the generated files will be
|
|
||||||
placed. You can perform an out-of-source build as follows:
|
|
||||||
```
|
|
||||||
mkdir $CGAL_BUILD
|
|
||||||
cd $CGAL_BUILD
|
|
||||||
cmake [options] $CGAL_SRC
|
|
||||||
make
|
|
||||||
make install (if desired)
|
|
||||||
make demos (if desired)
|
|
||||||
make examples (if desired)
|
|
||||||
```
|
|
||||||
Basically, the only difference is the last parameter of the `cmake` command:
|
|
||||||
`$CGAL_SRC` instead of `.` .
|
|
||||||
|
|
Binary file not shown.
|
@ -1 +0,0 @@
|
||||||
4.13
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
# Copyright (c) 2011 GeometryFactory Sarl (France)
|
|
||||||
#
|
|
||||||
# This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
# modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
# published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
# or (at your option) any later version.
|
|
||||||
#
|
|
||||||
# Licensees holding a valid commercial license may use this file in
|
|
||||||
# accordance with the commercial license agreement provided with the software.
|
|
||||||
#
|
|
||||||
# This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
# WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
#
|
|
||||||
# $URL$
|
|
||||||
# $Id$
|
|
||||||
# SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
#
|
|
||||||
# Author(s) : Laurent Rineau
|
|
||||||
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import gdb
|
|
||||||
|
|
||||||
sys.path.insert(0, os.getcwd() + '/python')
|
|
||||||
|
|
||||||
import CGAL.printers
|
|
|
@ -1,63 +0,0 @@
|
||||||
// Copyright (c) 2011 GeometryFactory Sarl (France)
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Laurent Rineau
|
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Simple_cartesian.h>
|
|
||||||
#include <CGAL/Cartesian.h>
|
|
||||||
#include <CGAL/Gmpq.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
|
||||||
#include <CGAL/Circular_kernel_2.h>
|
|
||||||
#include <CGAL/Filtered_kernel.h>
|
|
||||||
|
|
||||||
typedef CGAL::Simple_cartesian<double> K;
|
|
||||||
typedef CGAL::Cartesian<double> K2;
|
|
||||||
typedef CGAL::Simple_cartesian<CGAL::Gmpq> K3;
|
|
||||||
typedef K3::RT FT3;
|
|
||||||
|
|
||||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<double> AK;
|
|
||||||
typedef CGAL::Circular_kernel_2<K, AK> CK;
|
|
||||||
|
|
||||||
typedef CGAL::Filtered_kernel<K> FK;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
K::Point_2 default_p;
|
|
||||||
K::Point_2 p(-1./3, 2.);
|
|
||||||
K::Vector_2 v = p - CGAL::ORIGIN;
|
|
||||||
K::Circle_2 c(p, 10);
|
|
||||||
|
|
||||||
K2::Point_2 p2(-1./3, 2.);
|
|
||||||
K2::Vector_2 v2 = p2 - CGAL::ORIGIN;
|
|
||||||
K2::Circle_2 c2(p2, 10);
|
|
||||||
|
|
||||||
// no correct pretty-printer for CGAL::Gmpq
|
|
||||||
K3::Point_2 p3(-3, 10);
|
|
||||||
K3::Vector_2 v3 = p3 - CGAL::ORIGIN;
|
|
||||||
|
|
||||||
CK::Point_2 p4;
|
|
||||||
CK::Vector_2 v4;
|
|
||||||
|
|
||||||
FK::Point_2 default_p5;
|
|
||||||
FK::Vector_2 default_v5;
|
|
||||||
|
|
||||||
FK::Point_2 p5(1, 2);
|
|
||||||
FK::Vector_2 v5(3, 4);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,121 +0,0 @@
|
||||||
# Find TAUCS library shipped with CGAL
|
|
||||||
#
|
|
||||||
# This module searches for TAUCS in CGAL "auxiliary" folder
|
|
||||||
# and in in $CGAL_TAUCS_DIR environment variable.
|
|
||||||
#
|
|
||||||
# This module sets the following variables:
|
|
||||||
# CGAL_TAUCS_FOUND - set to true if TAUCS library shipped with CGAL
|
|
||||||
# is found
|
|
||||||
# CGAL_TAUCS_PLATFORM - name of TAUCS subfolder corresponding to the current compiler
|
|
||||||
# CGAL_TAUCS_INCLUDE_DIR - list of folders (using full path name) containing
|
|
||||||
# TAUCS (and optionaly BLAS and LAPACK) headers
|
|
||||||
# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing
|
|
||||||
# TAUCS (and optionaly BLAS and LAPACK) libraries
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
|
||||||
|
|
||||||
if ( NOT CGAL_TAUCS_FOUND )
|
|
||||||
|
|
||||||
#
|
|
||||||
# Find out TAUCS name for the current platform.
|
|
||||||
# This code is a translation of TAUCS "configure" script.
|
|
||||||
#
|
|
||||||
|
|
||||||
# The first task is to figure out CMAKE_SYSTEM_NAME
|
|
||||||
# (on unix this is uname -s, for windows it is Windows).
|
|
||||||
#message("DEBUG: CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
|
||||||
#message("DEBUG: CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
|
||||||
set( CGAL_TAUCS_PLATFORM "${CMAKE_SYSTEM_NAME}" )
|
|
||||||
|
|
||||||
# Convert to lower case
|
|
||||||
STRING(TOLOWER "${CGAL_TAUCS_PLATFORM}" CGAL_TAUCS_PLATFORM)
|
|
||||||
|
|
||||||
# Sometimes uname returns a value that is
|
|
||||||
# inconsistent with the way CGAL_TAUCS_PLATFORM is set. For example, on
|
|
||||||
# Solaris, CGAL_TAUCS_PLATFORM=solaris but uname returns SunOS.
|
|
||||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "sunos" )
|
|
||||||
set( CGAL_TAUCS_PLATFORM "solaris" )
|
|
||||||
endif()
|
|
||||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "windows" )
|
|
||||||
set( CGAL_TAUCS_PLATFORM "win32" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# LS 2007: added "darwin_intel" for Intel Macs.
|
|
||||||
# "darwin" = original Darwin platform = PowerPC architecture.
|
|
||||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "darwin" )
|
|
||||||
# CMAKE_SYSTEM_PROCESSOR=uname -p
|
|
||||||
if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" )
|
|
||||||
set( CGAL_TAUCS_PLATFORM "darwin_intel" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# LS 2007: append "64" if 64 bits processor (tested on Linux only)
|
|
||||||
|
|
||||||
if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "linux" )
|
|
||||||
# CMAKE_SYSTEM_PROCESSOR=uname -p
|
|
||||||
if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES ".*64.*" )
|
|
||||||
set( CGAL_TAUCS_PLATFORM "${CGAL_TAUCS_PLATFORM}64" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#message("DEBUG: CGAL_TAUCS_PLATFORM = ${CGAL_TAUCS_PLATFORM}")
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Search for TAUCS folder.
|
|
||||||
#
|
|
||||||
|
|
||||||
#message("DEBUG: CGAL_INSTALLATION_PACKAGE_DIR = ${CGAL_INSTALLATION_PACKAGE_DIR}")
|
|
||||||
|
|
||||||
# VC++ uses auto-link, thus we search for a folder containing the output of
|
|
||||||
# build_taucs_win32_for_CGAL.bat/build_taucs_win64_for_CGAL.bat,
|
|
||||||
# ie TAUCS libraries compiled for all Windows runtimes.
|
|
||||||
if ( MSVC )
|
|
||||||
|
|
||||||
# Check $CGAL_TAUCS_DIR environment variable
|
|
||||||
fetch_env_var(CGAL_TAUCS_DIR)
|
|
||||||
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
|
|
||||||
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
|
|
||||||
|
|
||||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/include")
|
|
||||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib" )
|
|
||||||
set( CGAL_TAUCS_FOUND TRUE )
|
|
||||||
|
|
||||||
# Else, search for TAUCS in CGAL "auxiliary" folder
|
|
||||||
elseif ( EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include/taucs.h" AND
|
|
||||||
EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" )
|
|
||||||
|
|
||||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include")
|
|
||||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" )
|
|
||||||
set( CGAL_TAUCS_FOUND TRUE )
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# On Unix, search for TAUCS "taucs_full" folder
|
|
||||||
else ( MSVC )
|
|
||||||
|
|
||||||
# Check $CGAL_TAUCS_DIR environment variable
|
|
||||||
fetch_env_var(CGAL_TAUCS_DIR)
|
|
||||||
#message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}")
|
|
||||||
if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR})
|
|
||||||
|
|
||||||
set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}"
|
|
||||||
"${CGAL_TAUCS_DIR}/src" )
|
|
||||||
set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}"
|
|
||||||
"${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" )
|
|
||||||
set( CGAL_TAUCS_FOUND TRUE )
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif ( MSVC )
|
|
||||||
|
|
||||||
# Add variables to cache
|
|
||||||
set( CGAL_TAUCS_DIR "${CGAL_TAUCS_DIR}"
|
|
||||||
CACHE PATH "Directory containing BLAS, LAPACK and TAUCS" )
|
|
||||||
|
|
||||||
#message("DEBUG: CGAL_TAUCS_INCLUDE_DIR = ${CGAL_TAUCS_INCLUDE_DIR}")
|
|
||||||
#message("DEBUG: CGAL_TAUCS_LIBRARIES_DIR = ${CGAL_TAUCS_LIBRARIES_DIR}")
|
|
||||||
#message("DEBUG: CGAL_TAUCS_FOUND = ${CGAL_TAUCS_FOUND}")
|
|
||||||
|
|
||||||
endif ( NOT CGAL_TAUCS_FOUND )
|
|
||||||
|
|
|
@ -1,97 +0,0 @@
|
||||||
#.rst:
|
|
||||||
# CGAL_SetupBoost
|
|
||||||
# ---------------
|
|
||||||
#
|
|
||||||
# The module searchs for the `Boost` headers and library, by calling
|
|
||||||
#
|
|
||||||
# .. code-block:: cmake
|
|
||||||
#
|
|
||||||
# find_package(Boost)
|
|
||||||
#
|
|
||||||
# and defines the function :command:`use_CGAL_Boost_support`.
|
|
||||||
|
|
||||||
if ( CGAL_Boost_Setup )
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set ( CGAL_Boost_Setup TRUE )
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_TweakFindBoost.cmake)
|
|
||||||
|
|
||||||
function(CGAL_detect_if_Boost_Thread_is_required)
|
|
||||||
get_property(PROPERTY_CGAL_requires_Boost_Thread_IS_SET
|
|
||||||
GLOBAL PROPERTY CGAL_requires_Boost_Thread SET)
|
|
||||||
if(PROPERTY_CGAL_requires_Boost_Thread_IS_SET)
|
|
||||||
get_property(CGAL_requires_Boost_libs
|
|
||||||
GLOBAL PROPERTY CGAL_requires_Boost_Thread)
|
|
||||||
else()
|
|
||||||
set ( CGAL_requires_Boost_libs TRUE )
|
|
||||||
if ( DEFINED MSVC_VERSION AND "${MSVC_VERSION}" GREATER 1800)
|
|
||||||
set ( CGAL_requires_Boost_libs FALSE )
|
|
||||||
else()
|
|
||||||
try_run( CGAL_test_cpp_version_RUN_RES CGAL_test_cpp_version_COMPILE_RES
|
|
||||||
"${CMAKE_BINARY_DIR}"
|
|
||||||
"${CGAL_MODULES_DIR}/config/support/CGAL_test_cpp_version.cpp"
|
|
||||||
RUN_OUTPUT_VARIABLE CGAL_cplusplus)
|
|
||||||
message(STATUS "__cplusplus is ${CGAL_cplusplus}")
|
|
||||||
if(NOT CGAL_test_cpp_version_RUN_RES)
|
|
||||||
set ( CGAL_requires_Boost_libs FALSE )
|
|
||||||
message(STATUS " --> Do not link with Boost.Thread")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
set_property(GLOBAL PROPERTY CGAL_requires_Boost_Thread ${CGAL_requires_Boost_libs})
|
|
||||||
set(CGAL_requires_Boost_libs ${CGAL_requires_Boost_libs} PARENT_SCOPE)
|
|
||||||
endfunction(CGAL_detect_if_Boost_Thread_is_required)
|
|
||||||
|
|
||||||
CGAL_detect_if_Boost_Thread_is_required()
|
|
||||||
if (CGAL_requires_Boost_libs)
|
|
||||||
find_package( Boost 1.48 REQUIRED thread system )
|
|
||||||
else()
|
|
||||||
find_package( Boost 1.48 REQUIRED )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(Boost_FOUND)
|
|
||||||
if(DEFINED Boost_DIR AND NOT Boost_DIR)
|
|
||||||
# Unset that cache variable that is set in the cache by FindBoost
|
|
||||||
# (while it was searching for boost-cmake).
|
|
||||||
unset(Boost_DIR CACHE)
|
|
||||||
set(Boost_NO_BOOST_CMAKE TRUE CACHE INTERNAL "Avoid future search of boost-cmake")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message( STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}" )
|
|
||||||
message( STATUS "Boost libraries: ${Boost_LIBRARIES}" )
|
|
||||||
|
|
||||||
set ( CGAL_USE_BOOST 1 )
|
|
||||||
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# Provided Functions
|
|
||||||
# ^^^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# .. command:: use_CGAL_Boost_support
|
|
||||||
#
|
|
||||||
# Link the target with the `Boost` libraries::
|
|
||||||
#
|
|
||||||
# use_CGAL_Boost_support( target [INTERFACE] )
|
|
||||||
#
|
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
|
||||||
|
|
||||||
function(use_CGAL_Boost_support target)
|
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
if(NOT Boost_FOUND)
|
|
||||||
message(FATAL_ERROR "use_CGAL_Boost_support is use whereas Boost_FOUND is false.")
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
if(NOT CGAL_Boost_USE_STATIC_LIBS AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
target_compile_definitions(${target} ${keyword} BOOST_ALL_DYN_LINK=1)
|
|
||||||
endif()
|
|
||||||
target_include_directories(${target} SYSTEM ${keyword} ${Boost_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(${target} ${keyword} ${Boost_LIBRARIES})
|
|
||||||
endfunction()
|
|
|
@ -1,155 +0,0 @@
|
||||||
#.rst:
|
|
||||||
# CGAL_SetupCGALDependencies
|
|
||||||
# --------------------------
|
|
||||||
#
|
|
||||||
# The module searchs for the dependencies of the CGAL library:
|
|
||||||
# - the `GMP/MPFR` couple,
|
|
||||||
# - `LEDA` (optional)
|
|
||||||
# - the `Boost` libraries (mostly the header-only libraries)
|
|
||||||
#
|
|
||||||
# and defines the variable :variable:`CGAL_FOUND` and the function
|
|
||||||
# :command:`CGAL_setup_CGAL_dependencies`.
|
|
||||||
#
|
|
||||||
# Module Input Variables
|
|
||||||
# ^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
# .. variable:: CGAL_DISABLE_GMP
|
|
||||||
#
|
|
||||||
# If set, the `GMP` library will not be used. If
|
|
||||||
# :variable:`WITH_LEDA` is not used either, a efficient exact
|
|
||||||
# number types are used by CGAL kernels for exact computation.
|
|
||||||
#
|
|
||||||
# .. variable:: WITH_LEDA
|
|
||||||
#
|
|
||||||
# If set, the `LEDA` library will be searched and used to provide
|
|
||||||
# the exact number types used by CGAL kernels.
|
|
||||||
#
|
|
||||||
# .. variable:: CGAL_HEADER_ONLY
|
|
||||||
#
|
|
||||||
# Set this variable if you are using the CGAL libraries as
|
|
||||||
# header-only libraries.
|
|
||||||
#
|
|
||||||
if(CGAL_SetupCGALDependencies_included)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(CGAL_SetupCGALDependencies_included TRUE)
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# Used Modules
|
|
||||||
# ^^^^^^^^^^^^
|
|
||||||
# - :module:`CGAL_SetupGMP`
|
|
||||||
if(NOT CGAL_DISABLE_GMP)
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupGMP.cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# - :module:`CGAL_SetupLEDA`
|
|
||||||
if(WITH_LEDA)
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupLEDA.cmake)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# - :module:`CGAL_SetupBoost`
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupBoost.cmake)
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# Result Variables
|
|
||||||
# ^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# .. variable:: CGAL_FOUND
|
|
||||||
#
|
|
||||||
# Set to `TRUE` if the dependencies of CGAL were found.
|
|
||||||
if(Boost_FOUND)
|
|
||||||
set(CGAL_FOUND TRUE)
|
|
||||||
set_property(GLOBAL PROPERTY CGAL_FOUND TRUE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
#
|
|
||||||
# Provided Functions
|
|
||||||
# ^^^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# .. command:: CGAL_setup_CGAL_dependencies
|
|
||||||
#
|
|
||||||
# Link the target with the dependencies of CGAL::
|
|
||||||
#
|
|
||||||
# CGAL_setup_CGAL_dependencies( target [INTERFACE] )
|
|
||||||
#
|
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
|
||||||
#
|
|
||||||
function(CGAL_setup_CGAL_dependencies target)
|
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
if(NOT CGAL_DISABLE_GMP)
|
|
||||||
use_CGAL_GMP_support(${target} ${keyword})
|
|
||||||
set(CGAL_USE_GMP TRUE CACHE INTERNAL "CGAL library is configured to use GMP")
|
|
||||||
set(CGAL_USE_MPFR TRUE CACHE INTERNAL "CGAL library is configured to use MPFR")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WITH_LEDA)
|
|
||||||
use_CGAL_LEDA_support(${target} ${keyword})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (CGAL_HEADER_ONLY)
|
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_HEADER_ONLY=1)
|
|
||||||
endif()
|
|
||||||
if (RUNNING_CGAL_AUTO_TEST)
|
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_TEST_SUITE=1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
use_CGAL_Boost_support(${target} ${keyword})
|
|
||||||
|
|
||||||
foreach(dir ${CGAL_INCLUDE_DIRS})
|
|
||||||
target_include_directories(${target} ${keyword}
|
|
||||||
$<BUILD_INTERFACE:${dir}>)
|
|
||||||
endforeach()
|
|
||||||
target_include_directories(${target} ${keyword}
|
|
||||||
$<INSTALL_INTERFACE:include>)
|
|
||||||
|
|
||||||
# Now setup compilation flags
|
|
||||||
if(MSVC)
|
|
||||||
target_compile_options(${target} ${keyword}
|
|
||||||
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS"
|
|
||||||
"/fp:strict"
|
|
||||||
"/fp:except-"
|
|
||||||
"/wd4503" # Suppress warnings C4503 about "decorated name length exceeded"
|
|
||||||
"/bigobj" # Use /bigobj by default
|
|
||||||
)
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
|
||||||
message( STATUS "Using Intel Compiler. Adding -fp-model strict" )
|
|
||||||
if(WIN32)
|
|
||||||
target_compile_options(${target} ${keyword} "/fp:strict")
|
|
||||||
else()
|
|
||||||
target_compile_options(${target} ${keyword} "-fp-model" "strict")
|
|
||||||
endif()
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro")
|
|
||||||
message( STATUS "Using SunPro compiler, using STLPort 4." )
|
|
||||||
target_compile_options(${target} ${keyword}
|
|
||||||
"-features=extensions;-library=stlport4;-D_GNU_SOURCE")
|
|
||||||
target_link_libraries(${target} ${keyword} "-library=stlport4")
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
||||||
if ( RUNNING_CGAL_AUTO_TEST )
|
|
||||||
target_compile_options(${target} ${keyword} "-Wall")
|
|
||||||
endif()
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
|
||||||
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.3)
|
|
||||||
target_compile_options(${target} ${keyword} "-frounding-math")
|
|
||||||
else()
|
|
||||||
target_compile_options(${target} ${keyword} "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
|
||||||
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
|
||||||
target_compile_options(${target} ${keyword} "-fno-strict-aliasing" )
|
|
||||||
endif()
|
|
||||||
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" )
|
|
||||||
message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" )
|
|
||||||
target_compile_options(${target} ${keyword} "-mieee -mfp-rounding-mode=d" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
|
@ -1,89 +0,0 @@
|
||||||
#.rst:
|
|
||||||
# CGAL_SetupCGAL_CoreDependencies
|
|
||||||
# -------------------------------
|
|
||||||
#
|
|
||||||
# The module searchs for the dependencies of the `CGAL_Core` library:
|
|
||||||
# - the `GMP/MPFR` couple,
|
|
||||||
#
|
|
||||||
# and defines the variable :variable:`CGAL_Core_FOUND` and the function
|
|
||||||
# :command:`CGAL_setup_CGAL_Core_dependencies`.
|
|
||||||
#
|
|
||||||
# Module Input Variables
|
|
||||||
# ^^^^^^^^^^^^^^^^^^^^^^
|
|
||||||
# - :variable:`CGAL_DISABLE_GMP`
|
|
||||||
|
|
||||||
if(CGAL_SetupCGAL_CoreDependencies_included)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(CGAL_SetupCGAL_CoreDependencies_included TRUE)
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
# Used Modules
|
|
||||||
# ^^^^^^^^^^^^
|
|
||||||
# - :module:`CGAL_SetupGMP`
|
|
||||||
#
|
|
||||||
# Result Variables
|
|
||||||
# ^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# .. variable:: CGAL_Core_FOUND
|
|
||||||
#
|
|
||||||
# Set to `TRUE` if the dependencies of `CGAL_Core` were found.
|
|
||||||
|
|
||||||
if(NOT CGAL_DISABLE_GMP)
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupGMP.cmake)
|
|
||||||
if(GMP_FOUND)
|
|
||||||
set(CGAL_Core_FOUND TRUE)
|
|
||||||
set_property(GLOBAL PROPERTY CGAL_Core_FOUND TRUE)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#.rst:
|
|
||||||
#
|
|
||||||
# Provided Functions
|
|
||||||
# ^^^^^^^^^^^^^^^^^^
|
|
||||||
#
|
|
||||||
# .. command:: CGAL_setup_CGAL_Core_dependencies
|
|
||||||
#
|
|
||||||
# Link the target with the dependencies of `CGAL_Core`::
|
|
||||||
#
|
|
||||||
# CGAL_setup_CGAL_Core_dependencies( target [INTERFACE] )
|
|
||||||
#
|
|
||||||
# If the option ``INTERFACE`` is passed, the dependencies are
|
|
||||||
# added using :command:`target_link_libraries` with the ``INTERFACE``
|
|
||||||
# keyword, or ``PUBLIC`` otherwise.
|
|
||||||
#
|
|
||||||
|
|
||||||
# See the release notes of CGAL-4.10: CGAL_Core now requires
|
|
||||||
# Boost.Thread, with all compilers but MSVC.
|
|
||||||
if (NOT MSVC)
|
|
||||||
find_package( Boost 1.48 REQUIRED thread system )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
function(CGAL_setup_CGAL_Core_dependencies target)
|
|
||||||
if(ARGV1 STREQUAL INTERFACE)
|
|
||||||
set(keyword INTERFACE)
|
|
||||||
else()
|
|
||||||
set(keyword PUBLIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
use_CGAL_GMP_support(CGAL_Core ${keyword})
|
|
||||||
target_compile_definitions(${target} ${keyword} CGAL_USE_CORE=1)
|
|
||||||
target_link_libraries( CGAL_Core ${keyword} CGAL::CGAL )
|
|
||||||
|
|
||||||
# See the release notes of CGAL-4.10: CGAL_Core now requires
|
|
||||||
# Boost.Thread, with all compilers but MSVC.
|
|
||||||
if (NOT MSVC)
|
|
||||||
if(TARGET Boost::thread)
|
|
||||||
target_link_libraries( CGAL_Core ${keyword} Boost::thread)
|
|
||||||
else()
|
|
||||||
# Note that `find_package( Boost...)` must be called in the
|
|
||||||
# function `CGAL_setup_CGAL_Core_dependencies()` because the
|
|
||||||
# calling `CMakeLists.txt` may also call `find_package(Boost)`
|
|
||||||
# between the inclusion of this module, and the call to this
|
|
||||||
# function. That resets `Boost_LIBRARIES`.
|
|
||||||
find_package( Boost 1.48 REQUIRED thread system )
|
|
||||||
target_link_libraries( CGAL_Core ${keyword} ${Boost_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endfunction()
|
|
|
@ -1,101 +0,0 @@
|
||||||
# - Defines Boost_USE_STATIC_LIBS and Boost_ADDITIONAL_VERSIONS
|
|
||||||
#
|
|
||||||
# This module sets the CMake variables:
|
|
||||||
#
|
|
||||||
# == Boost_USE_STATIC_LIBS ==
|
|
||||||
#
|
|
||||||
# The option CGAL_Boost_USE_STATIC_LIBS is created in the cache, as
|
|
||||||
# advanced option. If CGALConfig.cmake has been loaded, the default value
|
|
||||||
# of that option is the value loaded from CGALConfig.cmake (this file was
|
|
||||||
# created during the configuration of CGAL libraries). Otherwise, the
|
|
||||||
# default value of that option is OFF.
|
|
||||||
#
|
|
||||||
# The variable Boost_USE_STATIC_LIBS is set to the value of the option
|
|
||||||
# CGAL_Boost_USE_STATIC_LIBS.
|
|
||||||
#
|
|
||||||
# Additionally, if Boost_USE_STATIC_LIBS is OFF, and the auto-linking is
|
|
||||||
# enabled, the definition BOOST_ALL_DYN_LINK is added to
|
|
||||||
# CGAL_3RD_PARTY_DEFINITIONS, so that the auto-linking feature on Windows
|
|
||||||
# knows that it must search for dynamic libraries.
|
|
||||||
#
|
|
||||||
# == Boost_ADDITIONAL_VERSIONS ==
|
|
||||||
#
|
|
||||||
# The variable Boost_ADDITIONAL_VERSIONS is filled with a long list of
|
|
||||||
# Boost versions. That allows the module FindBoost to find more recent
|
|
||||||
# Boost versions, even if the file FindBoost.cmake is old.
|
|
||||||
|
|
||||||
if( NOT CGAL_TweakFindBoost )
|
|
||||||
if(POLICY CMP0077)
|
|
||||||
cmake_policy(SET CMP0077 OLD)
|
|
||||||
endif()
|
|
||||||
if(DEFINED CGAL_Boost_USE_STATIC_LIBS)
|
|
||||||
# If the option is loaded from CGALConfig.h, use its value as default
|
|
||||||
# value. But the user will still have the choice to change the
|
|
||||||
# value. That means that we can build the CGAL libraries using static
|
|
||||||
# or shared Boost libraries, and after build programs using CGAL with a
|
|
||||||
# different setting for Boost libraries.
|
|
||||||
set(CGAL_Boost_USE_STATIC_LIBS_DEFAULT ${CGAL_Boost_USE_STATIC_LIBS})
|
|
||||||
else()
|
|
||||||
# Else the option is OFF by default. That means the use of shared Boost
|
|
||||||
# libraries is the default.
|
|
||||||
set(CGAL_Boost_USE_STATIC_LIBS_DEFAULT OFF)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(Boost_DEBUG "Activate the debug messages of the script FindBoost" OFF)
|
|
||||||
mark_as_advanced(Boost_DEBUG)
|
|
||||||
|
|
||||||
option(CGAL_Boost_USE_STATIC_LIBS "Link with static Boost libraries" ${CGAL_Boost_USE_STATIC_LIBS_DEFAULT})
|
|
||||||
mark_as_advanced(CGAL_Boost_USE_STATIC_LIBS)
|
|
||||||
|
|
||||||
if(CGAL_Boost_USE_STATIC_LIBS)
|
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
|
||||||
else()
|
|
||||||
set(Boost_USE_STATIC_LIBS OFF)
|
|
||||||
if(CGAL_AUTO_LINK_ENABLED)
|
|
||||||
# One must add -DBOOST_ALL_DYN_LINK to DEFINITIONS to use Boost
|
|
||||||
# auto-link with shared libraries.
|
|
||||||
|
|
||||||
list(APPEND CGAL_3RD_PARTY_DEFINITIONS -DBOOST_ALL_DYN_LINK)
|
|
||||||
set(CGAL_3RD_PARTY_DEFINITIONS "${CGAL_3RD_PARTY_DEFINITIONS}"
|
|
||||||
CACHE INTERNAL "3rd party definitions for CGAL")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(Boost_ADDITIONAL_VERSIONS
|
|
||||||
"1.69.1" "1.69.0" "1.69"
|
|
||||||
"1.68.1" "1.68.0" "1.68"
|
|
||||||
"1.67.1" "1.67.0" "1.67"
|
|
||||||
"1.66.1" "1.66.0" "1.66"
|
|
||||||
"1.65.1" "1.65.0" "1.65"
|
|
||||||
"1.64.1" "1.64.0" "1.64"
|
|
||||||
"1.63.1" "1.63.0" "1.63"
|
|
||||||
"1.62.1" "1.62.0" "1.62"
|
|
||||||
"1.61.1" "1.61.0" "1.61"
|
|
||||||
"1.60.1" "1.60.0" "1.60"
|
|
||||||
"1.59.1" "1.59.0" "1.59"
|
|
||||||
"1.58.1" "1.58.0" "1.58"
|
|
||||||
"1.57.1" "1.57.0" "1.57"
|
|
||||||
"1.56.1" "1.56.0" "1.56"
|
|
||||||
"1.55.1" "1.55.0" "1.55"
|
|
||||||
"1.54.1" "1.54.0" "1.54"
|
|
||||||
"1.53.1" "1.53.0" "1.53"
|
|
||||||
"1.52.1" "1.52.0" "1.52"
|
|
||||||
"1.51.1" "1.51.0" "1.51"
|
|
||||||
"1.50.1" "1.50.0" "1.50"
|
|
||||||
"1.49.1" "1.49.0" "1.49"
|
|
||||||
"1.48.1" "1.48.0" "1.48"
|
|
||||||
"1.47.1" "1.47.0" "1.47"
|
|
||||||
"1.46.1" "1.46.0" "1.46"
|
|
||||||
"1.45.1" "1.45.0" "1.45"
|
|
||||||
"1.44.1" "1.44.0" "1.44"
|
|
||||||
"1.43.1" "1.43.0" "1.43"
|
|
||||||
"1.42.1" "1.42.0" "1.42"
|
|
||||||
"1.41.1" "1.41.0" "1.41"
|
|
||||||
"1.40.1" "1.40.0" "1.40"
|
|
||||||
"1.39.1" "1.39.0" "1.39"
|
|
||||||
"1.38.1" "1.38.0" "1.38"
|
|
||||||
"1.37.1" "1.37.0" "1.37")
|
|
||||||
|
|
||||||
|
|
||||||
set(CGAL_TweakFindBoost)
|
|
||||||
endif()
|
|
|
@ -1,36 +0,0 @@
|
||||||
# This module setups the compiler for the BLAS libraries.
|
|
||||||
# It assumes that find_package(BLAS) was already called.
|
|
||||||
|
|
||||||
if ( BLAS_FOUND AND NOT BLAS_SETUP )
|
|
||||||
|
|
||||||
message( STATUS "UseBLAS" )
|
|
||||||
message( STATUS "BLAS include: ${BLAS_INCLUDE_DIR}" )
|
|
||||||
include_directories ( SYSTEM ${BLAS_INCLUDE_DIR} )
|
|
||||||
|
|
||||||
message( STATUS "BLAS definitions: ${BLAS_DEFINITIONS}" )
|
|
||||||
add_definitions( ${BLAS_DEFINITIONS} )
|
|
||||||
if ( "${BLAS_DEFINITIONS}" MATCHES ".*BLAS_USE_F2C.*" )
|
|
||||||
add_definitions( "-DCGAL_USE_F2C" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (BLAS_LIBRARIES_DIR)
|
|
||||||
message( STATUS "BLAS library directories: ${BLAS_LIBRARIES_DIR}" )
|
|
||||||
link_directories( ${BLAS_LIBRARIES_DIR} )
|
|
||||||
endif()
|
|
||||||
if (BLAS_LIBRARIES)
|
|
||||||
message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" )
|
|
||||||
link_libraries( ${BLAS_LIBRARIES} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message( STATUS "BLAS link flags: ${BLAS_LINKER_FLAGS}" )
|
|
||||||
if ( BUILD_SHARED_LIBS )
|
|
||||||
uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${BLAS_LINKER_FLAGS} )
|
|
||||||
else()
|
|
||||||
uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${BLAS_LINKER_FLAGS} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Setup is done
|
|
||||||
set ( BLAS_SETUP TRUE )
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
# This module setups the compiler for the LAPACK libraries.
|
|
||||||
# It assumes that find_package(LAPACK) was already called.
|
|
||||||
|
|
||||||
if ( LAPACK_FOUND AND NOT LAPACK_SETUP )
|
|
||||||
|
|
||||||
message( STATUS "UseLAPACK" )
|
|
||||||
message( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIR}" )
|
|
||||||
include_directories ( SYSTEM ${LAPACK_INCLUDE_DIR} )
|
|
||||||
|
|
||||||
message( STATUS "LAPACK definitions: ${LAPACK_DEFINITIONS}" )
|
|
||||||
add_definitions( ${LAPACK_DEFINITIONS} )
|
|
||||||
if ( "${LAPACK_DEFINITIONS}" MATCHES ".*LAPACK_USE_F2C.*" )
|
|
||||||
add_definitions( "-DCGAL_USE_F2C" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (LAPACK_LIBRARIES_DIR)
|
|
||||||
message( STATUS "LAPACK library directories: ${LAPACK_LIBRARIES_DIR}" )
|
|
||||||
link_directories( ${LAPACK_LIBRARIES_DIR} )
|
|
||||||
endif()
|
|
||||||
if (LAPACK_LIBRARIES)
|
|
||||||
message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" )
|
|
||||||
link_libraries( ${LAPACK_LIBRARIES} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message( STATUS "LAPACK link flags: ${LAPACK_LINKER_FLAGS}" )
|
|
||||||
if ( BUILD_SHARED_LIBS )
|
|
||||||
uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} )
|
|
||||||
else()
|
|
||||||
uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# LAPACK requires BLAS
|
|
||||||
include( ${BLAS_USE_FILE} )
|
|
||||||
|
|
||||||
# Setup is done
|
|
||||||
set ( LAPACK_SETUP TRUE )
|
|
||||||
|
|
||||||
add_definitions(-DCGAL_LAPACK_ENABLED)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# This module setups the compiler for the TAUCS libraries.
|
|
||||||
# It assumes that find_package(TAUCS) was already called.
|
|
||||||
|
|
||||||
if ( TAUCS_FOUND AND NOT TAUCS_SETUP )
|
|
||||||
|
|
||||||
message( STATUS "UseTAUCS" )
|
|
||||||
message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" )
|
|
||||||
include_directories ( SYSTEM ${TAUCS_INCLUDE_DIR} )
|
|
||||||
|
|
||||||
message( STATUS "TAUCS definitions: ${TAUCS_DEFINITIONS}" )
|
|
||||||
add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS" )
|
|
||||||
|
|
||||||
if (TAUCS_LIBRARIES_DIR)
|
|
||||||
message( STATUS "TAUCS library directories: ${TAUCS_LIBRARIES_DIR}" )
|
|
||||||
link_directories( ${TAUCS_LIBRARIES_DIR} )
|
|
||||||
endif()
|
|
||||||
if (TAUCS_LIBRARIES)
|
|
||||||
message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" )
|
|
||||||
link_libraries( ${TAUCS_LIBRARIES} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# TAUCS requires BLAS and LAPACK
|
|
||||||
include( ${LAPACK_USE_FILE} )
|
|
||||||
|
|
||||||
# Setup is done
|
|
||||||
set ( TAUCS_SETUP TRUE )
|
|
||||||
|
|
||||||
add_definitions(-DCGAL_TAUCS_ENABLED)
|
|
||||||
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -1,271 +0,0 @@
|
||||||
if(CGAL_add_test_included)
|
|
||||||
return()
|
|
||||||
endif(CGAL_add_test_included)
|
|
||||||
set(CGAL_add_test_included TRUE)
|
|
||||||
|
|
||||||
if(NOT POLICY CMP0064)
|
|
||||||
# CMake <= 3.3
|
|
||||||
if(BUILD_TESTING)
|
|
||||||
message(WARNING
|
|
||||||
"CGAL CTest support requires CMake 3.4 or later.\n"
|
|
||||||
"You must either disable BUILD_TESTING or upgrade CMake.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Add a fake function to avoid CMake errors
|
|
||||||
function(cgal_add_compilation_test)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
# Then return, to exit the file
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(CTest)
|
|
||||||
|
|
||||||
cmake_policy(SET CMP0064 NEW)
|
|
||||||
|
|
||||||
include(CMakeParseArguments)
|
|
||||||
|
|
||||||
option(CGAL_CTEST_DISPLAY_MEM_AND_TIME
|
|
||||||
"Display memory and real time usage at end of CTest test outputs"
|
|
||||||
FALSE)
|
|
||||||
if(CGAL_CTEST_DISPLAY_MEM_AND_TIME)
|
|
||||||
find_program(TIME time)
|
|
||||||
if(TIME)
|
|
||||||
set(TIME_COMMAND ${TIME} -f "\\nMEM: %M\\tTIME: %e\\t%C")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
set(ANDROID_DIR_PREFIX /data/local/tmp/)
|
|
||||||
find_program(adb_executable adb)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Process a list, and replace items contains a file pattern (like
|
|
||||||
# `*.off`) by the sublist that corresponds to the globbing of the
|
|
||||||
# pattern in the directory `${CGAL_CURRENT_SOURCE_DIR}`.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# For example: the `file
|
|
||||||
# test/Poisson_surface_reconstruction_3/poisson_reconstruction_test.cmd`
|
|
||||||
# contains:
|
|
||||||
#
|
|
||||||
# data/*.off data/*.xyz data/*.pwn
|
|
||||||
#
|
|
||||||
# For that file, the list `ARGS` computed in the function
|
|
||||||
# `create_single_source_cgal_program` (see below) is the list:
|
|
||||||
#
|
|
||||||
# data/*.off;data/*.xyz;data/*.pwn
|
|
||||||
#
|
|
||||||
# A call to `expand_list_with_globbing(ARGS)` replaces the list by:
|
|
||||||
#
|
|
||||||
# data/ChineseDragon-10kv.off;data/robocat_deci.off;data/sphere_20k.xyz;data/oni.pwn"
|
|
||||||
#
|
|
||||||
function(expand_list_with_globbing list_name)
|
|
||||||
set(input_list ${${list_name}})
|
|
||||||
# message(STATUS "expand_list_with_globbing(${list_name}), ${list_name} is: ${input_list}")
|
|
||||||
list(LENGTH input_list list_lenght)
|
|
||||||
math(EXPR list_last_n "${list_lenght} - 1")
|
|
||||||
set(output_list)
|
|
||||||
foreach(n RANGE ${list_last_n})
|
|
||||||
# message(STATUS "n=${n}")
|
|
||||||
list(GET input_list ${n} item_n)
|
|
||||||
# message(STATUS "argument ${n} is ${item_n}")
|
|
||||||
if(item_n MATCHES ".*\\*.*")
|
|
||||||
file(GLOB files RELATIVE ${CGAL_CURRENT_SOURCE_DIR} ${item_n})
|
|
||||||
list(APPEND output_list ${files})
|
|
||||||
else()
|
|
||||||
list(APPEND output_list ${item_n})
|
|
||||||
endif()
|
|
||||||
# message(STATUS " new value of the output list: ${output_list}")
|
|
||||||
endforeach()
|
|
||||||
set(${list_name} ${output_list} PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(cgal_add_compilation_test exe_name)
|
|
||||||
if(NOT POLICY CMP0064 OR TEST compilation_of__${exe_name})
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
add_test(NAME "compilation_of__${exe_name}"
|
|
||||||
COMMAND ${TIME_COMMAND} "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "${exe_name}")
|
|
||||||
set_property(TEST "compilation_of__${exe_name}"
|
|
||||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
|
||||||
endfunction(cgal_add_compilation_test)
|
|
||||||
|
|
||||||
function(cgal_setup_test_properties test_name)
|
|
||||||
if(ARGC GREATER 1)
|
|
||||||
set(exe_name ${ARGV1})
|
|
||||||
endif()
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
|
||||||
# message(STATUS " working dir: ${CGAL_CURRENT_SOURCE_DIR}")
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
if(exe_name)
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
APPEND PROPERTY DEPENDS "compilation_of__${exe_name}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(POLICY CMP0066) # CMake 3.7 or later
|
|
||||||
if(NOT TEST ${PROJECT_NAME}_SetupFixture)
|
|
||||||
if(ANDROID)
|
|
||||||
add_test(NAME ${PROJECT_NAME}_SetupFixture
|
|
||||||
COMMAND
|
|
||||||
${adb_executable} push
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
|
||||||
)
|
|
||||||
add_test(NAME ${PROJECT_NAME}_copy_GMP_MPFR
|
|
||||||
COMMAND
|
|
||||||
${adb_executable} push
|
|
||||||
${GMP_LIBRARIES} ${MPFR_LIBRARIES}
|
|
||||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
|
||||||
)
|
|
||||||
set_property(TEST ${PROJECT_NAME}_copy_GMP_MPFR
|
|
||||||
APPEND PROPERTY DEPENDS ${PROJECT_NAME}_SetupFixture)
|
|
||||||
set_property(TEST ${PROJECT_NAME}_copy_GMP_MPFR
|
|
||||||
PROPERTY FIXTURES_SETUP ${PROJECT_NAME})
|
|
||||||
else()
|
|
||||||
add_test(NAME ${PROJECT_NAME}_SetupFixture
|
|
||||||
COMMAND
|
|
||||||
${CMAKE_COMMAND} -E copy_directory
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
set_property(TEST ${PROJECT_NAME}_SetupFixture
|
|
||||||
PROPERTY FIXTURES_SETUP ${PROJECT_NAME})
|
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
add_test(NAME ${PROJECT_NAME}_CleanupFixture
|
|
||||||
COMMAND
|
|
||||||
${adb_executable} shell rm -rf
|
|
||||||
${ANDROID_DIR_PREFIX}${PROJECT_NAME}
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
add_test(NAME ${PROJECT_NAME}_CleanupFixture
|
|
||||||
COMMAND
|
|
||||||
${CMAKE_COMMAND} -E remove_directory
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
set_property(TEST ${PROJECT_NAME}_CleanupFixture
|
|
||||||
PROPERTY FIXTURES_CLEANUP ${PROJECT_NAME})
|
|
||||||
|
|
||||||
set_property(TEST
|
|
||||||
${PROJECT_NAME}_CleanupFixture ${PROJECT_NAME}_SetupFixture
|
|
||||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
|
||||||
endif()
|
|
||||||
if(NOT ANDROID)
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
PROPERTY
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/__exec_test_dir)
|
|
||||||
endif()
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
APPEND PROPERTY FIXTURES_REQUIRED "${PROJECT_NAME}")
|
|
||||||
if(exe_name)
|
|
||||||
set_property(TEST ${test_name}
|
|
||||||
APPEND PROPERTY FIXTURES_REQUIRED "${exe_name}")
|
|
||||||
set_property(TEST "compilation_of__${exe_name}"
|
|
||||||
PROPERTY FIXTURES_SETUP "${exe_name}")
|
|
||||||
if(ANDROID)
|
|
||||||
add_test(NAME "push_of__${exe_name}"
|
|
||||||
COMMAND ${adb_executable} push $<TARGET_FILE:${exe_name}> ${ANDROID_DIR_PREFIX}${PROJECT_NAME}/${exe_name})
|
|
||||||
set_property(TEST "push_of__${exe_name}"
|
|
||||||
APPEND PROPERTY FIXTURES_SETUP "${exe_name}")
|
|
||||||
set_property(TEST "push_of__${exe_name}"
|
|
||||||
APPEND PROPERTY DEPENDS "compilation_of__${exe_name}")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif() # end CMake 3.7 or later
|
|
||||||
endfunction(cgal_setup_test_properties)
|
|
||||||
|
|
||||||
function(cgal_add_test exe_name)
|
|
||||||
cgal_add_compilation_test(${exe_name})
|
|
||||||
|
|
||||||
cmake_parse_arguments("cgal_add_test" # prefix
|
|
||||||
"NO_EXECUTION" # optional arguments
|
|
||||||
"TEST_NAME" # single arguments
|
|
||||||
"ARGUMENTS" # multivalue arguments
|
|
||||||
${ARGN})
|
|
||||||
set(ARGS ${cgal_add_test_ARGUMENTS})
|
|
||||||
set(test_name ${cgal_add_test_TEST_NAME})
|
|
||||||
# message(" test_name: ${test_name}")
|
|
||||||
if(NOT test_name)
|
|
||||||
set(test_name "execution___of__${exe_name}")
|
|
||||||
endif()
|
|
||||||
# message(" test_name: ${test_name}")
|
|
||||||
if(cgal_add_test_NO_EXECUTION OR NOT POLICY CMP0064 OR TEST ${test_name})
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
# message("Add test ${test_name}")
|
|
||||||
set(cin_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cin")
|
|
||||||
if(NOT ARGS AND EXISTS ${cin_file})
|
|
||||||
add_test(NAME ${test_name}
|
|
||||||
COMMAND ${TIME_COMMAND} ${CMAKE_COMMAND}
|
|
||||||
-DCMD:STRING=$<TARGET_FILE:${exe_name}>
|
|
||||||
-DCIN:STRING=${cin_file}
|
|
||||||
-DANDROID_DIR_PREFIX=${ANDROID_DIR_PREFIX}
|
|
||||||
-DPROJECT_NAME=${PROJECT_NAME}
|
|
||||||
-P "${CGAL_MODULES_DIR}/run_test_with_cin.cmake")
|
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cin_file})
|
|
||||||
# message(STATUS "add test: ${exe_name} < ${cin_file}")
|
|
||||||
else()
|
|
||||||
if(NOT ARGS AND NOT cgal_add_test_TEST_NAME)
|
|
||||||
if(ARGC GREATER 2 AND ARGV2)
|
|
||||||
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV2}.cmd")
|
|
||||||
elseif(ARGC GREATER 1 AND ARGV1 AND NOT EXISTS ${cmd_file})
|
|
||||||
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV1}.cmd")
|
|
||||||
elseif(NOT EXISTS ${cmd_file})
|
|
||||||
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cmd")
|
|
||||||
endif()
|
|
||||||
if(EXISTS ${cmd_file})
|
|
||||||
file(STRINGS "${cmd_file}" CMD_LINES)
|
|
||||||
set(ARGS)
|
|
||||||
# message(STATUS "DEBUG test ${exe_name}")
|
|
||||||
foreach(CMD_LINE ${CMD_LINES})
|
|
||||||
# message(STATUS " command line: ${CMD_LINE}")
|
|
||||||
string(REGEX REPLACE "\#.*" "" CMD_LINE "${CMD_LINE}")
|
|
||||||
separate_arguments(CMD_LINE_ARGS UNIX_COMMAND ${CMD_LINE})
|
|
||||||
# message(STATUS " args: ${CMD_LINE_ARGS}")
|
|
||||||
list(APPEND ARGS ${CMD_LINE_ARGS})
|
|
||||||
endforeach()
|
|
||||||
expand_list_with_globbing(ARGS)
|
|
||||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cmd_file})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
# message(STATUS "add test: ${exe_name} ${ARGS}")
|
|
||||||
if(ANDROID)
|
|
||||||
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} ${adb_executable} shell cd ${ANDROID_DIR_PREFIX}${PROJECT_NAME} && LD_LIBRARY_PATH=${ANDROID_DIR_PREFIX}${PROJECT_NAME} ${ANDROID_DIR_PREFIX}${PROJECT_NAME}/${exe_name} ${ARGS})
|
|
||||||
else()
|
|
||||||
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} $<TARGET_FILE:${exe_name}> ${ARGS})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
cgal_setup_test_properties(${test_name} ${exe_name})
|
|
||||||
return()
|
|
||||||
|
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cin")
|
|
||||||
set(ARGS "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cin")
|
|
||||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV2}.cmd")
|
|
||||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV2}.cmd"
|
|
||||||
ARGS LIMIT_COUNT 1)
|
|
||||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV1}.cmd")
|
|
||||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV1}.cmd"
|
|
||||||
ARGS LIMIT_COUNT 1)
|
|
||||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cmd")
|
|
||||||
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cmd"
|
|
||||||
ARGS LIMIT_COUNT 1)
|
|
||||||
# TODO: handle multi-lines .cmd files
|
|
||||||
# see https://github.com/CGAL/cgal/pull/1295/files/c65d3abe17bb3e677b8077996cdaf8672f9c4c6f#r71705451
|
|
||||||
endif()
|
|
||||||
string(REPLACE ";" " " args_str "${ARGS}")
|
|
||||||
add_test(NAME ${test_name}
|
|
||||||
COMMAND ${TIME_COMMAND} $<TARGET_FILE:${exe_name}> ${ARGS}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
set_property(TEST "${test_name}"
|
|
||||||
APPEND PROPERTY LABELS "${PROJECT_NAME}")
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
function(CGAL_add_compilation_tests_for_all_targets)
|
|
||||||
endfunction()
|
|
|
@ -1,47 +0,0 @@
|
||||||
# This module install a hook (with `variable_watch()`) on CMAKE_CURRENT_LIST_DIR
|
|
||||||
#
|
|
||||||
# That uses the non-documented fact that CMAKE_CURRENT_LIST_DIR is cleared
|
|
||||||
# by CMake at the end of the configuration process. So, if the value of
|
|
||||||
# that variable gets empty, that means that CMake has reached the end of
|
|
||||||
# the configuration.
|
|
||||||
#
|
|
||||||
# See https://stackoverflow.com/a/43300621/1728537 for the starting point.
|
|
||||||
|
|
||||||
get_property(PROPERTY_CGAL_run_at_the_end_of_configuration_INCLUDED
|
|
||||||
GLOBAL PROPERTY CGAL_run_at_the_end_of_configuration_INCLUDED)
|
|
||||||
if(PROPERTY_CGAL_run_at_the_end_of_configuration_INCLUDED)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
function(CGAL_run_at_the_end_of_configuration variable access value current_list_file stack)
|
|
||||||
if(NOT access STREQUAL "MODIFIED_ACCESS" OR value)
|
|
||||||
# Only do something at the end of the CMake process, when the value of
|
|
||||||
# variable CMAKE_CURRENT_LIST_DIR is changed to the empty string.
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
# Warn when CMAKE_BUILD_TYPE is empty or Debug
|
|
||||||
if(DEFINED CMAKE_BUILD_TYPE AND ( NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug") )
|
|
||||||
set(keyword WARNING)
|
|
||||||
set(type warning)
|
|
||||||
if(RUNNING_CGAL_AUTO_TEST)
|
|
||||||
# No warning in the CMake test suite, but a status message
|
|
||||||
set(keyword)
|
|
||||||
set(type notice)
|
|
||||||
endif()
|
|
||||||
if(NOT CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE)
|
|
||||||
message(${keyword} "\
|
|
||||||
=======================================================================\n\
|
|
||||||
CGAL performance notice:\n\
|
|
||||||
The variable CMAKE_BUILD_TYPE is set to \"${CMAKE_BUILD_TYPE}\". For \
|
|
||||||
performance reasons, you should set CMAKE_BUILD_TYPE to \"Release\".\n\
|
|
||||||
Set CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE to TRUE if you want to \
|
|
||||||
disable this ${type}.\n\
|
|
||||||
=======================================================================\
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
variable_watch("CMAKE_CURRENT_LIST_DIR" CGAL_run_at_the_end_of_configuration)
|
|
||||||
|
|
||||||
set_property(GLOBAL PROPERTY CGAL_run_at_the_end_of_configuration_INCLUDED TRUE)
|
|
|
@ -1,10 +0,0 @@
|
||||||
if (CGAL_target_use_TBB_included)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(CGAL_target_use_TBB_included TRUE)
|
|
||||||
|
|
||||||
function(CGAL_target_use_TBB target)
|
|
||||||
target_include_directories ( ${target} SYSTEM PUBLIC ${TBB_INCLUDE_DIRS} )
|
|
||||||
target_link_libraries( ${target} PUBLIC ${TBB_LIBRARIES} )
|
|
||||||
target_compile_options( ${target} PUBLIC -DNOMINMAX -DCGAL_LINKED_WITH_TBB )
|
|
||||||
endfunction()
|
|
|
@ -1,498 +0,0 @@
|
||||||
# Find BLAS library
|
|
||||||
#
|
|
||||||
# This module finds an installed library that implements the BLAS
|
|
||||||
# linear-algebra interface (see http://www.netlib.org/blas/).
|
|
||||||
# The list of libraries searched for is mainly taken
|
|
||||||
# from the autoconf macro file, acx_blas.m4 (distributed at
|
|
||||||
# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
|
|
||||||
#
|
|
||||||
# This module sets the following variables:
|
|
||||||
# BLAS_FOUND - set to true if a library implementing the BLAS interface
|
|
||||||
# is found
|
|
||||||
# BLAS_INCLUDE_DIR - Directories containing the BLAS header files
|
|
||||||
# BLAS_DEFINITIONS - Compilation options to use BLAS
|
|
||||||
# BLAS_LINKER_FLAGS - Linker flags to use BLAS (excluding -l
|
|
||||||
# and -L).
|
|
||||||
# BLAS_LIBRARIES_DIR - Directories containing the BLAS libraries.
|
|
||||||
# May be null if BLAS_LIBRARIES contains libraries name using full path.
|
|
||||||
# BLAS_LIBRARIES - List of libraries to link against BLAS interface.
|
|
||||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
|
||||||
# BLAS_USE_FILE - The name of the cmake module to include to compile
|
|
||||||
# applications or libraries using BLAS.
|
|
||||||
#
|
|
||||||
# This module was modified by CGAL team:
|
|
||||||
# - find BLAS library shipped with TAUCS
|
|
||||||
# - find libraries for a C++ compiler, instead of Fortran
|
|
||||||
# - added BLAS_INCLUDE_DIR, BLAS_DEFINITIONS and BLAS_LIBRARIES_DIR
|
|
||||||
# - removed BLAS95_LIBRARIES
|
|
||||||
#
|
|
||||||
# TODO (CGAL):
|
|
||||||
# - find CBLAS (http://www.netlib.org/cblas) on Unix?
|
|
||||||
|
|
||||||
|
|
||||||
include(CheckFunctionExists)
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
|
||||||
|
|
||||||
|
|
||||||
# This macro checks for the existence of the combination of fortran libraries
|
|
||||||
# given by _list. If the combination is found, this macro checks (using the
|
|
||||||
# check_function_exists macro) whether can link against that library
|
|
||||||
# combination using the name of a routine given by _name using the linker
|
|
||||||
# flags given by _flags. If the combination of libraries is found and passes
|
|
||||||
# the link test, LIBRARIES is set to the list of complete library paths that
|
|
||||||
# have been found and DEFINITIONS to the required definitions.
|
|
||||||
# Otherwise, LIBRARIES is set to FALSE.
|
|
||||||
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
|
||||||
# are generated internally and marked advanced by this macro.
|
|
||||||
macro(check_fortran_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _path)
|
|
||||||
#message("DEBUG: check_fortran_libraries(${_list} in ${_path})")
|
|
||||||
|
|
||||||
# Check for the existence of the libraries given by _list
|
|
||||||
set(_libraries_found TRUE)
|
|
||||||
set(_libraries_work FALSE)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} "")
|
|
||||||
set(_combined_name)
|
|
||||||
foreach(_library ${_list})
|
|
||||||
set(_combined_name ${_combined_name}_${_library})
|
|
||||||
|
|
||||||
if(_libraries_found)
|
|
||||||
# search first in ${_path}
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS ${_path} NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
# if not found, search in environment variables and system
|
|
||||||
if ( WIN32 )
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS ENV LIB
|
|
||||||
)
|
|
||||||
elseif ( APPLE )
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
#message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}")
|
|
||||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
|
||||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
|
||||||
set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
|
|
||||||
endif(_libraries_found)
|
|
||||||
endforeach(_library ${_list})
|
|
||||||
if(_libraries_found)
|
|
||||||
set(_libraries_found ${${LIBRARIES}})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Test this combination of libraries with the Fortran/f2c interface.
|
|
||||||
# We test the Fortran interface first as it is well standardized.
|
|
||||||
if(_libraries_found AND NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "-D${_prefix}_USE_F2C")
|
|
||||||
set(${LIBRARIES} ${_libraries_found})
|
|
||||||
# Some C++ linkers require the f2c library to link with Fortran libraries.
|
|
||||||
# I do not know which ones, thus I just add the f2c library if it is available.
|
|
||||||
find_package( F2C QUIET )
|
|
||||||
if ( F2C_FOUND )
|
|
||||||
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
|
|
||||||
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}})
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}")
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
|
||||||
# Check if function exists with f2c calling convention (ie a trailing underscore)
|
|
||||||
check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
|
||||||
#message("DEBUG: check_function_exists(${_name}_) = ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}")
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS} "")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
|
||||||
mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
|
||||||
set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
|
|
||||||
endif(_libraries_found AND NOT _libraries_work)
|
|
||||||
|
|
||||||
# If not found, test this combination of libraries with a C interface.
|
|
||||||
# A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
|
|
||||||
if(_libraries_found AND NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} ${_libraries_found})
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}})
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
|
||||||
check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS)
|
|
||||||
#message("DEBUG: check_function_exists(${_name}) = ${${_prefix}_${_name}${_combined_name}_WORKS}")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
|
||||||
mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
|
|
||||||
set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
|
|
||||||
endif(_libraries_found AND NOT _libraries_work)
|
|
||||||
|
|
||||||
# on failure
|
|
||||||
if(NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} FALSE)
|
|
||||||
endif()
|
|
||||||
#message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
|
|
||||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
|
||||||
endmacro(check_fortran_libraries)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# main
|
|
||||||
#
|
|
||||||
|
|
||||||
# Is it already configured?
|
|
||||||
if (BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
|
||||||
|
|
||||||
set(BLAS_FOUND TRUE)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
# reset variables
|
|
||||||
set( BLAS_INCLUDE_DIR "" )
|
|
||||||
set( BLAS_DEFINITIONS "" )
|
|
||||||
set( BLAS_LINKER_FLAGS "" )
|
|
||||||
set( BLAS_LIBRARIES "" )
|
|
||||||
set( BLAS_LIBRARIES_DIR "" )
|
|
||||||
|
|
||||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
|
||||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
|
||||||
|
|
||||||
# Search for BLAS in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)...
|
|
||||||
if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
# if VC++: done
|
|
||||||
set( BLAS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" )
|
|
||||||
set( BLAS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" )
|
|
||||||
|
|
||||||
# ...else search for BLAS in $BLAS_LIB_DIR environment variable
|
|
||||||
else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Search for BLAS in possible libraries
|
|
||||||
# in $BLAS_LIB_DIR environment variable and in usual places.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read environment variables
|
|
||||||
fetch_env_var(BLAS_LIB_DIR)
|
|
||||||
fetch_env_var(MKL_LIB_DIR)
|
|
||||||
|
|
||||||
# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"cblas;f77blas;atlas"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in PhiPACK libraries? (requires generic BLAS lib, too)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"sgemm;dgemm;blas"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in Alpha CXML library?
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"cxml"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in Alpha DXML library? (now called CXML, see above)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"dxml"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in Sun Performance library?
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
"-xlic_lib=sunperf"
|
|
||||||
"sunperf;sunmath"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
if(BLAS_LIBRARIES)
|
|
||||||
# Extra linker flag
|
|
||||||
set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in SCSL library? (SGI/Cray Scientific Library)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"scsl"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in SGIMATH library?
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"complib.sgimath"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# BLAS in IBM ESSL library? (requires generic BLAS lib, too)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"essl;blas"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl 10 library?
|
|
||||||
# TODO: add shared variants
|
|
||||||
if (WIN32)
|
|
||||||
# intel mkl library? (static, 32bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
SGEMM
|
|
||||||
""
|
|
||||||
"mkl_intel_c;mkl_intel_thread;mkl_core;libiomp5md"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl library? (static, ia64 and em64t 64 bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
SGEMM
|
|
||||||
""
|
|
||||||
"mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;libiomp5md"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
else(WIN32)
|
|
||||||
# intel mkl library? (static, 32bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_intel;mkl_intel_thread;mkl_core;iomp5;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl library? (static, ia64 and em64t 64 bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;iomp5;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif (WIN32)
|
|
||||||
|
|
||||||
# older versions of intel mkl libs
|
|
||||||
|
|
||||||
# intel mkl library? (shared)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl;guide;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl library? (static, 32bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_ia32;guide;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl library? (static, ia64 64bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_ipf;guide;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# intel mkl library? (static, em64t 64bit)
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"mkl_em64t;guide;pthread"
|
|
||||||
"${MKL_LIB_DIR} ${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#BLAS in acml library?
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"acml"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Apple BLAS library?
|
|
||||||
if(NOT BLAS_LIBRARIES)
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"Accelerate"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if ( NOT BLAS_LIBRARIES )
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"vecLib"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif ( NOT BLAS_LIBRARIES )
|
|
||||||
|
|
||||||
# Generic BLAS library?
|
|
||||||
# This configuration *must* be the last try as this library is notably slow.
|
|
||||||
if ( NOT BLAS_LIBRARIES )
|
|
||||||
check_fortran_libraries(
|
|
||||||
BLAS_DEFINITIONS
|
|
||||||
BLAS_LIBRARIES
|
|
||||||
BLAS
|
|
||||||
sgemm
|
|
||||||
""
|
|
||||||
"blas"
|
|
||||||
"${BLAS_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
if(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
|
||||||
set(BLAS_FOUND TRUE)
|
|
||||||
else()
|
|
||||||
set(BLAS_FOUND FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT BLAS_FIND_QUIETLY)
|
|
||||||
if(BLAS_FOUND)
|
|
||||||
message(STATUS "A library with BLAS API found.")
|
|
||||||
else(BLAS_FOUND)
|
|
||||||
if(BLAS_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "A required library with BLAS API not found. Please specify library location.")
|
|
||||||
else()
|
|
||||||
message(STATUS "A library with BLAS API not found. Please specify library location.")
|
|
||||||
endif()
|
|
||||||
endif(BLAS_FOUND)
|
|
||||||
endif(NOT BLAS_FIND_QUIETLY)
|
|
||||||
|
|
||||||
# Add variables to cache
|
|
||||||
set( BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}"
|
|
||||||
CACHE PATH "Directories containing the BLAS header files" FORCE )
|
|
||||||
set( BLAS_DEFINITIONS "${BLAS_DEFINITIONS}"
|
|
||||||
CACHE STRING "Compilation options to use BLAS" FORCE )
|
|
||||||
set( BLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}"
|
|
||||||
CACHE STRING "Linker flags to use BLAS" FORCE )
|
|
||||||
set( BLAS_LIBRARIES "${BLAS_LIBRARIES}"
|
|
||||||
CACHE FILEPATH "BLAS libraries name" FORCE )
|
|
||||||
set( BLAS_LIBRARIES_DIR "${BLAS_LIBRARIES_DIR}"
|
|
||||||
CACHE PATH "Directories containing the BLAS libraries" FORCE )
|
|
||||||
|
|
||||||
#message("DEBUG: BLAS_INCLUDE_DIR = ${BLAS_INCLUDE_DIR}")
|
|
||||||
#message("DEBUG: BLAS_DEFINITIONS = ${BLAS_DEFINITIONS}")
|
|
||||||
#message("DEBUG: BLAS_LINKER_FLAGS = ${BLAS_LINKER_FLAGS}")
|
|
||||||
#message("DEBUG: BLAS_LIBRARIES = ${BLAS_LIBRARIES}")
|
|
||||||
#message("DEBUG: BLAS_LIBRARIES_DIR = ${BLAS_LIBRARIES_DIR}")
|
|
||||||
#message("DEBUG: BLAS_FOUND = ${BLAS_FOUND}")
|
|
||||||
|
|
||||||
endif(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES)
|
|
||||||
|
|
||||||
if(BLAS_FOUND)
|
|
||||||
set(BLAS_USE_FILE "CGAL_UseBLAS")
|
|
||||||
endif(BLAS_FOUND)
|
|
|
@ -1,324 +0,0 @@
|
||||||
# Find LAPACK library
|
|
||||||
#
|
|
||||||
# This module finds an installed library that implements the LAPACK
|
|
||||||
# linear-algebra interface (see http://www.netlib.org/lapack/).
|
|
||||||
# The approach follows mostly that taken for the autoconf macro file, acx_lapack.m4
|
|
||||||
# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
|
|
||||||
#
|
|
||||||
# This module sets the following variables:
|
|
||||||
# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
|
|
||||||
# is found
|
|
||||||
# LAPACK_INCLUDE_DIR - Directories containing the LAPACK header files
|
|
||||||
# LAPACK_DEFINITIONS - Compilation options to use LAPACK
|
|
||||||
# LAPACK_LINKER_FLAGS - Linker flags to use LAPACK (excluding -l
|
|
||||||
# and -L).
|
|
||||||
# LAPACK_LIBRARIES_DIR - Directories containing the LAPACK libraries.
|
|
||||||
# May be null if LAPACK_LIBRARIES contains libraries name using full path.
|
|
||||||
# LAPACK_LIBRARIES - List of libraries to link against LAPACK interface.
|
|
||||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
|
||||||
# LAPACK_USE_FILE - The name of the cmake module to include to compile
|
|
||||||
# applications or libraries using LAPACK.
|
|
||||||
#
|
|
||||||
# This module was modified by CGAL team:
|
|
||||||
# - find LAPACK library shipped with TAUCS
|
|
||||||
# - find libraries for a C++ compiler, instead of Fortran
|
|
||||||
# - added LAPACK_INCLUDE_DIR, LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR
|
|
||||||
# - removed LAPACK95_LIBRARIES
|
|
||||||
#
|
|
||||||
# TODO (CGAL):
|
|
||||||
# - find CLAPACK (http://www.netlib.org/clapack) on Unix?
|
|
||||||
|
|
||||||
|
|
||||||
include(CheckFunctionExists)
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake)
|
|
||||||
|
|
||||||
|
|
||||||
# This macro checks for the existence of the combination of fortran libraries
|
|
||||||
# given by _list. If the combination is found, this macro checks (using the
|
|
||||||
# check_function_exists macro) whether can link against that library
|
|
||||||
# combination using the name of a routine given by _name using the linker
|
|
||||||
# flags given by _flags. If the combination of libraries is found and passes
|
|
||||||
# the link test, LIBRARIES is set to the list of complete library paths that
|
|
||||||
# have been found and DEFINITIONS to the required definitions.
|
|
||||||
# Otherwise, LIBRARIES is set to FALSE.
|
|
||||||
# N.B. _prefix is the prefix applied to the names of all cached variables that
|
|
||||||
# are generated internally and marked advanced by this macro.
|
|
||||||
macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _blas _path)
|
|
||||||
#message("DEBUG: check_lapack_libraries(${_list} in ${_path} with ${_blas})")
|
|
||||||
|
|
||||||
# Check for the existence of the libraries given by _list
|
|
||||||
set(_libraries_found TRUE)
|
|
||||||
set(_libraries_work FALSE)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} "")
|
|
||||||
set(_combined_name)
|
|
||||||
foreach(_library ${_list})
|
|
||||||
set(_combined_name ${_combined_name}_${_library})
|
|
||||||
|
|
||||||
if(_libraries_found)
|
|
||||||
# search first in ${_path}
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS ${_path} NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
# if not found, search in environment variables and system
|
|
||||||
if ( WIN32 )
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS ENV LIB
|
|
||||||
)
|
|
||||||
elseif ( APPLE )
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
find_library(${_prefix}_${_library}_LIBRARY
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
#message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}")
|
|
||||||
mark_as_advanced(${_prefix}_${_library}_LIBRARY)
|
|
||||||
set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY})
|
|
||||||
set(_libraries_found ${${_prefix}_${_library}_LIBRARY})
|
|
||||||
endif(_libraries_found)
|
|
||||||
endforeach(_library ${_list})
|
|
||||||
if(_libraries_found)
|
|
||||||
set(_libraries_found ${${LIBRARIES}})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Test this combination of libraries with the Fortran/f2c interface.
|
|
||||||
# We test the Fortran interface first as it is well standardized.
|
|
||||||
if(_libraries_found AND NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "-D${_prefix}_USE_F2C")
|
|
||||||
set(${LIBRARIES} ${_libraries_found})
|
|
||||||
# Some C++ linkers require the f2c library to link with Fortran libraries.
|
|
||||||
# I do not know which ones, thus I just add the f2c library if it is available.
|
|
||||||
find_package( F2C QUIET )
|
|
||||||
if ( F2C_FOUND )
|
|
||||||
set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS})
|
|
||||||
set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}})
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas})
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}")
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
|
||||||
# Check if function exists with f2c calling convention (ie a trailing underscore)
|
|
||||||
check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
|
||||||
#message("DEBUG: check_function_exists(${_name}_) = ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}")
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS} "")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
|
||||||
mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS)
|
|
||||||
set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS})
|
|
||||||
endif(_libraries_found AND NOT _libraries_work)
|
|
||||||
|
|
||||||
# If not found, test this combination of libraries with a C interface.
|
|
||||||
# A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard.
|
|
||||||
if(_libraries_found AND NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} ${_libraries_found})
|
|
||||||
set(CMAKE_REQUIRED_DEFINITIONS "")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas})
|
|
||||||
#message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
|
|
||||||
check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS)
|
|
||||||
#message("DEBUG: check_function_exists(${_name}) = ${${_prefix}_${_name}${_combined_name}_WORKS}")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES "")
|
|
||||||
mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS)
|
|
||||||
set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS})
|
|
||||||
endif(_libraries_found AND NOT _libraries_work)
|
|
||||||
|
|
||||||
# on failure
|
|
||||||
if(NOT _libraries_work)
|
|
||||||
set(${DEFINITIONS} "")
|
|
||||||
set(${LIBRARIES} FALSE)
|
|
||||||
endif()
|
|
||||||
#message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}")
|
|
||||||
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
|
|
||||||
endmacro(check_lapack_libraries)
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# main
|
|
||||||
#
|
|
||||||
|
|
||||||
# LAPACK requires BLAS
|
|
||||||
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
|
|
||||||
find_package(BLAS)
|
|
||||||
else()
|
|
||||||
find_package(BLAS REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT BLAS_FOUND)
|
|
||||||
|
|
||||||
message(STATUS "LAPACK requires BLAS.")
|
|
||||||
set(LAPACK_FOUND FALSE)
|
|
||||||
|
|
||||||
# Is it already configured?
|
|
||||||
elseif (LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
|
||||||
|
|
||||||
set(LAPACK_FOUND TRUE)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
# reset variables
|
|
||||||
set( LAPACK_INCLUDE_DIR "" )
|
|
||||||
set( LAPACK_DEFINITIONS "" )
|
|
||||||
set( LAPACK_LINKER_FLAGS "" ) # unused (yet)
|
|
||||||
set( LAPACK_LIBRARIES "" )
|
|
||||||
set( LAPACK_LIBRARIES_DIR "" )
|
|
||||||
|
|
||||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
|
||||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
|
||||||
|
|
||||||
# Search for LAPACK in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)...
|
|
||||||
if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
# if VC++: done
|
|
||||||
set( LAPACK_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" )
|
|
||||||
set( LAPACK_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" )
|
|
||||||
|
|
||||||
# ...else in $LAPACK_LIB_DIR environment variable
|
|
||||||
else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Search for LAPACK in possible libraries
|
|
||||||
# in $LAPACK_LIB_DIR environment variable and in usual places.
|
|
||||||
#
|
|
||||||
|
|
||||||
# Read environment variables
|
|
||||||
fetch_env_var(LAPACK_LIB_DIR)
|
|
||||||
fetch_env_var(MKL_LIB_DIR)
|
|
||||||
|
|
||||||
#intel mkl 10 lapack?
|
|
||||||
if(NOT LAPACK_LIBRARIES)
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"mkl_core"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${MKL_LIB_DIR} ${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# older versions of intel mkl lapack?
|
|
||||||
if(NOT LAPACK_LIBRARIES)
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"mkl_lapack"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${MKL_LIB_DIR} ${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#acml lapack?
|
|
||||||
if(NOT LAPACK_LIBRARIES)
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"acml"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Apple LAPACK library?
|
|
||||||
if(NOT LAPACK_LIBRARIES)
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"Accelerate"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if ( NOT LAPACK_LIBRARIES )
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"vecLib"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif ( NOT LAPACK_LIBRARIES )
|
|
||||||
|
|
||||||
# Generic LAPACK library?
|
|
||||||
# This configuration *must* be the last try as this library is notably slow.
|
|
||||||
if ( NOT LAPACK_LIBRARIES )
|
|
||||||
check_lapack_libraries(
|
|
||||||
LAPACK_DEFINITIONS
|
|
||||||
LAPACK_LIBRARIES
|
|
||||||
LAPACK
|
|
||||||
cheev
|
|
||||||
""
|
|
||||||
"lapack"
|
|
||||||
"${BLAS_LIBRARIES}"
|
|
||||||
"${LAPACK_LIB_DIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
endif(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED)
|
|
||||||
|
|
||||||
if(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES)
|
|
||||||
set(LAPACK_FOUND TRUE)
|
|
||||||
else()
|
|
||||||
set(LAPACK_FOUND FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT LAPACK_FIND_QUIETLY)
|
|
||||||
if(LAPACK_FOUND)
|
|
||||||
message(STATUS "A library with LAPACK API found.")
|
|
||||||
else(LAPACK_FOUND)
|
|
||||||
if(LAPACK_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.")
|
|
||||||
else()
|
|
||||||
message(STATUS "A library with LAPACK API not found. Please specify library location.")
|
|
||||||
endif()
|
|
||||||
endif(LAPACK_FOUND)
|
|
||||||
endif(NOT LAPACK_FIND_QUIETLY)
|
|
||||||
|
|
||||||
# Add variables to cache
|
|
||||||
set( LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}"
|
|
||||||
CACHE PATH "Directories containing the LAPACK header files" FORCE )
|
|
||||||
set( LAPACK_DEFINITIONS "${LAPACK_DEFINITIONS}"
|
|
||||||
CACHE STRING "Compilation options to use LAPACK" FORCE )
|
|
||||||
set( LAPACK_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}"
|
|
||||||
CACHE STRING "Linker flags to use LAPACK" FORCE )
|
|
||||||
set( LAPACK_LIBRARIES "${LAPACK_LIBRARIES}"
|
|
||||||
CACHE FILEPATH "LAPACK libraries name" FORCE )
|
|
||||||
set( LAPACK_LIBRARIES_DIR "${LAPACK_LIBRARIES_DIR}"
|
|
||||||
CACHE PATH "Directories containing the LAPACK libraries" FORCE )
|
|
||||||
|
|
||||||
#message("DEBUG: LAPACK_INCLUDE_DIR = ${LAPACK_INCLUDE_DIR}")
|
|
||||||
#message("DEBUG: LAPACK_DEFINITIONS = ${LAPACK_DEFINITIONS}")
|
|
||||||
#message("DEBUG: LAPACK_LINKER_FLAGS = ${LAPACK_LINKER_FLAGS}")
|
|
||||||
#message("DEBUG: LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}")
|
|
||||||
#message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}")
|
|
||||||
#message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}")
|
|
||||||
|
|
||||||
endif(NOT BLAS_FOUND)
|
|
||||||
|
|
||||||
if(LAPACK_FOUND)
|
|
||||||
set(LAPACK_USE_FILE "CGAL_UseLAPACK")
|
|
||||||
endif(LAPACK_FOUND)
|
|
|
@ -1,50 +0,0 @@
|
||||||
#This modules tries to find OpenMesh
|
|
||||||
# Once done this will define
|
|
||||||
#
|
|
||||||
# OpenMesh_FOUND - system has OpenMesh
|
|
||||||
# OPENMESH_INCLUDE_DIR - OpenMesh include directory
|
|
||||||
# OPENMESH_LIBRARIES - OpenMesh libraries
|
|
||||||
#
|
|
||||||
|
|
||||||
# Is it already configured?
|
|
||||||
if (NOT OpenMesh_FOUND)
|
|
||||||
|
|
||||||
find_path(OPENMESH_INCLUDE_DIR
|
|
||||||
NAMES OpenMesh/Core/Mesh/ArrayKernel.hh
|
|
||||||
HINTS ENV OPENMESH_INC_DIR
|
|
||||||
ENV OPENMESH_DIR
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include
|
|
||||||
PATH_SUFFIXES src
|
|
||||||
DOC "The directory containing the OpenMesh header files WITHOUT the OpenMesh prefix"
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(OPENMESH_LIBRARY_RELEASE NAMES "OpenMeshCore"
|
|
||||||
HINTS ENV OPENMESH_LIB_DIR
|
|
||||||
ENV OPENMESH_DIR
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
DOC "Path to the OpenMeshCore library"
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(OPENMESH_LIBRARY_DEBUG NAMES "OpenMeshCored"
|
|
||||||
HINTS ENV OPENMESH_LIB_DIR
|
|
||||||
ENV OPENMESH_DIR
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
DOC "Path to the OpenMeshCored library"
|
|
||||||
)
|
|
||||||
|
|
||||||
if(OPENMESH_LIBRARY_RELEASE)
|
|
||||||
if(OPENMESH_LIBRARY_DEBUG)
|
|
||||||
set(OPENMESH_LIBRARIES optimized ${OPENMESH_LIBRARY_RELEASE} debug ${OPENMESH_LIBRARY_DEBUG})
|
|
||||||
else()
|
|
||||||
set(OPENMESH_LIBRARIES ${OPENMESH_LIBRARY_RELEASE})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include( FindPackageHandleStandardArgs )
|
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenMesh
|
|
||||||
REQUIRED_VARS OPENMESH_INCLUDE_DIR OPENMESH_LIBRARIES
|
|
||||||
FOUND_VAR OpenMesh_FOUND
|
|
||||||
)
|
|
|
@ -1,129 +0,0 @@
|
||||||
# This module finds the TAUCS libraries.
|
|
||||||
#
|
|
||||||
# This module sets the following variables:
|
|
||||||
# TAUCS_FOUND - Set to true if headers and libraries are found
|
|
||||||
# TAUCS_INCLUDE_DIR - Directories containing the TAUCS header files
|
|
||||||
# TAUCS_DEFINITIONS - Compilation options to use TAUCS
|
|
||||||
# TAUCS_LIBRARIES_DIR - Directories containing the TAUCS libraries.
|
|
||||||
# May be null if TAUCS_LIBRARIES contains libraries name using full path.
|
|
||||||
# TAUCS_LIBRARIES - TAUCS libraries name.
|
|
||||||
# May be null if the compiler supports auto-link (e.g. VC++).
|
|
||||||
# TAUCS_USE_FILE - The name of the cmake module to include to compile
|
|
||||||
# applications or libraries using TAUCS.
|
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake)
|
|
||||||
|
|
||||||
# TAUCS requires LAPACK
|
|
||||||
if(TAUCS_FIND_QUIETLY OR NOT TAUCS_FIND_REQUIRED)
|
|
||||||
find_package(LAPACK)
|
|
||||||
else()
|
|
||||||
find_package(LAPACK REQUIRED)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT LAPACK_FOUND)
|
|
||||||
|
|
||||||
message(STATUS "TAUCS requires LAPACK and BLAS.")
|
|
||||||
set(TAUCS_FOUND FALSE)
|
|
||||||
|
|
||||||
# Is it already configured?
|
|
||||||
elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
|
|
||||||
|
|
||||||
set(TAUCS_FOUND TRUE)
|
|
||||||
|
|
||||||
elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES)
|
|
||||||
|
|
||||||
set(TAUCS_FOUND TRUE)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
# reset variables
|
|
||||||
set( TAUCS_DEFINITIONS "" ) # unused (yet)
|
|
||||||
set( TAUCS_LIBRARIES "" )
|
|
||||||
set( TAUCS_LIBRARIES_DIR "" )
|
|
||||||
|
|
||||||
# Look first for the TAUCS library distributed with CGAL in auxiliary/taucs.
|
|
||||||
# Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR.
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake)
|
|
||||||
|
|
||||||
# Search for TAUCS headers in ${CGAL_TAUCS_INCLUDE_DIR} (TAUCS shipped with CGAL),
|
|
||||||
# else in $TAUCS_INC_DIR environment variable.
|
|
||||||
if( CGAL_TAUCS_FOUND )
|
|
||||||
set( TAUCS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" )
|
|
||||||
else()
|
|
||||||
find_path(TAUCS_INCLUDE_DIR
|
|
||||||
NAMES taucs.h
|
|
||||||
HINTS ${CGAL_TAUCS_INCLUDE_DIR}
|
|
||||||
ENV TAUCS_DIR
|
|
||||||
ENV TAUCS_INC_DIR
|
|
||||||
PATH_SUFFIXES taucs include
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Search for TAUCS libraries in ${CGAL_TAUCS_LIBRARIES_DIR} (TAUCS shipped with CGAL),
|
|
||||||
# else in $TAUCS_LIB_DIR environment variable.
|
|
||||||
if( CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED )
|
|
||||||
# if VC++: done
|
|
||||||
set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" )
|
|
||||||
else()
|
|
||||||
find_library(TAUCS_LIBRARY
|
|
||||||
NAMES "taucs"
|
|
||||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
|
||||||
ENV TAUCS_DIR
|
|
||||||
ENV TAUCS_LIB_DIR
|
|
||||||
PATH_SUFFIXES taucs lib
|
|
||||||
DOC "TAUCS library"
|
|
||||||
)
|
|
||||||
find_library(METIS_LIBRARY
|
|
||||||
NAMES "metis"
|
|
||||||
PATHS ${CGAL_TAUCS_LIBRARIES_DIR}
|
|
||||||
ENV TAUCS
|
|
||||||
ENV TAUCS_LIB_DIR
|
|
||||||
PATH_SUFFIXES taucs lib
|
|
||||||
DOC "Metis library"
|
|
||||||
)
|
|
||||||
if(TAUCS_LIBRARY AND METIS_LIBRARY)
|
|
||||||
set( TAUCS_LIBRARIES "${TAUCS_LIBRARY};${METIS_LIBRARY}" )
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR)
|
|
||||||
set(TAUCS_FOUND TRUE)
|
|
||||||
elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES)
|
|
||||||
set(TAUCS_FOUND TRUE)
|
|
||||||
else()
|
|
||||||
set(TAUCS_FOUND FALSE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT TAUCS_FIND_QUIETLY)
|
|
||||||
if(TAUCS_FOUND)
|
|
||||||
message(STATUS "TAUCS libraries found.")
|
|
||||||
else(TAUCS_FOUND)
|
|
||||||
if(TAUCS_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "TAUCS libraries not found. Please specify libraries location.")
|
|
||||||
else()
|
|
||||||
message(STATUS "TAUCS libraries not found. Please specify libraries location.")
|
|
||||||
endif()
|
|
||||||
endif(TAUCS_FOUND)
|
|
||||||
endif(NOT TAUCS_FIND_QUIETLY)
|
|
||||||
|
|
||||||
# Add variables to cache
|
|
||||||
set( TAUCS_INCLUDE_DIR "${TAUCS_INCLUDE_DIR}"
|
|
||||||
CACHE PATH "Directories containing the TAUCS header files" FORCE )
|
|
||||||
set( TAUCS_DEFINITIONS "${TAUCS_DEFINITIONS}"
|
|
||||||
CACHE STRING "Compilation options to use TAUCS" FORCE )
|
|
||||||
set( TAUCS_LIBRARIES "${TAUCS_LIBRARIES}"
|
|
||||||
CACHE FILEPATH "TAUCS libraries name" FORCE )
|
|
||||||
set( TAUCS_LIBRARIES_DIR "${TAUCS_LIBRARIES_DIR}"
|
|
||||||
CACHE PATH "Directories containing the TAUCS libraries" FORCE )
|
|
||||||
|
|
||||||
#message("DEBUG: TAUCS_INCLUDE_DIR = ${TAUCS_INCLUDE_DIR}")
|
|
||||||
#message("DEBUG: TAUCS_DEFINITIONS = ${TAUCS_DEFINITIONS}")
|
|
||||||
#message("DEBUG: TAUCS_LIBRARIES = ${TAUCS_LIBRARIES}")
|
|
||||||
#message("DEBUG: TAUCS_LIBRARIES_DIR = ${TAUCS_LIBRARIES_DIR}")
|
|
||||||
#message("DEBUG: TAUCS_FOUND = ${TAUCS_FOUND}")
|
|
||||||
|
|
||||||
endif(NOT LAPACK_FOUND)
|
|
||||||
|
|
||||||
if(TAUCS_FOUND)
|
|
||||||
set(TAUCS_USE_FILE "CGAL_UseTAUCS")
|
|
||||||
endif(TAUCS_FOUND)
|
|
|
@ -1,425 +0,0 @@
|
||||||
# Locate Intel Threading Building Blocks include paths and libraries
|
|
||||||
# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
|
|
||||||
# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
|
|
||||||
# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
|
|
||||||
# Florian Uhlig <F.Uhlig _at_ gsi.de>,
|
|
||||||
# Jiri Marsik <jiri.marsik89 _at_ gmail.com>
|
|
||||||
|
|
||||||
# The MIT License
|
|
||||||
#
|
|
||||||
# Copyright (c) 2011 Hannes Hofmann
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
# of this software and associated documentation files (the "Software"), to deal
|
|
||||||
# in the Software without restriction, including without limitation the rights
|
|
||||||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
# copies of the Software, and to permit persons to whom the Software is
|
|
||||||
# furnished to do so, subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included in
|
|
||||||
# all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
# THE SOFTWARE.
|
|
||||||
|
|
||||||
# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
|
|
||||||
# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
|
|
||||||
# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
|
|
||||||
# in the TBB installation directory (TBB_INSTALL_DIR).
|
|
||||||
#
|
|
||||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
|
||||||
#
|
|
||||||
# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
|
|
||||||
# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
|
|
||||||
# which architecture to use
|
|
||||||
# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
|
|
||||||
# which compiler to use (detected automatically on Windows)
|
|
||||||
|
|
||||||
# This module respects
|
|
||||||
# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
|
|
||||||
|
|
||||||
# This module defines
|
|
||||||
# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
|
|
||||||
# TBB_LIBRARY_DIRS, where to find TBB libraries
|
|
||||||
# TBB_INSTALL_DIR, the base TBB install directory.
|
|
||||||
# TBB_LIBRARIES, all the following TBB libraries (both release and debug versions, using "optimized" and "debug" CMake keywords). Note that if the debug versions are not found, the release versions will be used instead for the debug mode.
|
|
||||||
# TBB_RELEASE_LIBRARY, the TBB release library
|
|
||||||
# TBB_MALLOC_RELEASE_LIBRARY, the TBB release malloc library
|
|
||||||
# TBB_DEBUG_LIBRARY, the TBB debug library
|
|
||||||
# TBB_MALLOC_DEBUG_LIBRARY, the TBB debug malloc library
|
|
||||||
# TBB_FOUND, If false, don't try to use TBB.
|
|
||||||
# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
|
|
||||||
# TBB_MALLOCPROXY_DEBUG_LIBRARY, the TBB debug malloc_proxy library (not included in TBB_LIBRARIES since it's optionnal)
|
|
||||||
# TBB_MALLOCPROXY_RELEASE_LIBRARY, the TBB release malloc_proxy library (not included in TBB_LIBRARIES since it's optionnal)
|
|
||||||
|
|
||||||
include(CheckCXXSourceCompiles)
|
|
||||||
|
|
||||||
# Usage:
|
|
||||||
# try_TBB_with_pthread(<result_var_name> [additional linker args...])
|
|
||||||
function(try_TBB_with_pthread result_var)
|
|
||||||
set(TBB_try_ts_source "
|
|
||||||
#include <tbb/enumerable_thread_specific.h>
|
|
||||||
int main() {
|
|
||||||
tbb::enumerable_thread_specific<
|
|
||||||
bool*,
|
|
||||||
tbb::cache_aligned_allocator<bool*>,
|
|
||||||
tbb::ets_key_per_instance> grid;
|
|
||||||
}
|
|
||||||
")
|
|
||||||
set(CMAKE_REQUIRED_LIBRARIES ${ALL_TBB_LIBRARIES} ${ARGN})
|
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${TBB_INCLUDE_DIR})
|
|
||||||
check_cxx_source_compiles("${TBB_try_ts_source}" ${result_var})
|
|
||||||
set(${result_var} ${${result_var}} PARENT_SCOPE)
|
|
||||||
endfunction(try_TBB_with_pthread)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
# has em64t/vc8 em64t/vc9
|
|
||||||
# has ia32/vc7.1 ia32/vc8 ia32/vc9
|
|
||||||
set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
|
|
||||||
set(_TBB_LIB_RELEASE_NAME "tbb")
|
|
||||||
set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc")
|
|
||||||
set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy")
|
|
||||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug")
|
|
||||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug")
|
|
||||||
set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug")
|
|
||||||
if (MSVC71)
|
|
||||||
set (_TBB_COMPILER "vc7.1")
|
|
||||||
endif(MSVC71)
|
|
||||||
if (MSVC80)
|
|
||||||
set(_TBB_COMPILER "vc8")
|
|
||||||
endif(MSVC80)
|
|
||||||
if (MSVC90)
|
|
||||||
set(_TBB_COMPILER "vc9")
|
|
||||||
endif(MSVC90)
|
|
||||||
if(MSVC10)
|
|
||||||
set(_TBB_COMPILER "vc10")
|
|
||||||
endif(MSVC10)
|
|
||||||
if(MSVC11)
|
|
||||||
set(_TBB_COMPILER "vc11")
|
|
||||||
endif(MSVC11)
|
|
||||||
if(MSVC12)
|
|
||||||
set(_TBB_COMPILER "vc12")
|
|
||||||
endif(MSVC12)
|
|
||||||
#note there was no MSVC13
|
|
||||||
if(MSVC14)
|
|
||||||
set(_TBB_COMPILER "vc14")
|
|
||||||
endif(MSVC14)
|
|
||||||
# Todo: add other Windows compilers such as ICL.
|
|
||||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
|
||||||
endif (WIN32)
|
|
||||||
|
|
||||||
if (UNIX)
|
|
||||||
if (APPLE)
|
|
||||||
# MAC
|
|
||||||
set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
|
|
||||||
# libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
|
|
||||||
set(_TBB_LIB_RELEASE_NAME "tbb")
|
|
||||||
set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc")
|
|
||||||
#set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy")
|
|
||||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug")
|
|
||||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug")
|
|
||||||
#set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug")
|
|
||||||
# default flavor on apple: ia32/cc4.0.1_os10.4.9
|
|
||||||
# Jiri: There is no reason to presume there is only one flavor and
|
|
||||||
# that user's setting of variables should be ignored.
|
|
||||||
if(NOT TBB_COMPILER)
|
|
||||||
set(_TBB_COMPILER "cc4.0.1_os10.4.9")
|
|
||||||
elseif (NOT TBB_COMPILER)
|
|
||||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
|
||||||
endif(NOT TBB_COMPILER)
|
|
||||||
if(NOT TBB_ARCHITECTURE)
|
|
||||||
set(_TBB_ARCHITECTURE "ia32")
|
|
||||||
elseif(NOT TBB_ARCHITECTURE)
|
|
||||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
|
||||||
endif(NOT TBB_ARCHITECTURE)
|
|
||||||
else (APPLE)
|
|
||||||
# LINUX
|
|
||||||
set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
|
|
||||||
set(_TBB_LIB_RELEASE_NAME "tbb")
|
|
||||||
set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc")
|
|
||||||
set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy")
|
|
||||||
set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug")
|
|
||||||
set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug")
|
|
||||||
set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug")
|
|
||||||
# has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
|
|
||||||
# has ia32/*
|
|
||||||
# has itanium/*
|
|
||||||
set(_TBB_COMPILER ${TBB_COMPILER})
|
|
||||||
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
|
|
||||||
endif (APPLE)
|
|
||||||
endif (UNIX)
|
|
||||||
|
|
||||||
if (CMAKE_SYSTEM MATCHES "SunOS.*")
|
|
||||||
# SUN
|
|
||||||
# not yet supported
|
|
||||||
# has em64t/cc3.4.3_kernel5.10
|
|
||||||
# has ia32/*
|
|
||||||
endif (CMAKE_SYSTEM MATCHES "SunOS.*")
|
|
||||||
|
|
||||||
|
|
||||||
#-- Clear the public variables
|
|
||||||
set (TBB_FOUND "NO")
|
|
||||||
|
|
||||||
|
|
||||||
#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
|
|
||||||
# first: use CMake variable TBB_INSTALL_DIR
|
|
||||||
if (TBB_INSTALL_DIR)
|
|
||||||
set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
|
|
||||||
endif (TBB_INSTALL_DIR)
|
|
||||||
# second: use environment variable
|
|
||||||
if (NOT _TBB_INSTALL_DIR)
|
|
||||||
if (NOT "$ENV{TBBROOT}" STREQUAL "")
|
|
||||||
set (_TBB_INSTALL_DIR $ENV{TBBROOT})
|
|
||||||
endif (NOT "$ENV{TBBROOT}" STREQUAL "")
|
|
||||||
if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
|
||||||
set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
|
|
||||||
endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
|
|
||||||
# Intel recommends setting TBB21_INSTALL_DIR
|
|
||||||
if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
|
||||||
set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
|
|
||||||
endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
|
|
||||||
if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
|
||||||
set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
|
|
||||||
endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
|
|
||||||
if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
|
||||||
set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
|
|
||||||
endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
|
|
||||||
endif (NOT _TBB_INSTALL_DIR)
|
|
||||||
# third: try to find path automatically
|
|
||||||
if (NOT _TBB_INSTALL_DIR)
|
|
||||||
if (_TBB_DEFAULT_INSTALL_DIR)
|
|
||||||
set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
|
|
||||||
endif (_TBB_DEFAULT_INSTALL_DIR)
|
|
||||||
endif (NOT _TBB_INSTALL_DIR)
|
|
||||||
# sanity check
|
|
||||||
if (NOT _TBB_INSTALL_DIR)
|
|
||||||
message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
|
|
||||||
else (NOT _TBB_INSTALL_DIR)
|
|
||||||
# finally: set the cached CMake variable TBB_INSTALL_DIR
|
|
||||||
if (NOT TBB_INSTALL_DIR)
|
|
||||||
set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
|
|
||||||
mark_as_advanced(TBB_INSTALL_DIR)
|
|
||||||
endif (NOT TBB_INSTALL_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
#-- A macro to rewrite the paths of the library. This is necessary, because
|
|
||||||
# find_library() always found the em64t/vc9 version of the TBB libs
|
|
||||||
macro(TBB_CORRECT_LIB_DIR var_name)
|
|
||||||
# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
|
||||||
string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
|
||||||
# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
|
|
||||||
string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
|
|
||||||
string(REGEX REPLACE "vc[0-9]+(\.[0-9]+)?" "${_TBB_COMPILER}" ${var_name} ${${var_name}})
|
|
||||||
endmacro(TBB_CORRECT_LIB_DIR var_content)
|
|
||||||
|
|
||||||
|
|
||||||
#-- Look for include directory and set ${TBB_INCLUDE_DIR}
|
|
||||||
set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
|
|
||||||
# Jiri: tbbvars now sets the CPATH environment variable to the directory
|
|
||||||
# containing the headers.
|
|
||||||
# LR: search first with NO_DEFAULT_PATH...
|
|
||||||
find_path(TBB_INCLUDE_DIR
|
|
||||||
tbb/task_scheduler_init.h
|
|
||||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
if(NOT TBB_INCLUDE_DIR)
|
|
||||||
# LR: ... and then search again with NO_DEFAULT_PATH if nothing was found in
|
|
||||||
# hinted paths
|
|
||||||
find_path(TBB_INCLUDE_DIR
|
|
||||||
tbb/task_scheduler_init.h
|
|
||||||
PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
mark_as_advanced(TBB_INCLUDE_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
#-- Look for libraries
|
|
||||||
# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
|
|
||||||
if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
|
||||||
set (_TBB_LIBRARY_DIR
|
|
||||||
${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
|
|
||||||
${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
|
|
||||||
)
|
|
||||||
endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
|
|
||||||
# Jiri: This block isn't mutually exclusive with the previous one
|
|
||||||
# (hence no else), instead I test if the user really specified
|
|
||||||
# the variables in question.
|
|
||||||
if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
|
||||||
# HH: deprecated
|
|
||||||
message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
|
|
||||||
# Jiri: It doesn't hurt to look in more places, so I store the hints from
|
|
||||||
# ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
|
|
||||||
# variables and search them both.
|
|
||||||
set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
|
|
||||||
endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
|
|
||||||
|
|
||||||
# GvdB: Mac OS X distribution places libraries directly in lib directory.
|
|
||||||
list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
|
|
||||||
|
|
||||||
# Jiri: No reason not to check the default paths. From recent versions,
|
|
||||||
# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
|
|
||||||
# variables, which now point to the directories of the lib files.
|
|
||||||
# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
|
|
||||||
# argument instead of the implicit PATHS as it isn't hard-coded
|
|
||||||
# but computed by system introspection. Searching the LIBRARY_PATH
|
|
||||||
# and LD_LIBRARY_PATH environment variables is now even more important
|
|
||||||
# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
|
|
||||||
# the use of TBB built from sources.
|
|
||||||
# LR: search first with NO_DEFAULT_PATH...
|
|
||||||
find_library(TBB_RELEASE_LIBRARY ${_TBB_LIB_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
find_library(TBB_MALLOC_RELEASE_LIBRARY ${_TBB_LIB_MALLOC_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
find_library(TBB_MALLOCPROXY_RELEASE_LIBRARY ${_TBB_LIB_MALLOCPROXY_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
if(NOT TBB_RELEASE_LIBRARY OR NOT TBB_MALLOC_RELEASE_LIBRARY OR NOT TBB_MALLOCPROXY_RELEASE_LIBRARY)
|
|
||||||
# LR: ... and then search again with NO_DEFAULT_PATH if nothing was found
|
|
||||||
# in hinted paths
|
|
||||||
find_library(TBB_RELEASE_LIBRARY ${_TBB_LIB_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
find_library(TBB_MALLOC_RELEASE_LIBRARY ${_TBB_LIB_MALLOC_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
find_library(TBB_MALLOCPROXY_RELEASE_LIBRARY ${_TBB_LIB_MALLOCPROXY_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#Extract path from TBB_RELEASE_LIBRARY name
|
|
||||||
get_filename_component(TBB_RELEASE_LIBRARY_DIR ${TBB_RELEASE_LIBRARY} PATH)
|
|
||||||
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_RELEASE_LIBRARY)
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_RELEASE_LIBRARY)
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOCPROXY_RELEASE_LIBRARY)
|
|
||||||
mark_as_advanced(TBB_RELEASE_LIBRARY TBB_MALLOC_RELEASE_LIBRARY TBB_MALLOCPROXY_RELEASE_LIBRARY)
|
|
||||||
|
|
||||||
#-- Look for debug libraries
|
|
||||||
# Jiri: Changed the same way as for the release libraries.
|
|
||||||
find_library(TBB_DEBUG_LIBRARY ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
find_library(TBB_MALLOC_DEBUG_LIBRARY ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
find_library(TBB_MALLOCPROXY_DEBUG_LIBRARY ${_TBB_LIB_MALLOCPROXY_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH)
|
|
||||||
if(NOT TBB_DEBUG_LIBRARY OR NOT TBB_MALLOC_DEBUG_LIBRARY OR NOT TBB_MALLOCPROXY_DEBUG_LIBRARY)
|
|
||||||
find_library(TBB_DEBUG_LIBRARY ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
find_library(TBB_MALLOC_DEBUG_LIBRARY ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
find_library(TBB_MALLOCPROXY_DEBUG_LIBRARY ${_TBB_LIB_MALLOCPROXY_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
|
|
||||||
PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Jiri: Self-built TBB stores the debug libraries in a separate directory.
|
|
||||||
# Extract path from TBB_DEBUG_LIBRARY name
|
|
||||||
get_filename_component(TBB_DEBUG_LIBRARY_DIR ${TBB_DEBUG_LIBRARY} PATH)
|
|
||||||
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_DEBUG_LIBRARY)
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOC_DEBUG_LIBRARY)
|
|
||||||
#TBB_CORRECT_LIB_DIR(TBB_MALLOCPROXY_DEBUG_LIBRARY)
|
|
||||||
mark_as_advanced(TBB_DEBUG_LIBRARY TBB_MALLOC_DEBUG_LIBRARY TBB_MALLOCPROXY_DEBUG_LIBRARY)
|
|
||||||
|
|
||||||
if (TBB_INCLUDE_DIR)
|
|
||||||
if (TBB_RELEASE_LIBRARY)
|
|
||||||
set (TBB_FOUND "YES")
|
|
||||||
|
|
||||||
# NOTE: Removed because we don't want to link with the malloc_proxy by default
|
|
||||||
#if (NOT "${TBB_MALLOCPROXY_RELEASE_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_RELEASE_LIBRARY-NOTFOUND")
|
|
||||||
# mark_as_advanced(TBB_MALLOCPROXY_RELEASE_LIBRARY)
|
|
||||||
# set (_TBB_MALLOCPROXY optimized ${TBB_MALLOCPROXY_RELEASE_LIBRARY})
|
|
||||||
#endif (NOT "${TBB_MALLOCPROXY_RELEASE_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_RELEASE_LIBRARY-NOTFOUND")
|
|
||||||
#if (NOT "${TBB_MALLOCPROXY_DEBUG_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_DEBUG_LIBRARY-NOTFOUND")
|
|
||||||
# mark_as_advanced(TBB_MALLOCPROXY_DEBUG_LIBRARY)
|
|
||||||
# set (_TBB_MALLOCPROXY ${_TBB_MALLOCPROXY} debug ${TBB_MALLOCPROXY_DEBUG_LIBRARY})
|
|
||||||
#endif (NOT "${TBB_MALLOCPROXY_DEBUG_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_DEBUG_LIBRARY-NOTFOUND")
|
|
||||||
|
|
||||||
# TBB release library
|
|
||||||
set (ALL_TBB_LIBRARIES optimized ${TBB_RELEASE_LIBRARY})
|
|
||||||
|
|
||||||
# TBB debug library found?
|
|
||||||
if (TBB_DEBUG_LIBRARY)
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES debug ${TBB_DEBUG_LIBRARY})
|
|
||||||
else (TBB_DEBUG_LIBRARY)
|
|
||||||
# Otherwise, link with the release library even in debug mode
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES debug ${TBB_RELEASE_LIBRARY})
|
|
||||||
endif (TBB_DEBUG_LIBRARY)
|
|
||||||
|
|
||||||
# TBB malloc - release
|
|
||||||
if (TBB_MALLOC_RELEASE_LIBRARY)
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES optimized ${TBB_MALLOC_RELEASE_LIBRARY})
|
|
||||||
|
|
||||||
# TBB malloc - debug
|
|
||||||
if (TBB_MALLOC_DEBUG_LIBRARY)
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES debug ${TBB_MALLOC_DEBUG_LIBRARY})
|
|
||||||
else (TBB_MALLOC_DEBUG_LIBRARY)
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES debug ${TBB_MALLOC_RELEASE_LIBRARY})
|
|
||||||
endif (TBB_MALLOC_DEBUG_LIBRARY)
|
|
||||||
endif (TBB_MALLOC_RELEASE_LIBRARY)
|
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
# On Fedora, code using TBB might need -pthread
|
|
||||||
|
|
||||||
# First check without pthread
|
|
||||||
try_TBB_with_pthread(TBB_without_pthread)
|
|
||||||
|
|
||||||
if(NOT TBB_without_pthread)
|
|
||||||
# Then check with -pthread
|
|
||||||
try_TBB_with_pthread(TBB_with_pthread -pthread)
|
|
||||||
if(TBB_with_pthread)
|
|
||||||
list(APPEND ALL_TBB_LIBRARIES general -pthread)
|
|
||||||
endif(TBB_with_pthread)
|
|
||||||
endif(NOT TBB_without_pthread)
|
|
||||||
endif(UNIX AND NOT APPLE)
|
|
||||||
|
|
||||||
set (TBB_LIBRARIES ${ALL_TBB_LIBRARIES}
|
|
||||||
CACHE PATH "TBB libraries" FORCE)
|
|
||||||
|
|
||||||
# Include dirs
|
|
||||||
set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
|
|
||||||
|
|
||||||
# Library dirs
|
|
||||||
if( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" )
|
|
||||||
set (TBB_LIBRARY_DIRS
|
|
||||||
${TBB_RELEASE_LIBRARY_DIR}
|
|
||||||
CACHE PATH "TBB library directories" FORCE)
|
|
||||||
else( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" )
|
|
||||||
set (TBB_LIBRARY_DIRS
|
|
||||||
${TBB_RELEASE_LIBRARY_DIR} ${TBB_DEBUG_LIBRARY_DIR}
|
|
||||||
CACHE PATH "TBB library directories" FORCE)
|
|
||||||
endif( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" )
|
|
||||||
|
|
||||||
message(STATUS "Found Intel TBB")
|
|
||||||
endif (TBB_RELEASE_LIBRARY)
|
|
||||||
endif (TBB_INCLUDE_DIR)
|
|
||||||
|
|
||||||
if (NOT TBB_FOUND)
|
|
||||||
if(NOT TBB_FIND_QUIETLY)
|
|
||||||
message("ERROR: Intel TBB NOT found! Please define the TBBROOT (or TBB_INSTALL_DIR) and/or TBB_ARCH_PLATFORM environment variables.")
|
|
||||||
message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
|
|
||||||
endif(NOT TBB_FIND_QUIETLY)
|
|
||||||
SET(TBB_INSTALL_DIR "TBB_INSTALL_DIR_NOT_FOUND" CACHE STRING "Intel TBB install directory")
|
|
||||||
# do only throw fatal, if this pkg is REQUIRED
|
|
||||||
if (TBB_FIND_REQUIRED)
|
|
||||||
message(FATAL_ERROR "Could NOT find TBB library.")
|
|
||||||
endif (TBB_FIND_REQUIRED)
|
|
||||||
endif (NOT TBB_FOUND)
|
|
||||||
|
|
||||||
endif (NOT _TBB_INSTALL_DIR)
|
|
||||||
|
|
||||||
if (TBB_FOUND)
|
|
||||||
set(TBB_INTERFACE_VERSION 0)
|
|
||||||
FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
|
|
||||||
STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
|
|
||||||
set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
|
|
||||||
endif (TBB_FOUND)
|
|
||||||
|
|
||||||
set(TBB_USE_FILE "UseTBB")
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake)
|
|
||||||
### ** Emacs settings **
|
|
||||||
### Local Variables:
|
|
||||||
### cmake-tab-width: 4
|
|
||||||
### End:
|
|
|
@ -1,9 +0,0 @@
|
||||||
# This module setups the compiler for using Eigen v3 library.
|
|
||||||
# It assumes that find_package(Eigen3) was already called.
|
|
||||||
|
|
||||||
|
|
||||||
include_directories( SYSTEM ${EIGEN3_INCLUDE_DIR} )
|
|
||||||
|
|
||||||
add_definitions(-DCGAL_EIGEN3_ENABLED)
|
|
||||||
|
|
||||||
set (EIGEN3_SETUP TRUE)
|
|
|
@ -1,4 +0,0 @@
|
||||||
# This module setups the compiler for using LASlib library.
|
|
||||||
# It assumes that find_package(LASLIB) was already called.
|
|
||||||
|
|
||||||
add_definitions(-DCGAL_LINKED_WITH_LASLIB)
|
|
|
@ -1,38 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if BOOST is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include <boost/version.hpp>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << BOOST_VERSION/100000 << "."
|
|
||||||
<< ((BOOST_VERSION / 100) % 100) << "."
|
|
||||||
<< BOOST_VERSION % 100 << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Fernando Cacciola
|
|
||||||
|
|
||||||
// Print out the gcc version
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Just in case this is called with a non-gcc compiler such as pgCC
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifdef __clang_version__
|
|
||||||
# define _CGAL_GCC_VERSION "Not GNU/CC (CLANG)"
|
|
||||||
#else
|
|
||||||
# ifndef __GNUC__
|
|
||||||
# define _CGAL_GCC_VERSION "Not GNU/CC"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#ifndef _CGAL_GCC_VERSION
|
|
||||||
# ifdef __VERSION__
|
|
||||||
# define _CGAL_GCC_VERSION __VERSION__
|
|
||||||
# else
|
|
||||||
# define _CGAL_GCC_VERSION "Unknown version (_CGAL_GCC_VERSION is not defined)"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << _CGAL_GCC_VERSION << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if GMP is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstddef>
|
|
||||||
#include "gmp.h"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << __GNU_MP_VERSION << "."
|
|
||||||
<< __GNU_MP_VERSION_MINOR << "."
|
|
||||||
<< __GNU_MP_VERSION_PATCHLEVEL << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Fernando Cacciola
|
|
||||||
|
|
||||||
// Print out the gcc version
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Just in case this is called with a non-gcc compiler such as pgCC
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef __INTEL_COMPILER
|
|
||||||
# define CGAL_INTEL_VERSION "Not ICC"
|
|
||||||
#else
|
|
||||||
# define CGAL_INTEL_VERSION __INTEL_COMPILER
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << CGAL_INTEL_VERSION << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <LEDA/system/basic.h>
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << ( __LEDA__ / 100 ) << "." << ( __LEDA__ % 100 ) << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
// Copyright (c) 2010 Inria Lorraine (France). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author: Luis Peñaranda <luis.penaranda@gmx.com>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <mpfi.h>
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
std::cout<<"version="<<std::string(mpfi_get_version())<<std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if MPFR is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstddef>
|
|
||||||
#include "mpfr.h"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
#ifdef MPFR_VERSION
|
|
||||||
std::cout << "version=" << MPFR_VERSION_MAJOR << "."
|
|
||||||
<< MPFR_VERSION_MINOR << "."
|
|
||||||
<< MPFR_VERSION_PATCHLEVEL << std::endl;
|
|
||||||
#else
|
|
||||||
// MPFR versions < 2.2.0 did not have version strings
|
|
||||||
std::cout << "version=unknown" << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,66 +0,0 @@
|
||||||
// Copyright (c) 2006
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if OPEN GL and GLU are available.
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#include <wtypes.h>
|
|
||||||
#include <wingdi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
# include <OpenGL/gl.h>
|
|
||||||
# include <OpenGL/glu.h>
|
|
||||||
#else
|
|
||||||
# include <GL/gl.h>
|
|
||||||
# include <GL/glu.h>
|
|
||||||
#endif // __APPLE__
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" <<
|
|
||||||
#if defined GL_VERSION_2_1
|
|
||||||
"2.1"
|
|
||||||
#elif defined GL_VERSION_2_0
|
|
||||||
"2.0"
|
|
||||||
#elif defined GL_VERSION_1_5
|
|
||||||
"1.5"
|
|
||||||
#elif defined GL_VERSION_1_4
|
|
||||||
"1.4"
|
|
||||||
#elif defined GL_VERSION_1_3
|
|
||||||
"1.3"
|
|
||||||
#elif defined GL_VERSION_1_2
|
|
||||||
"1.2"
|
|
||||||
#elif defined GL_VERSION_1_1
|
|
||||||
"1.1"
|
|
||||||
#elif defined GL_VERSION_1_0
|
|
||||||
"1.0"
|
|
||||||
#else
|
|
||||||
"unknown"
|
|
||||||
#endif
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
// Copyright (c) 2008 GeometryFactory, Sophia Antipolis (France)
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
|
|
||||||
// Tests if QT5 is available and prints its version string.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <QtCore/QtGlobal>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << QT_VERSION_STR << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if QT is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <qglobal.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << QT_VERSION_STR << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri, Laurent Saboret
|
|
||||||
|
|
||||||
// Test if ZLIB is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <zlib.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << ZLIB_VERSION << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
// Copyright (c) 2007 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Laurent Saboret
|
|
||||||
|
|
||||||
// Test if the LAPACK subset in ATLAS is available
|
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
// Fortran interface taken from ATLAS/interfaces/lapack/F77/src/dpotrf.f
|
|
||||||
extern void dpotrf_(char *uplo, int *n, double *a, int *lda, int *info);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
// Call dpotrf_() Lapack routine (Cholesky factorization)
|
|
||||||
int sn_size = 0;
|
|
||||||
int lda = 1;
|
|
||||||
int info;
|
|
||||||
dpotrf_((char*)"LOWER",
|
|
||||||
&sn_size,
|
|
||||||
NULL,
|
|
||||||
&lda,
|
|
||||||
&info);
|
|
||||||
|
|
||||||
std::cout << "ok for ATLAS" << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
// Copyright (c) 2007 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $ID$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Laurent Saboret
|
|
||||||
|
|
||||||
// Test if BLAS is available
|
|
||||||
|
|
||||||
// blaswrap.h maps CBLAS function names to BLAS standard Fortran interface.
|
|
||||||
#ifdef CGAL_USE_CBLASWRAP
|
|
||||||
#ifndef CGAL_USE_F2C
|
|
||||||
#define CGAL_USE_F2C
|
|
||||||
#endif
|
|
||||||
#include <blaswrap.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
// Fortran interface (taken from www.netlib.org/clapack)...
|
|
||||||
void dgemm_(char* transa, char* transb, int* m,
|
|
||||||
int* n, int* k,
|
|
||||||
double* alpha,
|
|
||||||
double* a, int* lda, double* b, int* ldb,
|
|
||||||
double* beta,
|
|
||||||
double* c, int* ldc);
|
|
||||||
// ... or C interface (taken from AMD Core Math Library)
|
|
||||||
void dgemm (char transa, char transb, int m,
|
|
||||||
int n, int k,
|
|
||||||
double alpha,
|
|
||||||
double* a, int lda, double* b, int ldb,
|
|
||||||
double beta,
|
|
||||||
double* c, int ldc);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CGAL { namespace BLAS {
|
|
||||||
|
|
||||||
inline
|
|
||||||
void dgemm (char* transa, char* transb, int* m,
|
|
||||||
int* n, int* k,
|
|
||||||
double* alpha,
|
|
||||||
double* a, int* lda, double* b, int* ldb,
|
|
||||||
double* beta,
|
|
||||||
double* c, int* ldc)
|
|
||||||
{
|
|
||||||
#ifdef CGAL_USE_F2C
|
|
||||||
::dgemm_(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc);
|
|
||||||
#else
|
|
||||||
::dgemm (*transa, *transb, *m, *n, *k, *alpha, a, *lda, b, *ldb, *beta, c, *ldc);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} }
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
char S[2] = "N";
|
|
||||||
double A = 2.0;
|
|
||||||
double B = 3.0;
|
|
||||||
double C = 5.0;
|
|
||||||
double alpha = 7.0;
|
|
||||||
double beta = 11.0;
|
|
||||||
int n = 1;
|
|
||||||
int ld = 1;
|
|
||||||
|
|
||||||
CGAL::BLAS::dgemm(S,S, &n,&n,&n, &alpha, &A,&ld, &B,&ld, &beta, &C,&ld);
|
|
||||||
if(C == 97.0) {
|
|
||||||
std::cout << "ok for BLAS" << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,57 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if BOOST is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <boost/version.hpp>
|
|
||||||
#include <boost/tuple/tuple.hpp>
|
|
||||||
#include <boost/tuple/tuple_comparison.hpp>
|
|
||||||
|
|
||||||
using boost::tuple;
|
|
||||||
using boost::make_tuple;
|
|
||||||
using boost::tie;
|
|
||||||
using boost::get;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
tuple<int, double> a, b, c;
|
|
||||||
a = tuple<int, double>();
|
|
||||||
b = tuple<int, double>(1);
|
|
||||||
c = tuple<int, double>(1, 3.14);
|
|
||||||
a = make_tuple(1, 2.57);
|
|
||||||
|
|
||||||
int i;
|
|
||||||
double d;
|
|
||||||
tie(i, d) = a;
|
|
||||||
i = a.get<0>();
|
|
||||||
d = a.get<1>();
|
|
||||||
|
|
||||||
std::cout << "version=" << BOOST_VERSION/100000 << "."
|
|
||||||
<< ((BOOST_VERSION / 100) % 100) << "."
|
|
||||||
<< BOOST_VERSION % 100 << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
// Copyright (c) 2006, 2007, 2009 Stanford University (USA),
|
|
||||||
// INRIA Sophia-Antipolis (France). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Daniel Russel, Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if BOOST_PROGRAM_OPTIONS is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <boost/program_options.hpp>
|
|
||||||
|
|
||||||
namespace po = boost::program_options;
|
|
||||||
|
|
||||||
int main(int ac, char *av[])
|
|
||||||
{
|
|
||||||
std::cout << "version=" << BOOST_VERSION/100000 << "."
|
|
||||||
<< ((BOOST_VERSION / 100) % 100) << "."
|
|
||||||
<< BOOST_VERSION % 100 << std::endl;
|
|
||||||
|
|
||||||
std::string str;
|
|
||||||
|
|
||||||
po::options_description desc("Allowed options");
|
|
||||||
desc.add_options()
|
|
||||||
("help", "produce help message")
|
|
||||||
("input-file,f", po::value<std::string>(&str)->default_value("blabla.txt"),
|
|
||||||
"name of file")
|
|
||||||
;
|
|
||||||
|
|
||||||
po::variables_map vm;
|
|
||||||
po::store(po::parse_command_line(ac, av, desc), vm);
|
|
||||||
po::notify(vm);
|
|
||||||
|
|
||||||
if (vm.count("help")) {
|
|
||||||
std::cout << "Help" << "\n";
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
// Copyright (c) 2007 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if BOOST.THREAD is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <boost/version.hpp>
|
|
||||||
#include <boost/thread/tss.hpp>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << BOOST_VERSION/100000 << "."
|
|
||||||
<< ((BOOST_VERSION / 100) % 100) << "."
|
|
||||||
<< BOOST_VERSION % 100 << std::endl;
|
|
||||||
|
|
||||||
boost::thread_specific_ptr<int> z;
|
|
||||||
if (z.get() == NULL) {
|
|
||||||
z.reset(new int(1));
|
|
||||||
}
|
|
||||||
if(*z.get() == 1) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if GMP is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include "gmp.h"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
mpz_t b, p;
|
|
||||||
mpz_init (p);
|
|
||||||
mpz_init_set_str (b, "31", 0);
|
|
||||||
mpz_mul_ui (p, b, 75); /* generate product */
|
|
||||||
|
|
||||||
char *str = new char[mpz_sizeinbase(p, 10) + 2];
|
|
||||||
str = mpz_get_str(str, 10, p);
|
|
||||||
std::cout << str << std::endl;
|
|
||||||
delete[] str;
|
|
||||||
|
|
||||||
std::cout << "version=" << __GNU_MP_VERSION << "."
|
|
||||||
<< __GNU_MP_VERSION_MINOR << "."
|
|
||||||
<< __GNU_MP_VERSION_PATCHLEVEL << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if GMPXX is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <cstring> // needed by GMP 4.1.4 since <gmpxx.h> misses it.
|
|
||||||
#include <gmpxx.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
mpz_class a = 1;
|
|
||||||
mpq_class b = 2/a;
|
|
||||||
|
|
||||||
std::cout << a << std::endl; // test ABI of libgmpxx
|
|
||||||
|
|
||||||
std::cout << "version=" << __GNU_MP_VERSION << "."
|
|
||||||
<< __GNU_MP_VERSION_MINOR << "."
|
|
||||||
<< __GNU_MP_VERSION_PATCHLEVEL << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,83 +0,0 @@
|
||||||
// Copyright (c) 2007 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Marc Pouget
|
|
||||||
|
|
||||||
// Test if LAPACK is available
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
// taken from acml.h
|
|
||||||
void dgelss(int m, int n, int nrhs,
|
|
||||||
double *a, int lda, double *b, int ldb, double *sing,
|
|
||||||
double rcond, int *irank, int *info);
|
|
||||||
|
|
||||||
void dgelss_(int *m, int *n, int *nrhs,
|
|
||||||
double *a, int *lda, double *b, int *ldb, double *
|
|
||||||
s, double *rcond, int *rank, double *work, int *lwork,
|
|
||||||
int *info);
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace CGAL { namespace LAPACK {
|
|
||||||
|
|
||||||
inline
|
|
||||||
void dgelss(int *m, int *n, int *nrhs,
|
|
||||||
double *a, int *lda, double *b, int *ldb, double *
|
|
||||||
s, double *rcond, int *rank, double *work, int *lwork,
|
|
||||||
int *info)
|
|
||||||
{
|
|
||||||
#ifdef CGAL_USE_F2C
|
|
||||||
::dgelss_(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info);
|
|
||||||
#else
|
|
||||||
::dgelss(*m, *n, *nrhs, a, *lda, b, *ldb, s, *rcond, rank, info);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} }
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double M=1, B=1;
|
|
||||||
int m = 1,
|
|
||||||
n = 1,
|
|
||||||
nrhs = 1,
|
|
||||||
lda = m,
|
|
||||||
ldb = m,
|
|
||||||
rank,
|
|
||||||
lwork = 5*m,
|
|
||||||
info;
|
|
||||||
//c style
|
|
||||||
double * sing_values = new double[n]; // * sing_values = (double*) malloc(n*sizeof(double));
|
|
||||||
double* work = new double[lwork]; // (double*) malloc(lwork*sizeof(double));
|
|
||||||
|
|
||||||
double rcond = -1;
|
|
||||||
|
|
||||||
CGAL::LAPACK::dgelss(&m, &n, &nrhs, &M, &lda, &B, &ldb, sing_values,
|
|
||||||
&rcond, &rank, work, &lwork, &info);
|
|
||||||
assert(info==0);
|
|
||||||
assert(B==1.);
|
|
||||||
//clean up
|
|
||||||
delete sing_values;
|
|
||||||
delete work;
|
|
||||||
|
|
||||||
std::cout << "ok for lapack" << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,71 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if LEDA is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#ifndef HAVE_LEDA4X
|
|
||||||
#include <LEDA/system/basic.h>
|
|
||||||
#include <LEDA/numbers/integer.h>
|
|
||||||
#else
|
|
||||||
#include <LEDA/basic.h>
|
|
||||||
#include <LEDA/integer.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
|
||||||
#ifndef LEDA_STD_HEADERS
|
|
||||||
# error "LEDA_STD_HEADERS is not defined. Please consult the troubleshooting section of the installation manual."
|
|
||||||
#endif // ! LEDA_STD_HEADERS
|
|
||||||
#endif // MSVC
|
|
||||||
|
|
||||||
#if defined(LEDA_NAMESPACE)
|
|
||||||
using namespace leda;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef HAVE_LEDA4X
|
|
||||||
#include <LEDA/internal/REDEFINE_NAMES.h>
|
|
||||||
typedef integer I;
|
|
||||||
#include <LEDA/internal/UNDEFINE_NAMES.h>
|
|
||||||
#else
|
|
||||||
#include <LEDA/REDEFINE_NAMES.h>
|
|
||||||
typedef integer I;
|
|
||||||
#include <LEDA/UNDEFINE_NAMES.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
I a(123456);
|
|
||||||
I b(456789);
|
|
||||||
|
|
||||||
if (a + b != I(580245))
|
|
||||||
return 1;
|
|
||||||
if (a - b != I(-333333))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
std::cout << "version=" << __LEDA__ << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Hoffmann
|
|
||||||
|
|
||||||
// Tests if the LEDA Window library is available.
|
|
||||||
|
|
||||||
// FIXME
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Display* x = 0;
|
|
||||||
std::cout << X_PROTOCOL << "." << X_PROTOCOL_REVISION << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
// Copyright (c) 2006
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Meyer
|
|
||||||
|
|
||||||
// Tests if LIDIA is available.
|
|
||||||
|
|
||||||
#include <LiDIA/bigint.h>
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
::LiDIA::bigint x = 123;
|
|
||||||
x = x + x;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if MPFR is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include "gmp.h"
|
|
||||||
#include "mpfr.h"
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
mpfr_t b, p;
|
|
||||||
mpfr_init (p);
|
|
||||||
mpfr_init_set_str (b, "31", 10, GMP_RNDN);
|
|
||||||
mpfr_mul_ui (p, b, 75, GMP_RNDU); /* generate product */
|
|
||||||
|
|
||||||
char *str = new char[50]; // 50 should be enough
|
|
||||||
mp_exp_t exp;
|
|
||||||
str = mpfr_get_str(str, &exp, 10, 0, p, GMP_RNDU);
|
|
||||||
std::cout << str << " E " << exp << std::endl;
|
|
||||||
delete[] str;
|
|
||||||
|
|
||||||
#ifdef MPFR_VERSION
|
|
||||||
std::cout << "version=" << MPFR_VERSION_MAJOR << "."
|
|
||||||
<< MPFR_VERSION_MINOR << "."
|
|
||||||
<< MPFR_VERSION_PATCHLEVEL << std::endl;
|
|
||||||
#else
|
|
||||||
// MPFR versions < 2.2.0 did not have version strings
|
|
||||||
std::cout << "version=unknown" << std::endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,79 +0,0 @@
|
||||||
// Copyright (c) 2006
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
// Tests if OPEN GL and GLU are available.
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
# include <wtypes.h>
|
|
||||||
# include <wingdi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
# include <OpenGL/gl.h>
|
|
||||||
# include <OpenGL/glu.h>
|
|
||||||
#else
|
|
||||||
# include <GL/gl.h>
|
|
||||||
# include <GL/glu.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
// The following global variable is needed otherwise GCC removes the body of
|
|
||||||
// the if() blocks which removes its purpose of link check.
|
|
||||||
bool execute = false;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
if (execute) {
|
|
||||||
// This needs an active GL context, so not executed, but serves
|
|
||||||
// as a link test.
|
|
||||||
(void) glGetString(GL_VERSION);
|
|
||||||
(void) gluGetString(GLU_VERSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "version=" <<
|
|
||||||
#if defined GL_VERSION_2_1
|
|
||||||
"2.1"
|
|
||||||
#elif defined GL_VERSION_2_0
|
|
||||||
"2.0"
|
|
||||||
#elif defined GL_VERSION_1_5
|
|
||||||
"1.5"
|
|
||||||
#elif defined GL_VERSION_1_4
|
|
||||||
"1.4"
|
|
||||||
#elif defined GL_VERSION_1_3
|
|
||||||
"1.3"
|
|
||||||
#elif defined GL_VERSION_1_2
|
|
||||||
"1.2"
|
|
||||||
#elif defined GL_VERSION_1_1
|
|
||||||
"1.1"
|
|
||||||
#elif defined GL_VERSION_1_0
|
|
||||||
"1.0"
|
|
||||||
#else
|
|
||||||
"unknown"
|
|
||||||
#endif
|
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,53 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
// Tests if QT is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <qglobal.h>
|
|
||||||
#include <qarray.h>
|
|
||||||
|
|
||||||
QArray<int> fib( int num ) // returns fibonacci array
|
|
||||||
{
|
|
||||||
ASSERT( num > 2 );
|
|
||||||
QArray<int> f( num ); // array of ints
|
|
||||||
|
|
||||||
f[0] = f[1] = 1; // initialize first two numbers
|
|
||||||
for ( int i=2; i<num; i++ )
|
|
||||||
f[i] = f[i-1] + f[i-2];
|
|
||||||
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << QT_VERSION_STR << std::endl;
|
|
||||||
|
|
||||||
QArray<int> a = fib( 6 ); // get 6 first fibonaccis
|
|
||||||
|
|
||||||
if(4==a.find(5))
|
|
||||||
return 0;
|
|
||||||
return 1;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Hoffmann
|
|
||||||
|
|
||||||
// Tests if X11 is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
Display* x = 0;
|
|
||||||
std::cout << "version=" << X_PROTOCOL << "." << X_PROTOCOL_REVISION
|
|
||||||
<< std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri, Laurent Saboret
|
|
||||||
|
|
||||||
// Test if ZLIB is available.
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <zlib.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
std::cout << "version=" << zlibVersion() << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs when handling denormal values at
|
|
||||||
//| compile time. At least PGCC 7.1-2 has the bug.
|
|
||||||
//|
|
|
||||||
//| Laurent Rineau, 2012/06/14: no supported platform has the bug now.
|
|
||||||
|
|
||||||
#undef NDEBUG
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double d = 5e-324;
|
|
||||||
assert(d != 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
// Copyright (c) 1997-2001
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri
|
|
||||||
|
|
||||||
//| If a compiler has problems with restoring the rounding mode in a try/catch
|
|
||||||
//| CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
#include <float.h>
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_controlfp( _RC_UP, _MCW_RC );
|
|
||||||
throw 1;
|
|
||||||
}
|
|
||||||
catch ( ... )
|
|
||||||
{
|
|
||||||
// Sets the rounding mode to 0 and show that it's realy the case.
|
|
||||||
_controlfp( 0, _MCW_RC );
|
|
||||||
}
|
|
||||||
|
|
||||||
// After the catch, this value will not be 0 in x64
|
|
||||||
unsigned int cw = _controlfp( 0, 0 ) & _MCW_RC;
|
|
||||||
return (cw != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs with special features with IEEE 754
|
|
||||||
//| handling, concerning is_valid() and is_finite() testing of infinity and
|
|
||||||
//| nans. The workaround is to use bitfield operations.
|
|
||||||
//| At least VC++, Borland and PGCC have the bug.
|
|
||||||
|
|
||||||
bool
|
|
||||||
is_valid(double d)
|
|
||||||
{ return (d == d); }
|
|
||||||
|
|
||||||
bool
|
|
||||||
is_finite(double d)
|
|
||||||
{ return (d == d) && is_valid(d-d); }
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double zero = 0;
|
|
||||||
double inf = 1/zero;
|
|
||||||
double nan = zero*inf;
|
|
||||||
|
|
||||||
bool b = true;
|
|
||||||
b = b && is_valid(inf);
|
|
||||||
b = b && !is_valid(nan);
|
|
||||||
b = b && !is_finite(inf);
|
|
||||||
b = b && !is_finite(nan);
|
|
||||||
|
|
||||||
if (!b)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
// Copyright (c) 2006 GeometryFactory (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri
|
|
||||||
|
|
||||||
//| This flag is set, if the executable does not properly parse an int followed by a comma
|
|
||||||
//| Can you believe it!!!
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
std::string one = "7812,";
|
|
||||||
std::istringstream is(one);
|
|
||||||
is >> i;
|
|
||||||
std::cout << i << std::endl;
|
|
||||||
if(i != 7812){ // bad luck if there is garbage that equals 7812.
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
//| This flag is set, if a compiler cannot distinguish the signature
|
|
||||||
//| of overloaded function templates, which have one template parameter
|
|
||||||
//| to be passed explicitely when being called.
|
|
||||||
//|
|
|
||||||
//| This bug appears for example on g++ 3.3 and 3.4 (but not on more recent
|
|
||||||
//| g++ version). This bug appears also on Sun CC 5.90.
|
|
||||||
|
|
||||||
template < typename T >
|
|
||||||
struct A {};
|
|
||||||
|
|
||||||
template < typename T, typename U >
|
|
||||||
T enum_cast(const U&) { return T(); }
|
|
||||||
|
|
||||||
template < typename T, typename U >
|
|
||||||
T enum_cast(const A<U>&) { return T(); }
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
A<double> a;
|
|
||||||
int i = enum_cast<int>(a);
|
|
||||||
(void) i;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
// Copyright (c) 2005
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri
|
|
||||||
|
|
||||||
//| VC 7.3 does not recognize when an operator in a class
|
|
||||||
//| redefines the operator with the same signature in a base class
|
|
||||||
//| It happens with the regular triangulation.
|
|
||||||
//| No minimal testcase yet
|
|
||||||
|
|
||||||
#if (defined _MSC_VER && ! defined __INTEL_COMPILER) || defined __SUNPRO_CC
|
|
||||||
|
|
||||||
#error "this should not compile and that is good so"
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
// Copyright (c) 2014 GeometryFactory Sarl (France)
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri, Laurent Rineau
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs with some "using Base::Member;" in
|
|
||||||
//| a derived class. The workaround is to write a forwarder or not use
|
|
||||||
//| using.
|
|
||||||
|
|
||||||
enum Type { POINT, WPOINT };
|
|
||||||
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
int I;
|
|
||||||
|
|
||||||
struct Point {
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct WPoint
|
|
||||||
{
|
|
||||||
WPoint(const Point&) {} // Point is implicitly convertible to WPoint.
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct Conv
|
|
||||||
{
|
|
||||||
Conv() {}
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
Type operator()(const T&){ return POINT; }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct WConv : Conv
|
|
||||||
{
|
|
||||||
WConv() {}
|
|
||||||
|
|
||||||
Type operator()(const WPoint&){ return WPOINT; }
|
|
||||||
|
|
||||||
#if MATCHING_BUG_8 // only defined by CGAL_CFG_MATCHING_BUG_8.cpp
|
|
||||||
Type operator()(const Point&){ return POINT; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using Conv::operator(); // Import the operator() of Conv, that matches
|
|
||||||
// for every type.
|
|
||||||
|
|
||||||
// Workaround: comment the previous 'using' line, and write:
|
|
||||||
// template <typename T>
|
|
||||||
// Type operator()(const T& t){ return Conv::operator()(t); }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
I = 0;
|
|
||||||
Point p;
|
|
||||||
WPoint wp(p);
|
|
||||||
WConv wconv;
|
|
||||||
if(wconv(p) != POINT) return 1;
|
|
||||||
if(wconv(wp) != WPOINT) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// VC++11 and VC++12 both say that the call to `wconv(p)` is ambiguous:
|
|
||||||
//
|
|
||||||
// config\testfiles\CGAL_CFG_MATCHING_BUG_7.cpp(61) : error C2666: 'WConv::operator ()' : 2 overloads have similar conversions
|
|
||||||
//
|
|
||||||
// config\testfiles\CGAL_CFG_MATCHING_BUG_7.cpp(51): could be 'void WConv::operator ()(const WPoint &)'
|
|
||||||
//
|
|
||||||
// unable to recover from previous error(s); stopping compilation
|
|
|
@ -1,35 +0,0 @@
|
||||||
// Copyright (c) 2014 GeometryFactory Sarl (France)
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Laurent Rineau
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs with some "using Base::Member;" in
|
|
||||||
//| a derived class. This bug is similar to CGAL_CFG_MATCHING_BUG_7, but
|
|
||||||
//| VC11 is not sensible to it, and VC12 says the call is ambiguous.
|
|
||||||
|
|
||||||
#define MATCHING_BUG_8 1
|
|
||||||
#include "CGAL_CFG_MATCHING_BUG_7.cpp"
|
|
||||||
|
|
||||||
// VC++12 both says that the call to `wconv(p)` is ambiguous:
|
|
||||||
//
|
|
||||||
// config\testfiles\CGAL_CFG_MATCHING_BUG_7.cpp(61) : error C2666: 'WConv::operator ()' : 2 overloads have similar conversions
|
|
||||||
//
|
|
||||||
// config\testfiles\CGAL_CFG_MATCHING_BUG_7.cpp(51): could be 'void WConv::operator ()(const WP &)'
|
|
||||||
//
|
|
||||||
// unable to recover from previous error(s); stopping compilation
|
|
|
@ -1,41 +0,0 @@
|
||||||
// Copyright (c) 1997
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : various
|
|
||||||
|
|
||||||
//| If a compiler has a bug in the implementation of
|
|
||||||
//| std::numeric_limits<>::denorm_min(), such as PGCC 7.1-2,
|
|
||||||
//| CGAL_CFG_NO_LIMITS is set.
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double d = std::numeric_limits<double>::denorm_min();
|
|
||||||
double e = std::numeric_limits<double>::min();
|
|
||||||
// Note : denorm_min == min is actually not necessarily a bug.
|
|
||||||
// So a better test should be found.
|
|
||||||
if (d == 0 || d == e)
|
|
||||||
return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
// Copyright (c) 2006
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri
|
|
||||||
|
|
||||||
//| If a compiler doesn't know nextafter() (or only knows _nextafter as VC++ 7.1).
|
|
||||||
//| nextafter() is part of ISO C99, but not ISO C++98 (hence <math.h> instead of <cmath>).
|
|
||||||
//| CGAL_CFG_NO_NEXTAFTER is set.
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
double d = nextafter(0,0);
|
|
||||||
(void) d;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Lutz Kettner, Sylvain Pion
|
|
||||||
|
|
||||||
//| A basic test for the STL.
|
|
||||||
//| If it fails, it probably means a bad CGAL installation.
|
|
||||||
|
|
||||||
#undef NDEBUG
|
|
||||||
#include <cassert>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <list>
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
using std::list;
|
|
||||||
|
|
||||||
list<char> lst( const char* s)
|
|
||||||
{
|
|
||||||
list<char> x;
|
|
||||||
while (*s != '\0') x.push_back( *s++);
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
list<char> list1 = lst( "mark twain");
|
|
||||||
std::reverse( list1.begin(), list1.end());
|
|
||||||
assert( list1 == lst( "niawt kram"));
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,49 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs with std::numeric_limits
|
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
#include <limits>
|
|
||||||
|
|
||||||
bool
|
|
||||||
is_finite(double d)
|
|
||||||
{ return (d != std::numeric_limits<double>::infinity()) && (-d != std::numeric_limits<double>::infinity()); }
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
|
|
||||||
double zero = 0;
|
|
||||||
double inf = 1. / zero;
|
|
||||||
double nan = zero*inf;
|
|
||||||
bool b = true;
|
|
||||||
b = b && !is_finite(inf);
|
|
||||||
|
|
||||||
(void) nan; // stop warning
|
|
||||||
|
|
||||||
if (!b)
|
|
||||||
return -1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Marc Glisse
|
|
||||||
|
|
||||||
//| This flag is set if the compiler complains about an ambiguity between
|
|
||||||
//| a type and itself when some members are defined out of line. This is
|
|
||||||
//| a Sun CC bug.
|
|
||||||
|
|
||||||
template < typename U >
|
|
||||||
struct B
|
|
||||||
{
|
|
||||||
struct A
|
|
||||||
{
|
|
||||||
typedef char C;
|
|
||||||
};
|
|
||||||
A* f ( typename A :: C );
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class U >
|
|
||||||
typename B < U > :: A*
|
|
||||||
B < U > :: f ( typename A :: C )
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
// Copyright (c) 2011 INRIA Saclay (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Marc Glisse
|
|
||||||
|
|
||||||
//| If a compiler wants us to remove the template keyword in default
|
|
||||||
//| parameters, CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG is set.
|
|
||||||
//| Bug found in sunCC 5.11.
|
|
||||||
|
|
||||||
template < typename A, typename B, typename C =
|
|
||||||
typename A :: template T < B > :: type >
|
|
||||||
// here
|
|
||||||
struct S {};
|
|
||||||
|
|
||||||
int main(){}
|
|
|
@ -1,46 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri <Andreas.Fabri@geometryfactory.com>
|
|
||||||
|
|
||||||
struct Class {
|
|
||||||
struct Nested_class {
|
|
||||||
Nested_class(){}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
template <class Cl>
|
|
||||||
void
|
|
||||||
function(const Cl& cl,
|
|
||||||
typename Cl::Nested_class start = typename Cl::Nested_class())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
main()
|
|
||||||
{
|
|
||||||
Class cl;
|
|
||||||
function(cl);
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,70 +0,0 @@
|
||||||
// Copyright (c) 2004
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sylvain Pion
|
|
||||||
|
|
||||||
//| This flag is set if the compiler bugs with some "using Base::Member;" in
|
|
||||||
//| a derived class. The workaround is to write a forwarder or not use using.
|
|
||||||
//| At least SunPro CC 5.3 has this bug where the typical error message is :
|
|
||||||
//| "Error: The function B<int>::g() has not had a body defined."
|
|
||||||
//| Note that the subtlely is that the error message does not mention
|
|
||||||
//| "Member"...
|
|
||||||
//| This test is updated (hijacked) to detect an issue with sunpro 5.9
|
|
||||||
//| that instantiates a function twice.
|
|
||||||
|
|
||||||
template < class T >
|
|
||||||
struct A
|
|
||||||
{
|
|
||||||
A() {}
|
|
||||||
|
|
||||||
void f();
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class T >
|
|
||||||
void A<T>::f(){}
|
|
||||||
|
|
||||||
template < class GT >
|
|
||||||
struct B : A<GT>
|
|
||||||
{
|
|
||||||
using A<GT>::f;
|
|
||||||
|
|
||||||
B() {}
|
|
||||||
|
|
||||||
void g();
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class GT >
|
|
||||||
void
|
|
||||||
B<GT>::g()
|
|
||||||
{
|
|
||||||
f();
|
|
||||||
}
|
|
||||||
|
|
||||||
template struct B<int>;
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
B<int> b;
|
|
||||||
b.g();
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
// Copyright (c) 2009
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : -
|
|
||||||
|
|
||||||
// This file is automatically created by cmake
|
|
||||||
// Do not edit manually.
|
|
||||||
|
|
||||||
#ifndef CGAL_VERSION_H
|
|
||||||
#define CGAL_VERSION_H
|
|
||||||
|
|
||||||
#define CGAL_VERSION @CGAL_CREATED_VERSION@
|
|
||||||
#define CGAL_VERSION_NR @CGAL_CREATED_VERSION_NR@
|
|
||||||
#define CGAL_SVN_REVISION @CGAL_CREATED_SVN_REVISION@
|
|
||||||
|
|
||||||
#define CGAL_RELEASE_DATE @CGAL_CREATED_RELEASE_DATE@
|
|
||||||
|
|
||||||
#include <CGAL/version_macros.h>
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,28 +0,0 @@
|
||||||
set(list_of_whitelisted_headers_txt [=[
|
|
||||||
CGAL/Linear_cell_complex_constructors.h
|
|
||||||
CGAL/CGAL_Ipelet_base.h
|
|
||||||
CGAL/IO/read_las_points.h
|
|
||||||
CGAL/IO/write_las_points.h
|
|
||||||
CGAL/IO/read_ply_points.h
|
|
||||||
CGAL/IO/write_ply_points.h
|
|
||||||
CGAL/Surface_mesh_parameterization/internal/shortest_path.h
|
|
||||||
CGAL/Three/exceptions.h
|
|
||||||
CGAL/Three/Polyhedron_demo_plugin_interface.h
|
|
||||||
CGAL/Three/Scene_interface.h
|
|
||||||
CGAL/Three/Scene_item_with_properties.h
|
|
||||||
CGAL/Three/Scene_zoomable_item_interface.h
|
|
||||||
CGAL/Three/Viewer_interface.h
|
|
||||||
CGAL/Three/Polyhedron_demo_io_plugin_interface.h
|
|
||||||
CGAL/Three/Scene_draw_interface.h
|
|
||||||
CGAL/Three/Scene_item_config.h
|
|
||||||
CGAL/Three/Scene_print_item_interface.h
|
|
||||||
CGAL/Three/TextRenderer.h
|
|
||||||
CGAL/Three/Polyhedron_demo_plugin_helper.h
|
|
||||||
CGAL/Three/Scene_group_item.h
|
|
||||||
CGAL/Three/Scene_item.h
|
|
||||||
CGAL/Three/Scene_transparent_interface.h
|
|
||||||
CGAL/Three/Viewer_config.h
|
|
||||||
|
|
||||||
]=])
|
|
||||||
|
|
||||||
separate_arguments(list_of_whitelisted_headers UNIX_COMMAND ${list_of_whitelisted_headers_txt})
|
|
|
@ -1,26 +0,0 @@
|
||||||
if(NOT CMD OR NOT EXISTS ${CMD})
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"The variable `CMD` should be defined to the test program to run!")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT CIN OR NOT EXISTS ${CIN})
|
|
||||||
message(FATAL_ERROR
|
|
||||||
"The variable `CIN` should be defined to the input file for the test!")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ANDROID)
|
|
||||||
execute_process(
|
|
||||||
COMMAND adb shell "cd ${ANDROID_DIR_PREFIX}${PROJECT_NAME} && ${ANDROID_DIR_PREFIX}${CMD}"
|
|
||||||
INPUT_FILE ${CIN}
|
|
||||||
RESULT_VARIABLE error_result)
|
|
||||||
else()
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${CMD}
|
|
||||||
INPUT_FILE ${CIN}
|
|
||||||
RESULT_VARIABLE error_result)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(error_result)
|
|
||||||
message(SEND_ERROR
|
|
||||||
"The test `${CMD} < ${CIN}` ended with the error code ${error_result}.")
|
|
||||||
endif()
|
|
|
@ -1,33 +0,0 @@
|
||||||
// Copyright (c) 2010 Inria Lorraine (France). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author: Luis Peñaranda <luis.penaranda@gmx.com>
|
|
||||||
|
|
||||||
#include <mpfi.h>
|
|
||||||
|
|
||||||
int main(){
|
|
||||||
mpfi_t a;
|
|
||||||
mpfi_init_set_si(a,-100);
|
|
||||||
mpfi_add_ui(a,a,101);
|
|
||||||
if(mpfi_cmp_ui(a,1)==0) {
|
|
||||||
mpfi_clear(a);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
The following files have been copied from Qt Free Edition version 4.4:
|
|
||||||
fileNew.png
|
|
||||||
fileOpen.png
|
|
||||||
fileSave.png,
|
|
||||||
fit-page-32.png
|
|
|
@ -1,185 +0,0 @@
|
||||||
// Copyright (c) 2012 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sebastien Loriot
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CGAL_AABB_FACE_GRAPH_TRIANGLE_PRIMITIVE_H
|
|
||||||
#define CGAL_AABB_FACE_GRAPH_TRIANGLE_PRIMITIVE_H
|
|
||||||
|
|
||||||
#include <CGAL/license/AABB_tree.h>
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#include <CGAL/AABB_primitive.h>
|
|
||||||
#include <CGAL/boost/graph/property_maps.h>
|
|
||||||
#include <CGAL/Default.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \ingroup PkgAABB_tree
|
|
||||||
* Primitive type for a facet of a polyhedral surface.
|
|
||||||
* It wraps a handle to a facet of a polyhedron to a 3D triangle.
|
|
||||||
* The polyhedron from which the primitive is built should not be deleted
|
|
||||||
* while the AABB tree holding the primitive is in use.
|
|
||||||
* The triangle type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Triangle_3`.
|
|
||||||
*
|
|
||||||
* \cgalModels `AABBPrimitiveWithSharedData`
|
|
||||||
*
|
|
||||||
*\tparam FaceGraph is a model of the face graph concept.
|
|
||||||
*\tparam VertexPointPMap is a property map with `boost::graph_traits<FaceGraph>::%vertex_descriptor`
|
|
||||||
* as key type and a \cgal Kernel `Point_3` as value type.
|
|
||||||
* The default is `typename boost::property_map< FaceGraph,vertex_point_t>::%type`.
|
|
||||||
*\tparam OneFaceGraphPerTree is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
|
||||||
* In the former case, we guarantee that all the primitives will be from a
|
|
||||||
* common `FaceGraph` and some data will be factorized so that the size of
|
|
||||||
* the primitive is reduced. In the latter case, the primitives can be from
|
|
||||||
* different graphs and extra storage is required in the primitives. The default is `CGAL::Tag_true`.
|
|
||||||
*\tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case, the datum is stored
|
|
||||||
* in the primitive, while in the latter it is constructed on the fly to reduce the memory footprint.
|
|
||||||
* The default is `CGAL::Tag_false` (datum is not stored).
|
|
||||||
*\sa `AABBPrimitive`
|
|
||||||
*\sa `AABB_primitive<Id,ObjectPropertyMap,PointPropertyMapPolyhedron,ExternalPropertyMaps,CacheDatum>`
|
|
||||||
*\sa `AABB_halfedge_graph_segment_primitive<HalfedgeGraph,OneHalfedgeGraphPerTree,CacheDatum>`
|
|
||||||
*/
|
|
||||||
template < class FaceGraph,
|
|
||||||
class VertexPointPMap = Default,
|
|
||||||
class OneFaceGraphPerTree = Tag_true,
|
|
||||||
class CacheDatum=Tag_false >
|
|
||||||
class AABB_face_graph_triangle_primitive
|
|
||||||
#ifndef DOXYGEN_RUNNING
|
|
||||||
: public AABB_primitive<typename boost::graph_traits<FaceGraph>::face_descriptor,
|
|
||||||
Triangle_from_face_descriptor_map<
|
|
||||||
FaceGraph,
|
|
||||||
typename Default::Get<VertexPointPMap,
|
|
||||||
typename boost::property_map< FaceGraph,
|
|
||||||
vertex_point_t>::type >::type>,
|
|
||||||
One_point_from_face_descriptor_map<
|
|
||||||
FaceGraph,
|
|
||||||
typename Default::Get<VertexPointPMap,
|
|
||||||
typename boost::property_map< FaceGraph,
|
|
||||||
vertex_point_t>::type >::type>,
|
|
||||||
OneFaceGraphPerTree,
|
|
||||||
CacheDatum >
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
typedef typename Default::Get<VertexPointPMap, typename boost::property_map< FaceGraph, vertex_point_t>::type >::type VertexPointPMap_;
|
|
||||||
|
|
||||||
typedef typename boost::graph_traits<FaceGraph>::face_descriptor Id_;
|
|
||||||
typedef Triangle_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Triangle_property_map;
|
|
||||||
typedef One_point_from_face_descriptor_map<FaceGraph,VertexPointPMap_> Point_property_map;
|
|
||||||
|
|
||||||
typedef AABB_primitive< Id_,
|
|
||||||
Triangle_property_map,
|
|
||||||
Point_property_map,
|
|
||||||
OneFaceGraphPerTree,
|
|
||||||
CacheDatum > Base;
|
|
||||||
|
|
||||||
public:
|
|
||||||
#ifdef DOXYGEN_RUNNING
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
The point type.
|
|
||||||
*/
|
|
||||||
typedef boost::property_traits<VertexPointPMap>::value_type Point;
|
|
||||||
/*!
|
|
||||||
Geometric data type.
|
|
||||||
*/
|
|
||||||
typedef Kernel_traits<Point>::Kernel::Triangle_3 Datum;
|
|
||||||
/*!
|
|
||||||
Id type.
|
|
||||||
*/
|
|
||||||
typedef boost::graph_traits<FaceGraph>::face_descriptor Id;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
If `OneFaceGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the polyhedon `graph`.
|
|
||||||
*/
|
|
||||||
static unspecified_type construct_shared_data( FaceGraph& graph );
|
|
||||||
#else
|
|
||||||
typedef typename Base::Id Id;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// constructors
|
|
||||||
/*!
|
|
||||||
\tparam Iterator an input iterator with `Id` as value type.
|
|
||||||
Constructs a primitive.
|
|
||||||
If `VertexPointPMap` is the default of the class, an additional constructor
|
|
||||||
is available with `vppm` set to `get(vertex_point, graph)`.
|
|
||||||
*/
|
|
||||||
template <class Iterator>
|
|
||||||
AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph, VertexPointPMap_ vppm)
|
|
||||||
: Base( Id_(*it),
|
|
||||||
Triangle_property_map(const_cast<FaceGraph*>(&graph),vppm),
|
|
||||||
Point_property_map(const_cast<FaceGraph*>(&graph),vppm) )
|
|
||||||
{}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Constructs a primitive.
|
|
||||||
If `VertexPointPMap` is the default of the class, an additional constructor
|
|
||||||
is available with `vppm` set to `get(vertex_point, graph)`.
|
|
||||||
*/
|
|
||||||
AABB_face_graph_triangle_primitive(Id id, const FaceGraph& graph, VertexPointPMap_ vppm)
|
|
||||||
: Base( Id_(id),
|
|
||||||
Triangle_property_map(const_cast<FaceGraph*>(&graph),vppm),
|
|
||||||
Point_property_map(const_cast<FaceGraph*>(&graph),vppm) )
|
|
||||||
{}
|
|
||||||
|
|
||||||
#ifndef DOXYGEN_RUNNING
|
|
||||||
template <class Iterator>
|
|
||||||
AABB_face_graph_triangle_primitive(Iterator it, const FaceGraph& graph)
|
|
||||||
: Base( Id_(*it),
|
|
||||||
Triangle_property_map(const_cast<FaceGraph*>(&graph)),
|
|
||||||
Point_property_map(const_cast<FaceGraph*>(&graph)) )
|
|
||||||
{}
|
|
||||||
|
|
||||||
AABB_face_graph_triangle_primitive(Id id, const FaceGraph& graph)
|
|
||||||
: Base( Id_(id),
|
|
||||||
Triangle_property_map(const_cast<FaceGraph*>(&graph)),
|
|
||||||
Point_property_map(const_cast<FaceGraph*>(&graph)) )
|
|
||||||
{}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \internal
|
|
||||||
typedef internal::Cstr_shared_data<FaceGraph, Base, Triangle_property_map, Point_property_map, OneFaceGraphPerTree> Cstr_shared_data;
|
|
||||||
/// \internal
|
|
||||||
static
|
|
||||||
typename Cstr_shared_data::Shared_data
|
|
||||||
construct_shared_data(const FaceGraph& graph)
|
|
||||||
{
|
|
||||||
return Cstr_shared_data::construct_shared_data(const_cast<FaceGraph&>(graph));
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
typename Cstr_shared_data::Shared_data
|
|
||||||
construct_shared_data(const FaceGraph& graph, const VertexPointPMap_& vpm)
|
|
||||||
{
|
|
||||||
return Cstr_shared_data::construct_shared_data(const_cast<FaceGraph&>(graph), vpm);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_AABB_FACE_GRAPH_TRIANGLE_PRIMITIVE_H
|
|
||||||
|
|
|
@ -1,197 +0,0 @@
|
||||||
// Copyright (c) 2012 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Sebastien Loriot
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CGAL_AABB_HALFEDGE_GRAPH_SEGMENT_PRIMITIVE_H
|
|
||||||
#define CGAL_AABB_HALFEDGE_GRAPH_SEGMENT_PRIMITIVE_H
|
|
||||||
|
|
||||||
#include <CGAL/license/AABB_tree.h>
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#include <CGAL/AABB_primitive.h>
|
|
||||||
#include <CGAL/boost/graph/property_maps.h>
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
#include <boost/mpl/and.hpp>
|
|
||||||
#include <CGAL/is_iterator.h>
|
|
||||||
#include <boost/type_traits/is_convertible.hpp>
|
|
||||||
#include <boost/utility/enable_if.hpp>
|
|
||||||
|
|
||||||
#include <CGAL/Default.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \ingroup PkgAABB_tree
|
|
||||||
* Primitive type for a edge of a polyhedral surface.
|
|
||||||
* It wraps an `edge_descriptor` into a 3D segment.
|
|
||||||
* The class model of `HalfedgeGraph` from which the primitive is built should not be deleted
|
|
||||||
* while the AABB tree holding the primitive is in use.
|
|
||||||
* The type of the 3D segment is taken from the kernel of the point type which is the value type
|
|
||||||
* of `VertexPointPMap` (using the `Kernel_traits` mechanism).
|
|
||||||
* The segment type of the primitive (`Datum`) is `CGAL::Kernel_traits< boost::property_traits< VertexPointPMap >::%value_type >::%Kernel::Segment_3`.
|
|
||||||
*
|
|
||||||
* \cgalModels `AABBPrimitive` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_false`,
|
|
||||||
* and `AABBPrimitiveWithSharedData` if `OneHalfedgeGraphPerTree` is `CGAL::Tag_true`.
|
|
||||||
*
|
|
||||||
* \tparam HalfedgeGraph is a model of the halfedge graph concept.
|
|
||||||
* as key type and a \cgal Kernel `Point_3` as value type.
|
|
||||||
* \tparam VertexPointPMap is a property map with `boost::graph_traits<HalfedgeGraph>::%vertex_descriptor`.
|
|
||||||
* The default is `typename boost::property_map< HalfedgeGraph,vertex_point_t>::%type`.
|
|
||||||
* \tparam OneHalfedgeGraphPerTree is either `CGAL::Tag_true` or `CGAL::Tag_false`.
|
|
||||||
* In the former case, we guarantee that all the primitives will be from a
|
|
||||||
* common `HalfedgeGraph` and some data will be factorized so that the size of
|
|
||||||
* the primitive is reduced. In the latter case, the primitives can be from
|
|
||||||
* different graphs and extra storage is required in the primitives. The default is `CGAL::Tag_true`.
|
|
||||||
* \tparam CacheDatum is either `CGAL::Tag_true` or `CGAL::Tag_false`. In the former case, the datum is
|
|
||||||
* stored in the primitive, while in the latter it is constructed on the fly to reduce
|
|
||||||
* the memory footprint. The default is `CGAL::Tag_false` (datum is not stored).
|
|
||||||
*
|
|
||||||
* \sa `AABBPrimitive`
|
|
||||||
* \sa `AABB_primitive<Id,ObjectPropertyMap,PointPropertyMapPolyhedron,ExternalPropertyMaps,CacheDatum>`
|
|
||||||
* \sa `AABB_face_graph_triangle_primitive<FaceGraph,OneFaceGraphPerTree,CacheDatum>`
|
|
||||||
* \sa \link BGLPolyGT `boost::graph_traits<Polyhedron>` \endlink
|
|
||||||
*/
|
|
||||||
template < class HalfedgeGraph,
|
|
||||||
class VertexPointPMap = Default,
|
|
||||||
class OneHalfedgeGraphPerTree = Tag_true,
|
|
||||||
class CacheDatum = Tag_false >
|
|
||||||
class AABB_halfedge_graph_segment_primitive
|
|
||||||
#ifndef DOXYGEN_RUNNING
|
|
||||||
: public AABB_primitive< typename boost::graph_traits<HalfedgeGraph>::edge_descriptor,
|
|
||||||
Segment_from_edge_descriptor_map<
|
|
||||||
HalfedgeGraph,
|
|
||||||
typename Default::Get<VertexPointPMap,
|
|
||||||
typename boost::property_map< HalfedgeGraph,
|
|
||||||
vertex_point_t>::type >::type >,
|
|
||||||
Source_point_from_edge_descriptor_map<
|
|
||||||
HalfedgeGraph,
|
|
||||||
typename Default::Get<VertexPointPMap,
|
|
||||||
typename boost::property_map< HalfedgeGraph,
|
|
||||||
vertex_point_t>::type >::type >,
|
|
||||||
OneHalfedgeGraphPerTree,
|
|
||||||
CacheDatum >
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
typedef typename Default::Get<VertexPointPMap,typename boost::property_map< HalfedgeGraph,vertex_point_t>::type >::type VertexPointPMap_;
|
|
||||||
|
|
||||||
typedef typename boost::graph_traits<HalfedgeGraph>::edge_descriptor Id_;
|
|
||||||
typedef Segment_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Segment_property_map;
|
|
||||||
typedef Source_point_from_edge_descriptor_map<HalfedgeGraph,VertexPointPMap_> Point_property_map;
|
|
||||||
|
|
||||||
typedef AABB_primitive< Id_,
|
|
||||||
Segment_property_map,
|
|
||||||
Point_property_map,
|
|
||||||
OneHalfedgeGraphPerTree,
|
|
||||||
CacheDatum > Base;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
#ifdef DOXYGEN_RUNNING
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
/*!
|
|
||||||
The point type.
|
|
||||||
*/
|
|
||||||
typedef boost::property_traits< boost::property_map< HalfedgeGraph, vertex_point_t>::type >::value_type Point;
|
|
||||||
/*!
|
|
||||||
Geometric data type.
|
|
||||||
*/
|
|
||||||
typedef Kernel_traits<Point>::Kernel::Segment_3 Datum;
|
|
||||||
/*!
|
|
||||||
Id type.
|
|
||||||
*/
|
|
||||||
typedef boost::graph_traits<HalfedgeGraph>::edge_descriptor Id;
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
If `OneHalfedgeGraphPerTreeGraphPerTree` is CGAL::Tag_true, constructs a `Shared_data` object from a reference to the halfedge graph.
|
|
||||||
*/
|
|
||||||
static unspecified_type construct_shared_data( HalfedgeGraph& graph );
|
|
||||||
#else
|
|
||||||
typedef typename Base::Id Id;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Constructs a primitive.
|
|
||||||
\tparam Iterator is an input iterator with `Id` as value type.
|
|
||||||
This \ref AABB_tree/AABB_halfedge_graph_edge_example.cpp "example" gives a way to call this constructor
|
|
||||||
using the insert-by-range method of the class `AABB_tree<Traits>`.
|
|
||||||
If `VertexPointPMap` is the default of the class, an additional constructor
|
|
||||||
is available with `vppm` set to `boost::get(vertex_point, graph)`.
|
|
||||||
*/
|
|
||||||
template <class Iterator>
|
|
||||||
AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph, VertexPointPMap_ vppm)
|
|
||||||
: Base( Id_(*it),
|
|
||||||
Segment_property_map(const_cast<HalfedgeGraph*>(&graph), vppm),
|
|
||||||
Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) )
|
|
||||||
{}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Constructs a primitive.
|
|
||||||
If `VertexPointPMap` is the default of the class, an additional constructor
|
|
||||||
is available with `vppm` set to `boost::get(vertex_point, graph)`.
|
|
||||||
*/
|
|
||||||
AABB_halfedge_graph_segment_primitive(Id id, const HalfedgeGraph& graph, VertexPointPMap_ vppm)
|
|
||||||
: Base( Id_(id),
|
|
||||||
Segment_property_map(const_cast<HalfedgeGraph*>(&graph), vppm),
|
|
||||||
Point_property_map(const_cast<HalfedgeGraph*>(&graph), vppm) )
|
|
||||||
{}
|
|
||||||
|
|
||||||
#ifndef DOXYGEN_RUNNING
|
|
||||||
template <class Iterator>
|
|
||||||
AABB_halfedge_graph_segment_primitive(Iterator it, const HalfedgeGraph& graph)
|
|
||||||
: Base( Id_(*it),
|
|
||||||
Segment_property_map(const_cast<HalfedgeGraph*>(&graph)),
|
|
||||||
Point_property_map(const_cast<HalfedgeGraph*>(&graph)) ){}
|
|
||||||
|
|
||||||
AABB_halfedge_graph_segment_primitive(Id id, const HalfedgeGraph& graph)
|
|
||||||
: Base( Id_(id),
|
|
||||||
Segment_property_map(const_cast<HalfedgeGraph*>(&graph)),
|
|
||||||
Point_property_map(const_cast<HalfedgeGraph*>(&graph)) ){}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \internal
|
|
||||||
typedef internal::Cstr_shared_data<HalfedgeGraph, Base, Segment_property_map, Point_property_map, OneHalfedgeGraphPerTree> Cstr_shared_data;
|
|
||||||
/// \internal
|
|
||||||
static
|
|
||||||
typename Cstr_shared_data::Shared_data
|
|
||||||
construct_shared_data(const HalfedgeGraph& graph)
|
|
||||||
{
|
|
||||||
return Cstr_shared_data::construct_shared_data(const_cast<HalfedgeGraph&>(graph));
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
typename Cstr_shared_data::Shared_data
|
|
||||||
construct_shared_data(const HalfedgeGraph& graph, const VertexPointPMap_& vpm)
|
|
||||||
{
|
|
||||||
return Cstr_shared_data::construct_shared_data(const_cast<HalfedgeGraph&>(graph), vpm);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_AABB_HALFEDGE_GRAPH_SEGMENT_PRIMITIVE_H
|
|
||||||
|
|
|
@ -1,549 +0,0 @@
|
||||||
// Copyright (c) 2009 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Stéphane Tayeb, Pierre Alliez, Camille Wormser
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef CGAL_AABB_TRAITS_H_
|
|
||||||
#define CGAL_AABB_TRAITS_H_
|
|
||||||
|
|
||||||
#include <CGAL/license/AABB_tree.h>
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#include <CGAL/Bbox_3.h>
|
|
||||||
#include <CGAL/Default.h>
|
|
||||||
#include <CGAL/intersections.h>
|
|
||||||
#include <CGAL/internal/AABB_tree/Has_nested_type_Shared_data.h>
|
|
||||||
#include <CGAL/internal/AABB_tree/Is_ray_intersection_geomtraits.h>
|
|
||||||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
/// \file AABB_traits.h
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal{ namespace AABB_tree {
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct Remove_optional { typedef T type; };
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
struct Remove_optional< ::boost::optional<T> > { typedef T type; };
|
|
||||||
|
|
||||||
//helper controlling whether extra data should be stored in the AABB_tree traits class
|
|
||||||
template <class Primitive, bool has_shared_data=Has_nested_type_Shared_data<Primitive>::value>
|
|
||||||
struct AABB_traits_base;
|
|
||||||
|
|
||||||
template <class Primitive>
|
|
||||||
struct AABB_traits_base<Primitive,false>{};
|
|
||||||
|
|
||||||
template <class Primitive>
|
|
||||||
struct AABB_traits_base<Primitive,true>{
|
|
||||||
typename Primitive::Shared_data m_primitive_data;
|
|
||||||
|
|
||||||
#if !defined(CGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES) && !defined(CGAL_CFG_NO_CPP0X_RVALUE_REFERENCE)
|
|
||||||
template <typename ... T>
|
|
||||||
void set_shared_data(T&& ... t){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(std::forward<T>(t)...);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void set_shared_data(){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data();
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T1>
|
|
||||||
void set_shared_data(T1& t1){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(t1);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T1,class T2>
|
|
||||||
void set_shared_data(T1& t1, T2& t2){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(t1,t2);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T1,class T2,class T3>
|
|
||||||
void set_shared_data(T1& t1,T2& t2,T3& t3){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T1,class T2,class T3,class T4>
|
|
||||||
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class T1,class T2,class T3,class T4,class T5>
|
|
||||||
void set_shared_data(T1& t1,T2& t2,T3& t3,T4& t4,T5& t5){
|
|
||||||
m_primitive_data=Primitive::construct_shared_data(t1,t2,t3,t4,t5);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
const typename Primitive::Shared_data& shared_data() const {return m_primitive_data;}
|
|
||||||
};
|
|
||||||
|
|
||||||
// AABB_traits_base_2 brings in the Intersection_distance predicate,
|
|
||||||
// if GeomTraits is a model RayIntersectionGeomTraits.
|
|
||||||
template <typename GeomTraits, bool ray_intersection_geom_traits=Is_ray_intersection_geomtraits<GeomTraits>::value>
|
|
||||||
struct AABB_traits_base_2;
|
|
||||||
|
|
||||||
template <typename GeomTraits>
|
|
||||||
struct AABB_traits_base_2<GeomTraits,false>{};
|
|
||||||
|
|
||||||
template <typename GeomTraits>
|
|
||||||
struct AABB_traits_base_2<GeomTraits,true>{
|
|
||||||
typedef typename GeomTraits::Ray_3 Ray_3;
|
|
||||||
typedef typename GeomTraits::Point_3 Point_3;
|
|
||||||
typedef typename GeomTraits::Vector_3 Vector_3;
|
|
||||||
typedef typename GeomTraits::FT FT;
|
|
||||||
typedef typename GeomTraits::Cartesian_const_iterator_3 Cartesian_const_iterator_3;
|
|
||||||
typedef typename GeomTraits::Construct_cartesian_const_iterator_3 Construct_cartesian_const_iterator_3;
|
|
||||||
typedef typename GeomTraits::Construct_source_3 Construct_source_3;
|
|
||||||
typedef typename GeomTraits::Construct_vector_3 Construct_vector_3;
|
|
||||||
|
|
||||||
// Defining Bounding_box and other types from the full AABB_traits
|
|
||||||
// here is might seem strange, but otherwise we would need to use
|
|
||||||
// CRTP to get access to the derived class, which would bloat the
|
|
||||||
// code more.
|
|
||||||
typedef typename CGAL::Bbox_3 Bounding_box;
|
|
||||||
|
|
||||||
struct Intersection_distance {
|
|
||||||
boost::optional<FT> operator()(const Ray_3& ray, const Bounding_box& bbox) const {
|
|
||||||
FT t_near = -DBL_MAX; // std::numeric_limits<FT>::lowest(); C++1903
|
|
||||||
FT t_far = DBL_MAX;
|
|
||||||
|
|
||||||
const Construct_cartesian_const_iterator_3 construct_cartesian_const_iterator_3
|
|
||||||
= GeomTraits().construct_cartesian_const_iterator_3_object();
|
|
||||||
const Construct_source_3 construct_source_3 = GeomTraits().construct_source_3_object();
|
|
||||||
const Construct_vector_3 construct_vector_3 = GeomTraits().construct_vector_3_object();
|
|
||||||
const Point_3 source = construct_source_3(ray);
|
|
||||||
const Vector_3 direction = construct_vector_3(ray);
|
|
||||||
Cartesian_const_iterator_3 source_iter = construct_cartesian_const_iterator_3(source);
|
|
||||||
Cartesian_const_iterator_3 direction_iter = construct_cartesian_const_iterator_3(direction);
|
|
||||||
|
|
||||||
for(int i = 0; i < 3; ++i, ++source_iter, ++direction_iter) {
|
|
||||||
if(*direction_iter == 0) {
|
|
||||||
if((*source_iter < (bbox.min)(i)) || (*source_iter > (bbox.max)(i))) {
|
|
||||||
return boost::none;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
FT t1 = ((bbox.min)(i) - *source_iter) / *direction_iter;
|
|
||||||
FT t2 = ((bbox.max)(i) - *source_iter) / *direction_iter;
|
|
||||||
|
|
||||||
t_near = (std::max)(t_near, (std::min)(t1, t2));
|
|
||||||
t_far = (std::min)(t_far, (std::max)(t1, t2));
|
|
||||||
|
|
||||||
// if(t1 > t2)
|
|
||||||
// std::swap(t1, t2);
|
|
||||||
// if(t1 > t_near)
|
|
||||||
// t_near = t1;
|
|
||||||
// if(t2 < t_far)
|
|
||||||
// t_far = t2;
|
|
||||||
|
|
||||||
if(t_near > t_far || t_far < FT(0.))
|
|
||||||
return boost::none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(t_near < FT(0.))
|
|
||||||
return FT(0.);
|
|
||||||
else
|
|
||||||
return t_near;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Intersection_distance intersection_distance_object() const { return Intersection_distance(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
} } //end of namespace internal::AABB_tree
|
|
||||||
|
|
||||||
/// \addtogroup PkgAABB_tree
|
|
||||||
/// @{
|
|
||||||
|
|
||||||
/// This traits class handles any type of 3D geometric
|
|
||||||
/// primitives provided that the proper intersection tests and
|
|
||||||
/// constructions are implemented. It handles points, rays, lines and
|
|
||||||
/// segments as query types for intersection detection and
|
|
||||||
/// computations, and it handles points as query type for distance
|
|
||||||
/// queries.
|
|
||||||
///
|
|
||||||
/// \cgalModels AABBTraits
|
|
||||||
/// \cgalModels AABBRayIntersectionTraits
|
|
||||||
|
|
||||||
/// \tparam GeomTraits must be a model of the concept \ref AABBGeomTraits,
|
|
||||||
/// and provide the geometric types as well as the intersection tests and computations.
|
|
||||||
/// \tparam Primitive provide the type of primitives stored in the AABB_tree.
|
|
||||||
/// It is a model of the concept `AABBPrimitive` or `AABBPrimitiveWithSharedData`.
|
|
||||||
///
|
|
||||||
/// \tparam BboxMap must be a model of `ReadablePropertyMap` that has as key type a primitive id,
|
|
||||||
/// and as value type a `Bounding_box`.
|
|
||||||
/// If the type is `Default` the `Datum` must have the
|
|
||||||
/// member function `bbox()` that returns the bounding box of the primitive.
|
|
||||||
///
|
|
||||||
/// If the argument `GeomTraits` is a model of the concept \ref
|
|
||||||
/// AABBRayIntersectionGeomTraits, this class is also a model of \ref
|
|
||||||
/// AABBRayIntersectionTraits.
|
|
||||||
///
|
|
||||||
/// \sa `AABBTraits`
|
|
||||||
/// \sa `AABB_tree`
|
|
||||||
/// \sa `AABBPrimitive`
|
|
||||||
/// \sa `AABBPrimitiveWithSharedData`
|
|
||||||
|
|
||||||
template<typename GeomTraits, typename AABBPrimitive, typename BboxMap = Default>
|
|
||||||
class AABB_traits:
|
|
||||||
public internal::AABB_tree::AABB_traits_base<AABBPrimitive>,
|
|
||||||
public internal::AABB_tree::AABB_traits_base_2<GeomTraits>
|
|
||||||
{
|
|
||||||
typedef typename CGAL::Object Object;
|
|
||||||
public:
|
|
||||||
typedef GeomTraits Geom_traits;
|
|
||||||
|
|
||||||
typedef AABB_traits<GeomTraits, AABBPrimitive, BboxMap> AT;
|
|
||||||
// AABBTraits concept types
|
|
||||||
typedef typename GeomTraits::FT FT;
|
|
||||||
typedef AABBPrimitive Primitive;
|
|
||||||
|
|
||||||
typedef typename std::pair<Object,typename Primitive::Id> Object_and_primitive_id;
|
|
||||||
|
|
||||||
typedef typename std::pair<typename GeomTraits::Point_3, typename Primitive::Id> Point_and_primitive_id;
|
|
||||||
|
|
||||||
/// `Intersection_and_primitive_id<Query>::%Type::first_type` is found according to
|
|
||||||
/// the result type of `GeomTraits::Intersect_3::operator()`,
|
|
||||||
/// (that is cpp11::result_of<GeomTraits::Intersect_3(Query, Primitive::Datum)>::type). If it is
|
|
||||||
/// `boost::optional<T>` then it is `T`, and the result type otherwise.
|
|
||||||
template<typename Query>
|
|
||||||
struct Intersection_and_primitive_id {
|
|
||||||
typedef typename cpp11::result_of<
|
|
||||||
typename GeomTraits::Intersect_3(Query, typename Primitive::Datum)
|
|
||||||
>::type Intersection_type;
|
|
||||||
|
|
||||||
typedef std::pair<
|
|
||||||
typename internal::AABB_tree::Remove_optional<Intersection_type>::type,
|
|
||||||
typename Primitive::Id > Type;
|
|
||||||
};
|
|
||||||
|
|
||||||
// types for search tree
|
|
||||||
/// \name Types
|
|
||||||
/// @{
|
|
||||||
|
|
||||||
/// Point query type.
|
|
||||||
typedef typename GeomTraits::Point_3 Point_3;
|
|
||||||
|
|
||||||
/// additionnal types for the search tree, required by the RangeSearchTraits concept
|
|
||||||
/// \bug This is not documented for now in the AABBTraits concept.
|
|
||||||
typedef typename GeomTraits::Iso_cuboid_3 Iso_cuboid_3;
|
|
||||||
|
|
||||||
/// Bounding box type.
|
|
||||||
typedef typename CGAL::Bbox_3 Bounding_box;
|
|
||||||
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
typedef typename GeomTraits::Sphere_3 Sphere_3;
|
|
||||||
typedef typename GeomTraits::Cartesian_const_iterator_3 Cartesian_const_iterator_3;
|
|
||||||
typedef typename GeomTraits::Construct_cartesian_const_iterator_3 Construct_cartesian_const_iterator_3;
|
|
||||||
typedef typename GeomTraits::Construct_center_3 Construct_center_3;
|
|
||||||
typedef typename GeomTraits::Compute_squared_radius_3 Compute_squared_radius_3;
|
|
||||||
typedef typename GeomTraits::Construct_min_vertex_3 Construct_min_vertex_3;
|
|
||||||
typedef typename GeomTraits::Construct_max_vertex_3 Construct_max_vertex_3;
|
|
||||||
typedef typename GeomTraits::Construct_iso_cuboid_3 Construct_iso_cuboid_3;
|
|
||||||
|
|
||||||
BboxMap bbm;
|
|
||||||
|
|
||||||
/// Default constructor.
|
|
||||||
AABB_traits() { }
|
|
||||||
|
|
||||||
AABB_traits(BboxMap bbm)
|
|
||||||
: bbm(bbm)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
typedef typename GeomTraits::Compute_squared_distance_3 Squared_distance;
|
|
||||||
Squared_distance squared_distance_object() const { return GeomTraits().compute_squared_distance_3_object(); }
|
|
||||||
|
|
||||||
typedef typename GeomTraits::Equal_3 Equal_3;
|
|
||||||
Equal_3 equal_3_object() const { return GeomTraits().equal_3_object(); }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
* @brief Sorts [first,beyond[
|
|
||||||
* @param first iterator on first element
|
|
||||||
* @param beyond iterator on beyond element
|
|
||||||
* @param bbox the bounding box of [first,beyond[
|
|
||||||
*
|
|
||||||
* Sorts the range defined by [first,beyond[. Sort is achieved on bbox longuest
|
|
||||||
* axis, using the comparison function `<dim>_less_than` (dim in {x,y,z})
|
|
||||||
*/
|
|
||||||
class Sort_primitives
|
|
||||||
{
|
|
||||||
typedef AABB_traits<GeomTraits,AABBPrimitive,BboxMap> Traits;
|
|
||||||
const Traits& m_traits;
|
|
||||||
public:
|
|
||||||
Sort_primitives(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
|
||||||
: m_traits(traits) {}
|
|
||||||
|
|
||||||
template<typename PrimitiveIterator>
|
|
||||||
void operator()(PrimitiveIterator first,
|
|
||||||
PrimitiveIterator beyond,
|
|
||||||
const typename AT::Bounding_box& bbox) const
|
|
||||||
{
|
|
||||||
PrimitiveIterator middle = first + (beyond - first)/2;
|
|
||||||
switch(Traits::longest_axis(bbox))
|
|
||||||
{
|
|
||||||
case AT::CGAL_AXIS_X: // sort along x
|
|
||||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits));
|
|
||||||
break;
|
|
||||||
case AT::CGAL_AXIS_Y: // sort along y
|
|
||||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits));
|
|
||||||
break;
|
|
||||||
case AT::CGAL_AXIS_Z: // sort along z
|
|
||||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits));
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
CGAL_error();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Sort_primitives sort_primitives_object() const {return Sort_primitives(*this);}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Computes the bounding box of a set of primitives
|
|
||||||
* @param first an iterator on the first primitive
|
|
||||||
* @param beyond an iterator on the past-the-end primitive
|
|
||||||
* @return the bounding box of the primitives of the iterator range
|
|
||||||
*/
|
|
||||||
class Compute_bbox {
|
|
||||||
const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& m_traits;
|
|
||||||
public:
|
|
||||||
Compute_bbox(const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
:m_traits (traits) {}
|
|
||||||
|
|
||||||
template<typename ConstPrimitiveIterator>
|
|
||||||
typename AT::Bounding_box operator()(ConstPrimitiveIterator first,
|
|
||||||
ConstPrimitiveIterator beyond) const
|
|
||||||
{
|
|
||||||
typename AT::Bounding_box bbox = m_traits.compute_bbox(*first,m_traits.bbm);
|
|
||||||
for(++first; first != beyond; ++first)
|
|
||||||
{
|
|
||||||
bbox = bbox + m_traits.compute_bbox(*first,m_traits.bbm);
|
|
||||||
}
|
|
||||||
return bbox;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
Compute_bbox compute_bbox_object() const {return Compute_bbox(*this);}
|
|
||||||
|
|
||||||
|
|
||||||
class Do_intersect {
|
|
||||||
const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& m_traits;
|
|
||||||
public:
|
|
||||||
Do_intersect(const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
:m_traits(traits) {}
|
|
||||||
|
|
||||||
template<typename Query>
|
|
||||||
bool operator()(const Query& q, const Bounding_box& bbox) const
|
|
||||||
{
|
|
||||||
return CGAL::do_intersect(q, bbox);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Query>
|
|
||||||
bool operator()(const Query& q, const Primitive& pr) const
|
|
||||||
{
|
|
||||||
return GeomTraits().do_intersect_3_object()(q, internal::Primitive_helper<AT>::get_datum(pr,m_traits));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Do_intersect do_intersect_object() const {return Do_intersect(*this);}
|
|
||||||
|
|
||||||
class Intersection {
|
|
||||||
const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& m_traits;
|
|
||||||
public:
|
|
||||||
Intersection(const AABB_traits<GeomTraits,AABBPrimitive,BboxMap>& traits)
|
|
||||||
:m_traits(traits) {}
|
|
||||||
#if CGAL_INTERSECTION_VERSION < 2
|
|
||||||
template<typename Query>
|
|
||||||
boost::optional<typename AT::Object_and_primitive_id>
|
|
||||||
operator()(const Query& query, const typename AT::Primitive& primitive) const
|
|
||||||
{
|
|
||||||
typedef boost::optional<Object_and_primitive_id> Intersection;
|
|
||||||
|
|
||||||
CGAL::Object object = GeomTraits().intersect_3_object()(internal::Primitive_helper<AT>::get_datum(primitive,m_traits),query);
|
|
||||||
if ( object.empty() )
|
|
||||||
return Intersection();
|
|
||||||
else
|
|
||||||
return Intersection(Object_and_primitive_id(object,primitive.id()));
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
template<typename Query>
|
|
||||||
boost::optional< typename Intersection_and_primitive_id<Query>::Type >
|
|
||||||
operator()(const Query& query, const typename AT::Primitive& primitive) const {
|
|
||||||
typename cpp11::result_of<typename GeomTraits::Intersect_3(Query, typename Primitive::Datum) >::type
|
|
||||||
inter_res = GeomTraits().intersect_3_object()(internal::Primitive_helper<AT>::get_datum(primitive,m_traits),query);
|
|
||||||
if (!inter_res)
|
|
||||||
return boost::none;
|
|
||||||
return boost::make_optional( std::make_pair(*inter_res, primitive.id()) );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
Intersection intersection_object() const {return Intersection(*this);}
|
|
||||||
|
|
||||||
|
|
||||||
// This should go down to the GeomTraits, i.e. the kernel
|
|
||||||
class Closest_point {
|
|
||||||
typedef typename AT::Point_3 Point;
|
|
||||||
typedef typename AT::Primitive Primitive;
|
|
||||||
const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& m_traits;
|
|
||||||
public:
|
|
||||||
Closest_point(const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
: m_traits(traits) {}
|
|
||||||
|
|
||||||
|
|
||||||
Point operator()(const Point& p, const Primitive& pr, const Point& bound) const
|
|
||||||
{
|
|
||||||
GeomTraits geom_traits;
|
|
||||||
Point closest_point = geom_traits.construct_projected_point_3_object()(
|
|
||||||
internal::Primitive_helper<AT>::get_datum(pr,m_traits), p);
|
|
||||||
return
|
|
||||||
geom_traits.compare_distance_3_object()(p, closest_point, bound)==LARGER ?
|
|
||||||
bound : closest_point;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// This should go down to the GeomTraits, i.e. the kernel
|
|
||||||
// and the internal implementation should change its name from
|
|
||||||
// do_intersect to something like does_contain (this is what we compute,
|
|
||||||
// this is not the same do_intersect as the spherical kernel)
|
|
||||||
class Compare_distance {
|
|
||||||
typedef typename AT::Point_3 Point;
|
|
||||||
typedef typename AT::FT FT;
|
|
||||||
typedef typename AT::Primitive Primitive;
|
|
||||||
public:
|
|
||||||
template <class Solid>
|
|
||||||
CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const Point& bound) const
|
|
||||||
{
|
|
||||||
return GeomTraits().do_intersect_3_object()
|
|
||||||
(GeomTraits().construct_sphere_3_object()
|
|
||||||
(p, GeomTraits().compute_squared_distance_3_object()(p, bound)), pr)?
|
|
||||||
CGAL::SMALLER : CGAL::LARGER;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class Solid>
|
|
||||||
CGAL::Comparison_result operator()(const Point& p, const Solid& pr, const FT& sq_distance) const
|
|
||||||
{
|
|
||||||
return GeomTraits().do_intersect_3_object()
|
|
||||||
(GeomTraits().construct_sphere_3_object()(p, sq_distance),
|
|
||||||
pr) ?
|
|
||||||
CGAL::SMALLER :
|
|
||||||
CGAL::LARGER;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Closest_point closest_point_object() const {return Closest_point(*this);}
|
|
||||||
Compare_distance compare_distance_object() const {return Compare_distance();}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
/**
|
|
||||||
* @brief Computes bounding box of one primitive
|
|
||||||
* @param pr the primitive
|
|
||||||
* @return the bounding box of the primitive \c pr
|
|
||||||
*/
|
|
||||||
template <typename PM>
|
|
||||||
Bounding_box compute_bbox(const Primitive& pr, const PM&)const
|
|
||||||
{
|
|
||||||
return get(bbm, pr.id());
|
|
||||||
}
|
|
||||||
|
|
||||||
Bounding_box compute_bbox(const Primitive& pr, const Default&)const
|
|
||||||
{
|
|
||||||
return internal::Primitive_helper<AT>::get_datum(pr,*this).bbox();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum { CGAL_AXIS_X = 0,
|
|
||||||
CGAL_AXIS_Y = 1,
|
|
||||||
CGAL_AXIS_Z = 2} Axis;
|
|
||||||
|
|
||||||
static Axis longest_axis(const Bounding_box& bbox);
|
|
||||||
|
|
||||||
/// Comparison functions
|
|
||||||
static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
{
|
|
||||||
return GeomTraits().less_x_3_object()( internal::Primitive_helper<AT>::get_reference_point(pr1,traits),
|
|
||||||
internal::Primitive_helper<AT>::get_reference_point(pr2,traits) );
|
|
||||||
}
|
|
||||||
static bool less_y(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
{
|
|
||||||
return GeomTraits().less_y_3_object()( internal::Primitive_helper<AT>::get_reference_point(pr1,traits),
|
|
||||||
internal::Primitive_helper<AT>::get_reference_point(pr2,traits) );
|
|
||||||
}
|
|
||||||
static bool less_z(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
|
||||||
{
|
|
||||||
return GeomTraits().less_z_3_object()( internal::Primitive_helper<AT>::get_reference_point(pr1,traits),
|
|
||||||
internal::Primitive_helper<AT>::get_reference_point(pr2,traits) );
|
|
||||||
}
|
|
||||||
|
|
||||||
}; // end class AABB_traits
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------
|
|
||||||
// Private methods
|
|
||||||
//-------------------------------------------------------
|
|
||||||
template<typename GT, typename P, typename B>
|
|
||||||
typename AABB_traits<GT,P,B>::Axis
|
|
||||||
AABB_traits<GT,P,B>::longest_axis(const Bounding_box& bbox)
|
|
||||||
{
|
|
||||||
const double dx = bbox.xmax() - bbox.xmin();
|
|
||||||
const double dy = bbox.ymax() - bbox.ymin();
|
|
||||||
const double dz = bbox.zmax() - bbox.zmin();
|
|
||||||
|
|
||||||
if(dx>=dy)
|
|
||||||
{
|
|
||||||
if(dx>=dz)
|
|
||||||
{
|
|
||||||
return CGAL_AXIS_X;
|
|
||||||
}
|
|
||||||
else // dz>dx and dx>=dy
|
|
||||||
{
|
|
||||||
return CGAL_AXIS_Z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // dy>dx
|
|
||||||
{
|
|
||||||
if(dy>=dz)
|
|
||||||
{
|
|
||||||
return CGAL_AXIS_Y;
|
|
||||||
}
|
|
||||||
else // dz>dy and dy>dx
|
|
||||||
{
|
|
||||||
return CGAL_AXIS_Z;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// @}
|
|
||||||
|
|
||||||
} // end namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_AABB_TRAITS_H_
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,256 +0,0 @@
|
||||||
// Copyright (c) 2015 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Frank Da, David Cohen-Steiner, Andreas Fabri
|
|
||||||
|
|
||||||
#ifndef CGAL_ADVANCING_FRONT_SURFACE_RECONSTRUCTION_CELL_BASE_3_H
|
|
||||||
#define CGAL_ADVANCING_FRONT_SURFACE_RECONSTRUCTION_CELL_BASE_3_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Advancing_front_surface_reconstruction.h>
|
|
||||||
|
|
||||||
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
/*!
|
|
||||||
\ingroup PkgAdvancingFrontSurfaceReconstruction
|
|
||||||
|
|
||||||
The class `Advancing_front_surface_reconstruction_cell_base_3` is the default
|
|
||||||
cell type for the class `Advancing_front_surface_reconstruction`.
|
|
||||||
|
|
||||||
\tparam Traits has to be a model of `DelaunayTriangulationTraits_3`.
|
|
||||||
|
|
||||||
\tparam Cb has to be a model of `DelaunayTriangulationCellBase_3`.
|
|
||||||
*/
|
|
||||||
template < typename Traits, typename Cb = Delaunay_triangulation_cell_base_3<Traits> >
|
|
||||||
class Advancing_front_surface_reconstruction_cell_base_3 : public Cb
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
template < typename TDS2 >
|
|
||||||
struct Rebind_TDS {
|
|
||||||
typedef typename Cb::template Rebind_TDS<TDS2>::Other Cb2;
|
|
||||||
typedef Advancing_front_surface_reconstruction_cell_base_3<Traits,Cb2> Other;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef typename Cb::Vertex_handle Vertex_handle;
|
|
||||||
typedef typename Cb::Cell_handle Cell_handle;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
#ifdef AFSR_FACET_NUMBER
|
|
||||||
int _facet_number[4];
|
|
||||||
#endif
|
|
||||||
typedef double coord_type;
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
typedef typename CGAL::Simple_cartesian<coord_type>::Point_3 D_Point;
|
|
||||||
#endif
|
|
||||||
//-------------------- DATA MEMBERS ---------------------------------
|
|
||||||
|
|
||||||
coord_type* _smallest_radius_facet_tab;
|
|
||||||
unsigned char selected_facet;
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
D_Point* _circumcenter;
|
|
||||||
coord_type* _squared_radius;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//-------------------- CONSTRUCTORS ----------------------------------
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Advancing_front_surface_reconstruction_cell_base_3()
|
|
||||||
: Cb(),
|
|
||||||
_smallest_radius_facet_tab(NULL), selected_facet(0)
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
, _circumcenter(NULL), _squared_radius(NULL)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#ifdef AFSR_FACET_NUMBER
|
|
||||||
for(int i = 0; i < 4; i++){
|
|
||||||
_facet_number[i] = -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
Advancing_front_surface_reconstruction_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3)
|
|
||||||
: Cb( v0, v1, v2, v3),
|
|
||||||
_smallest_radius_facet_tab(NULL), selected_facet(0)
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
, _circumcenter(NULL), _squared_radius(NULL)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#ifdef FACET_NUMBER
|
|
||||||
for(int i = 0; i < 4; i++){
|
|
||||||
_facet_number[i] = -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
Advancing_front_surface_reconstruction_cell_base_3(Vertex_handle v0, Vertex_handle v1, Vertex_handle v2, Vertex_handle v3,
|
|
||||||
Cell_handle n0, Cell_handle n1, Cell_handle n2, Cell_handle n3)
|
|
||||||
: Cb(v0, v1, v2, v3,
|
|
||||||
n0, n1, n2, n3),
|
|
||||||
_smallest_radius_facet_tab(NULL), selected_facet(0)
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
, _circumcenter(NULL), _squared_radius(NULL)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#ifdef AFSR_FACET_NUMBER
|
|
||||||
for(int i = 0; i < 4; i++){
|
|
||||||
_facet_number[i] = -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------- DESTRUCTOR -----------------------------------
|
|
||||||
|
|
||||||
inline ~Advancing_front_surface_reconstruction_cell_base_3()
|
|
||||||
{
|
|
||||||
if (_smallest_radius_facet_tab != NULL)
|
|
||||||
delete[] _smallest_radius_facet_tab;
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
if (_circumcenter != NULL)
|
|
||||||
delete _circumcenter;
|
|
||||||
if (_squared_radius != NULL)
|
|
||||||
delete _squared_radius;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------- MEMBER FUNCTIONS ----------------------------
|
|
||||||
public:
|
|
||||||
|
|
||||||
inline void clear()
|
|
||||||
{
|
|
||||||
if (_smallest_radius_facet_tab != NULL)
|
|
||||||
delete[] _smallest_radius_facet_tab;
|
|
||||||
_smallest_radius_facet_tab = NULL;
|
|
||||||
selected_facet = 0;
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
if (_circumcenter != NULL)
|
|
||||||
delete _circumcenter;
|
|
||||||
_circumcenter = NULL;
|
|
||||||
if (_squared_radius != NULL)
|
|
||||||
delete _squared_radius;
|
|
||||||
_squared_radius = NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
inline coord_type smallest_radius(const int& i)
|
|
||||||
{
|
|
||||||
if (_smallest_radius_facet_tab == NULL)
|
|
||||||
return -1;
|
|
||||||
return _smallest_radius_facet_tab[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_smallest_radius(const int& i, const coord_type& c)
|
|
||||||
{
|
|
||||||
if (_smallest_radius_facet_tab == NULL)
|
|
||||||
{
|
|
||||||
_smallest_radius_facet_tab = new coord_type[4];
|
|
||||||
for(int i = 0; i < 4; i++)
|
|
||||||
_smallest_radius_facet_tab[i] = -1;
|
|
||||||
}
|
|
||||||
_smallest_radius_facet_tab[i] = c;
|
|
||||||
}
|
|
||||||
|
|
||||||
// pour un controle de l'allocation memoire... utile???
|
|
||||||
inline bool alloc_smallest_radius_tab(coord_type* ptr)
|
|
||||||
{
|
|
||||||
if (_smallest_radius_facet_tab==NULL)
|
|
||||||
{
|
|
||||||
_smallest_radius_facet_tab = ptr;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
#ifdef FACET_NUMBER
|
|
||||||
void set_facet_number(int i, int n){}
|
|
||||||
{
|
|
||||||
_facet_number[i] = n;
|
|
||||||
}
|
|
||||||
|
|
||||||
int facet_number(int i)
|
|
||||||
{
|
|
||||||
return _facet_number[i];
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
void set_facet_number(int, int){}
|
|
||||||
int facet_number(int){return 0;}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline void select_facet(const int& i)
|
|
||||||
{
|
|
||||||
selected_facet |= (1 << i);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void unselect_facet(const int& i)
|
|
||||||
{
|
|
||||||
selected_facet &= (15 - (1 << i));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_selected_facet(const int& i)
|
|
||||||
{
|
|
||||||
return (selected_facet & (1 << i)) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool has_facet_on_surface(const int& i)
|
|
||||||
{
|
|
||||||
return (selected_facet & (1 << i)) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef AFSR_LAZY
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline D_Point* lazy_circumcenter()
|
|
||||||
{
|
|
||||||
return _circumcenter;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_lazy_circumcenter(const D_Point& p)
|
|
||||||
{
|
|
||||||
_circumcenter = new D_Point(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline coord_type* lazy_squared_radius()
|
|
||||||
{
|
|
||||||
return _squared_radius;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_lazy_squared_radius(const coord_type& sr)
|
|
||||||
{
|
|
||||||
_squared_radius = new coord_type(sr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //AFSR_LAZY
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ADVANCING_FRONT_SURFACE_RECONSTRUCTION_CELL_BASE_3_H
|
|
|
@ -1,134 +0,0 @@
|
||||||
// Copyright (c) 1999
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri, Stefan Schirra
|
|
||||||
|
|
||||||
#ifndef CGAL_AFF_TRANSFORMATION_2_H
|
|
||||||
#define CGAL_AFF_TRANSFORMATION_2_H
|
|
||||||
|
|
||||||
#include <CGAL/config.h>
|
|
||||||
#include <CGAL/Dimension.h>
|
|
||||||
#include <CGAL/aff_transformation_tags.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template <class R_>
|
|
||||||
class Aff_transformation_2 : public R_::Kernel_base::Aff_transformation_2
|
|
||||||
{
|
|
||||||
typedef typename R_::RT RT;
|
|
||||||
typedef typename R_::FT FT;
|
|
||||||
typedef typename R_::Line_2 Line_2;
|
|
||||||
typedef typename R_::Direction_2 Direction_2;
|
|
||||||
typedef typename R_::Vector_2 Vector_2;
|
|
||||||
typedef typename R_::Kernel_base::Aff_transformation_2 RAff_transformation_2;
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef CGAL::Dimension_tag<2> Ambient_dimension;
|
|
||||||
|
|
||||||
typedef R_ R;
|
|
||||||
|
|
||||||
Aff_transformation_2() {}
|
|
||||||
|
|
||||||
Aff_transformation_2(const RAff_transformation_2& t)
|
|
||||||
: RAff_transformation_2(t)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const Identity_transformation tag)
|
|
||||||
: RAff_transformation_2(tag)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const Translation tag, const Vector_2 &v)
|
|
||||||
: RAff_transformation_2(tag, v)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// Rational Rotation:
|
|
||||||
Aff_transformation_2(const Rotation tag,
|
|
||||||
const Direction_2 &d,
|
|
||||||
const RT &num,
|
|
||||||
const RT &den = RT(1))
|
|
||||||
: RAff_transformation_2(tag, d, num, den)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const Rotation tag,
|
|
||||||
const RT &sin,
|
|
||||||
const RT &cos,
|
|
||||||
const RT &den = RT(1))
|
|
||||||
: RAff_transformation_2(tag, sin, cos, den)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const Reflection tag, const Line_2& l )
|
|
||||||
: RAff_transformation_2(tag, l)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const Scaling tag,
|
|
||||||
const RT &s,
|
|
||||||
const RT &w= RT(1))
|
|
||||||
: RAff_transformation_2(tag, s, w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
// The general case:
|
|
||||||
Aff_transformation_2(const RT & m11,
|
|
||||||
const RT & m12,
|
|
||||||
const RT & m13,
|
|
||||||
|
|
||||||
const RT & m21,
|
|
||||||
const RT & m22,
|
|
||||||
const RT & m23,
|
|
||||||
|
|
||||||
const RT &w= RT(1))
|
|
||||||
: RAff_transformation_2(m11, m12, m13,
|
|
||||||
m21, m22, m23,
|
|
||||||
w)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Aff_transformation_2(const RT & m11, const RT & m12,
|
|
||||||
const RT & m21, const RT & m22,
|
|
||||||
const RT &w = RT(1))
|
|
||||||
: RAff_transformation_2(m11, m12,
|
|
||||||
m21, m22,
|
|
||||||
w)
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2
|
|
||||||
template < class R >
|
|
||||||
std::ostream &
|
|
||||||
operator<<(std::ostream &os, const CGAL::Aff_transformation_2<R> &t)
|
|
||||||
{
|
|
||||||
typedef typename R::Kernel_base::Aff_transformation_2 RAff_transformation_2;
|
|
||||||
return os << static_cast<const RAff_transformation_2&>(t);
|
|
||||||
}
|
|
||||||
#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2
|
|
||||||
|
|
||||||
#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2
|
|
||||||
template < class R >
|
|
||||||
std::istream &
|
|
||||||
operator>>(std::istream &is, CGAL::Aff_transformation_2<R> &t)
|
|
||||||
{
|
|
||||||
typedef typename R::Kernel_base::Aff_transformation_2 RAff_transformation_2;
|
|
||||||
return is >> static_cast<RAff_transformation_2&>(t);
|
|
||||||
}
|
|
||||||
#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_AFF_TRANSFORMATION_2_H
|
|
|
@ -1,106 +0,0 @@
|
||||||
// Copyright (c) 1999
|
|
||||||
// Utrecht University (The Netherlands),
|
|
||||||
// ETH Zurich (Switzerland),
|
|
||||||
// INRIA Sophia-Antipolis (France),
|
|
||||||
// Max-Planck-Institute Saarbruecken (Germany),
|
|
||||||
// and Tel-Aviv University (Israel). All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Andreas Fabri, Stefan Schirra
|
|
||||||
|
|
||||||
#ifndef CGAL_AFF_TRANSFORMATION_3_H
|
|
||||||
#define CGAL_AFF_TRANSFORMATION_3_H
|
|
||||||
|
|
||||||
#include <CGAL/Dimension.h>
|
|
||||||
#include <CGAL/aff_transformation_tags.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template <class R_>
|
|
||||||
class Aff_transformation_3 : public R_::Kernel_base::Aff_transformation_3
|
|
||||||
{
|
|
||||||
typedef typename R_::RT RT;
|
|
||||||
typedef typename R_::Vector_3 Vector_3;
|
|
||||||
typedef typename R_::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef CGAL::Dimension_tag<3> Ambient_dimension;
|
|
||||||
|
|
||||||
typedef R_ R;
|
|
||||||
|
|
||||||
Aff_transformation_3() {}
|
|
||||||
|
|
||||||
Aff_transformation_3(const RAff_transformation_3& t)
|
|
||||||
: RAff_transformation_3(t) {}
|
|
||||||
|
|
||||||
Aff_transformation_3(const Identity_transformation& tag)
|
|
||||||
: RAff_transformation_3(tag) {}
|
|
||||||
|
|
||||||
Aff_transformation_3(const Translation tag,
|
|
||||||
const Vector_3& v)
|
|
||||||
: RAff_transformation_3(tag, v) {}
|
|
||||||
|
|
||||||
Aff_transformation_3(const Scaling tag,
|
|
||||||
const RT& s,
|
|
||||||
const RT& w= RT(1) )
|
|
||||||
: RAff_transformation_3(tag, s, w) {}
|
|
||||||
|
|
||||||
// the general case:
|
|
||||||
Aff_transformation_3(
|
|
||||||
const RT& m11, const RT& m12, const RT& m13, const RT& m14,
|
|
||||||
const RT& m21, const RT& m22, const RT& m23, const RT& m24,
|
|
||||||
const RT& m31, const RT& m32, const RT& m33, const RT& m34,
|
|
||||||
const RT& w= RT(1) )
|
|
||||||
: RAff_transformation_3(m11, m12, m13, m14,
|
|
||||||
m21, m22, m23, m24,
|
|
||||||
m31, m32, m33, m34,
|
|
||||||
w) {}
|
|
||||||
|
|
||||||
Aff_transformation_3(
|
|
||||||
const RT& m11, const RT& m12, const RT& m13,
|
|
||||||
const RT& m21, const RT& m22, const RT& m23,
|
|
||||||
const RT& m31, const RT& m32, const RT& m33,
|
|
||||||
const RT& w = RT(1) )
|
|
||||||
: RAff_transformation_3(m11, m12, m13,
|
|
||||||
m21, m22, m23,
|
|
||||||
m31, m32, m33,
|
|
||||||
w) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifndef CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
|
|
||||||
template < class R >
|
|
||||||
std::ostream&
|
|
||||||
operator<<(std::ostream& os, const CGAL::Aff_transformation_3<R>& t)
|
|
||||||
{
|
|
||||||
typedef typename R::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
||||||
return os << static_cast<const RAff_transformation_3&>(t);
|
|
||||||
}
|
|
||||||
#endif // CGAL_NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3
|
|
||||||
|
|
||||||
#ifndef CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
|
|
||||||
template < class R >
|
|
||||||
std::istream&
|
|
||||||
operator>>(std::istream& is, CGAL::Aff_transformation_3<R>& t)
|
|
||||||
{
|
|
||||||
typedef typename R::Kernel_base::Aff_transformation_3 RAff_transformation_3;
|
|
||||||
return is >> static_cast<const RAff_transformation_3&>(t);
|
|
||||||
}
|
|
||||||
#endif // CGAL_NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_AFF_TRANSFORMATION_3_H
|
|
|
@ -1,88 +0,0 @@
|
||||||
// Copyright (c) 2006-2007 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Hemmer <hemmer@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// =============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
/*! \file CGAL/Algebraic_extension_traits.h
|
|
||||||
* \brief Defines traits class CGAL::Algebraic_extension_traits.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_NUMBER_TRAITS_H
|
|
||||||
#define CGAL_ALGEBRAIC_NUMBER_TRAITS_H 1
|
|
||||||
|
|
||||||
#include <numeric> // for std::accumulate
|
|
||||||
#include <CGAL/tags.h>
|
|
||||||
#include <CGAL/Algebraic_structure_traits.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template< class T >
|
|
||||||
class Algebraic_extension_traits {
|
|
||||||
public:
|
|
||||||
//! \name Typedefs
|
|
||||||
//! the number type for which this instance has been instantiated
|
|
||||||
typedef T Type;
|
|
||||||
//! standard number types are not extended
|
|
||||||
typedef CGAL::Tag_false Is_extended;
|
|
||||||
|
|
||||||
//! computes the factor which normalizes a number to be integral after
|
|
||||||
// multiplication
|
|
||||||
class Normalization_factor
|
|
||||||
: public CGAL::cpp98::unary_function<Type,Type> {
|
|
||||||
private:
|
|
||||||
static Type
|
|
||||||
normalization_factor(const Type&,Integral_domain_without_division_tag){
|
|
||||||
return Type(1);
|
|
||||||
}
|
|
||||||
static Type
|
|
||||||
normalization_factor(const Type& a, Field_tag){
|
|
||||||
return Type(1)/a;
|
|
||||||
}
|
|
||||||
public:
|
|
||||||
//! determine normalization factor
|
|
||||||
Type operator () (const Type& a) {
|
|
||||||
CGAL_precondition(a != Type(0));
|
|
||||||
typedef typename Algebraic_structure_traits<Type>::Algebraic_category
|
|
||||||
Tag;
|
|
||||||
return normalization_factor(a, Tag());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Denominator_for_algebraic_integers
|
|
||||||
: public CGAL::cpp98::unary_function<Type,Type> {
|
|
||||||
public:
|
|
||||||
//! determine normalization factor
|
|
||||||
Type operator () (const Type&) {
|
|
||||||
return Type(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class InputIterator>
|
|
||||||
Type operator () (InputIterator, InputIterator) {
|
|
||||||
return Type(1);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // NiX_ALGEBRAIC_NUMBER_TRAITS_H
|
|
||||||
// EOF
|
|
|
@ -1,71 +0,0 @@
|
||||||
// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud, Sylvain Pion, Constantinos Tsirogiannis
|
|
||||||
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_CONVERTER_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_CONVERTER_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_2.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/NT_converter.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
// TODO :
|
|
||||||
// - FT converter ?
|
|
||||||
|
|
||||||
template < class Al_K1, class Al_K2,
|
|
||||||
class RT_converter = NT_converter<typename Al_K1::RT,
|
|
||||||
typename Al_K2::RT>,
|
|
||||||
class Root_of_converter = NT_converter<typename Al_K1::Root_of_2,
|
|
||||||
typename Al_K2::Root_of_2 > >
|
|
||||||
class Algebraic_kernel_converter {
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef typename Al_K1::RT RT_1;
|
|
||||||
typedef typename Al_K2::RT RT_2;
|
|
||||||
typedef RT_converter RT_type_converter;
|
|
||||||
typedef Root_of_converter Root_of_type_converter;
|
|
||||||
|
|
||||||
typename Al_K2::Polynomial_1_2 operator () (const typename Al_K1::Polynomial_1_2 &p) const
|
|
||||||
{
|
|
||||||
return typename Al_K2::Polynomial_1_2(RT_converter()(p.a()),
|
|
||||||
RT_converter()(p.b()),
|
|
||||||
RT_converter()(p.c()));
|
|
||||||
}
|
|
||||||
|
|
||||||
typename Al_K2::Polynomial_for_circles_2_2 operator ()
|
|
||||||
(const typename Al_K1::Polynomial_for_circles_2_2 &p) const
|
|
||||||
{
|
|
||||||
return typename Al_K2::Polynomial_for_circles_2_2(RT_converter()(p.a()),
|
|
||||||
RT_converter()(p.b()),
|
|
||||||
RT_converter()(p.r_sq()));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_CONVERTER_H
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,72 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ==========================================================================
|
|
||||||
#ifndef CGAL_BITSTREAM_COEFFICIENT_KERNEL_H
|
|
||||||
#define CGAL_BITSTREAM_COEFFICIENT_KERNEL_H 1
|
|
||||||
|
|
||||||
#include <CGAL/Algebraic_structure_traits.h>
|
|
||||||
#include <CGAL/convert_to_bfi.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
template <typename Coefficient_> struct Bitstream_coefficient_kernel {
|
|
||||||
|
|
||||||
typedef Coefficient_ Coefficient;
|
|
||||||
|
|
||||||
typedef typename
|
|
||||||
CGAL::Get_arithmetic_kernel<Coefficient_>::Arithmetic_kernel
|
|
||||||
Arithmetic_kernel;
|
|
||||||
|
|
||||||
typedef typename Arithmetic_kernel::Bigfloat_interval Bigfloat_interval;
|
|
||||||
typedef typename Arithmetic_kernel::Integer Integer;
|
|
||||||
typedef typename Arithmetic_kernel::Rational Bound;
|
|
||||||
|
|
||||||
|
|
||||||
typedef typename CGAL::Algebraic_structure_traits<Coefficient>
|
|
||||||
::Is_zero Is_zero;
|
|
||||||
|
|
||||||
Is_zero is_zero_object() const {
|
|
||||||
return Is_zero();
|
|
||||||
}
|
|
||||||
|
|
||||||
struct Convert_to_bfi : public CGAL::cpp98::unary_function
|
|
||||||
<Coefficient,Bigfloat_interval> {
|
|
||||||
|
|
||||||
Bigfloat_interval operator() (Coefficient c) const {
|
|
||||||
return CGAL::convert_to_bfi(c);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Convert_to_bfi convert_to_bfi_object() const {
|
|
||||||
return Convert_to_bfi();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}; // of class Bitstream_coefficient_kernel
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_BITSTREAM_COEFFICIENT_KERNEL_H
|
|
|
@ -1,100 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_INTERVAL_EVALUATE_1
|
|
||||||
#define CGAL_INTERVAL_EVALUATE_1 1
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <boost/numeric/interval.hpp>
|
|
||||||
#include <CGAL/algorithm.h>
|
|
||||||
#include <CGAL/array.h>
|
|
||||||
#include <CGAL/Coercion_traits.h>
|
|
||||||
#include <CGAL/Polynomial_traits_d.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
template<typename Polynomial_1, typename Bound>
|
|
||||||
struct Interval_evaluate_1 : public CGAL::cpp98::binary_function
|
|
||||||
<Polynomial_1,std::pair<Bound,Bound>,
|
|
||||||
std::pair<typename CGAL::Coercion_traits<typename
|
|
||||||
CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type,Bound>::Type,
|
|
||||||
typename CGAL::Coercion_traits<typename
|
|
||||||
CGAL::Polynomial_traits_d<Polynomial_1>::Coefficient_type,Bound>::Type> > {
|
|
||||||
|
|
||||||
typedef CGAL::Polynomial_traits_d< Polynomial_1 > PT_1;
|
|
||||||
|
|
||||||
typedef typename PT_1::Innermost_coefficient_type Innermost_coefficient_type;
|
|
||||||
|
|
||||||
typedef CGAL::Coercion_traits< Innermost_coefficient_type, Bound > CT;
|
|
||||||
|
|
||||||
typedef typename CT::Type Coercion_type;
|
|
||||||
|
|
||||||
typedef std::pair< Coercion_type, Coercion_type > result_type;
|
|
||||||
|
|
||||||
result_type operator()(const Polynomial_1& p,
|
|
||||||
const std::pair< Bound, Bound >& b) const {
|
|
||||||
return this->operator()(p, CGAL::make_array(b.first, b.second));
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator()(const Polynomial_1& p,
|
|
||||||
const CGAL::cpp11::array< Bound, 2 >& b) const {
|
|
||||||
|
|
||||||
typename CT::Cast cast;
|
|
||||||
|
|
||||||
typedef ::boost::numeric::interval< Coercion_type > Coercion_interval;
|
|
||||||
|
|
||||||
typedef typename PT_1::Coefficient_const_iterator
|
|
||||||
Coefficient_const_iterator;
|
|
||||||
|
|
||||||
Coercion_interval ix(cast(b[0]), cast(b[1]));
|
|
||||||
|
|
||||||
typedef typename PT_1::Coefficient_const_iterator_range
|
|
||||||
Coefficient_const_iterator_range;
|
|
||||||
|
|
||||||
Coefficient_const_iterator_range range =
|
|
||||||
typename PT_1::Construct_coefficient_const_iterator_range()(p);
|
|
||||||
|
|
||||||
Coefficient_const_iterator it = CGAL::cpp11::prev(range.second);
|
|
||||||
|
|
||||||
Coercion_interval res(cast(*it));
|
|
||||||
|
|
||||||
Coefficient_const_iterator p_begin = range.first;
|
|
||||||
while(it != p_begin) {
|
|
||||||
it--;
|
|
||||||
res = res * ix + Coercion_interval(cast(*it));
|
|
||||||
}
|
|
||||||
return std::make_pair(res.lower(),res.upper());
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_INTERVAL_EVALUATE_1
|
|
|
@ -1,112 +0,0 @@
|
||||||
// Copyright (c) 2006-2010 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_INTERVAL_EVALUATE_2
|
|
||||||
#define CGAL_INTERVAL_EVALUATE_2 1
|
|
||||||
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <boost/numeric/interval.hpp>
|
|
||||||
#include <CGAL/algorithm.h>
|
|
||||||
#include <CGAL/array.h>
|
|
||||||
#include <CGAL/Coercion_traits.h>
|
|
||||||
#include <CGAL/Polynomial_traits_d.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Interval_evaluate_1.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
template<typename Polynomial_2, typename Bound>
|
|
||||||
struct Interval_evaluate_2 : public CGAL::cpp98::binary_function
|
|
||||||
<Polynomial_2,CGAL::cpp11::array<Bound,4>,
|
|
||||||
std::pair<typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type,
|
|
||||||
typename CGAL::Coercion_traits<typename CGAL::Polynomial_traits_d<Polynomial_2>::Innermost_coefficient_type,Bound>::Type> > {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef CGAL::Polynomial_traits_d< Polynomial_2 > PT_2;
|
|
||||||
|
|
||||||
typedef typename PT_2::Innermost_coefficient_type Innermost_coefficient_type;
|
|
||||||
|
|
||||||
typedef CGAL::Coercion_traits< Innermost_coefficient_type, Bound > CT;
|
|
||||||
|
|
||||||
typedef typename CT::Type Coercion_type;
|
|
||||||
|
|
||||||
typedef std::pair< Coercion_type, Coercion_type > result_type;
|
|
||||||
|
|
||||||
result_type operator()(const Polynomial_2& p,
|
|
||||||
const CGAL::cpp11::array< Bound, 4 >& b) const {
|
|
||||||
|
|
||||||
typename CT::Cast cast;
|
|
||||||
|
|
||||||
typedef ::boost::numeric::interval< Coercion_type > Coercion_interval;
|
|
||||||
|
|
||||||
typedef typename PT_2::Coefficient_const_iterator
|
|
||||||
Coefficient_const_iterator;
|
|
||||||
|
|
||||||
typedef typename PT_2::Coefficient_const_iterator_range
|
|
||||||
Coefficient_const_iterator_range;
|
|
||||||
|
|
||||||
typedef typename PT_2::Coefficient_type Polynomial_1;
|
|
||||||
|
|
||||||
CGAL::internal::Interval_evaluate_1< Polynomial_1,Bound >
|
|
||||||
interval_evaluate_1;
|
|
||||||
|
|
||||||
typedef typename CGAL::internal::Interval_evaluate_1< Polynomial_1,Bound >::
|
|
||||||
result_type Interval_result_type;
|
|
||||||
|
|
||||||
std::pair< Bound, Bound > x_pair = std::make_pair(b[0],b[1]);
|
|
||||||
|
|
||||||
Coercion_interval iy(cast(b[2]),cast(b[3]));
|
|
||||||
|
|
||||||
// CGAL::Polynomial does not provide Coercion_traits for number
|
|
||||||
// types => therefore evaluate manually
|
|
||||||
Coefficient_const_iterator_range range =
|
|
||||||
typename PT_2::Construct_coefficient_const_iterator_range()(p);
|
|
||||||
|
|
||||||
Coefficient_const_iterator it = CGAL::cpp11::prev(range.second);
|
|
||||||
|
|
||||||
Interval_result_type initial_pair = interval_evaluate_1(*it,x_pair);
|
|
||||||
Coercion_interval res(initial_pair.first,initial_pair.second);
|
|
||||||
|
|
||||||
Coefficient_const_iterator p_begin = range.first;
|
|
||||||
|
|
||||||
while((it) != p_begin) {
|
|
||||||
it--;
|
|
||||||
Interval_result_type curr_iv = interval_evaluate_1(*it,x_pair);
|
|
||||||
res = res * iy + Coercion_interval(curr_iv.first,curr_iv.second);
|
|
||||||
}
|
|
||||||
return std::make_pair(res.lower(),res.upper());
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_INTERVAL_EVALUATE_2
|
|
|
@ -1,123 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
#ifndef CGAL_ACK_SHEAR_CONTROLLER
|
|
||||||
#define CGAL_ACK_SHEAR_CONTROLLER 1
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <CGAL/Random.h>
|
|
||||||
#include <CGAL/tss.h>
|
|
||||||
|
|
||||||
#include<set>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief A class that controls the used shear factors
|
|
||||||
*
|
|
||||||
* The objects returns positive integers that are used as shear factors.
|
|
||||||
* It choses integers from the range \c 1..max at random ,
|
|
||||||
* where \c c is a positive integer
|
|
||||||
* initially set in the constructor (8 by default). No integer is given
|
|
||||||
* twice by \c get_shear_factor(), at least if the failed ones are reported
|
|
||||||
* with the \c report_failure() method.
|
|
||||||
* If more than half of the integers in the range were bad, the range is
|
|
||||||
* enlarged to \c 1..2*max.
|
|
||||||
*/
|
|
||||||
template<typename Int,int InitialMax=8>
|
|
||||||
class Shear_controller {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//! Constructor, getting the maximal absolute value of the shear factor
|
|
||||||
Shear_controller()
|
|
||||||
:
|
|
||||||
#if CGAL_ACK_STATIC_SEED
|
|
||||||
#warning Warning, uses static seed!
|
|
||||||
rng(CGAL_ACK_STATIC_SEED)
|
|
||||||
#else
|
|
||||||
rng()
|
|
||||||
#endif
|
|
||||||
, m_max(InitialMax)
|
|
||||||
, pos_next_factor(0) {
|
|
||||||
CGAL_assertion(m_max>=1);
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Reports that the shear factor \c factor was bad.
|
|
||||||
void report_failure(Int factor) {
|
|
||||||
this->bad_shears.insert(factor);
|
|
||||||
long failures=static_cast<long>(this->bad_shears.size())+1;
|
|
||||||
if(2*failures>this->m_max) {
|
|
||||||
this->m_max*=2;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Gets a shear factor
|
|
||||||
Int get_shear_factor() {
|
|
||||||
if(pos_next_factor==static_cast<int>(value_order().size())) {
|
|
||||||
value_order().push_back(get_new_shear_factor());
|
|
||||||
}
|
|
||||||
return value_order()[pos_next_factor++];
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
//! Gets a new shear factor
|
|
||||||
Int get_new_shear_factor() {
|
|
||||||
CGAL_assertion(int(this->bad_shears.size())<m_max);
|
|
||||||
while(true) {
|
|
||||||
Int s = Int((rng.get_int(0,(std::numeric_limits<int>::max)())%m_max )+1);
|
|
||||||
if(bad_shears.find(s)==bad_shears.end()) {
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Random rng;
|
|
||||||
|
|
||||||
// Maximal absolute value
|
|
||||||
Int m_max;
|
|
||||||
|
|
||||||
static std::vector<Int>& value_order() {
|
|
||||||
CGAL_STATIC_THREAD_LOCAL_VARIABLE_0(std::vector<Int>, value_order_);
|
|
||||||
return value_order_;
|
|
||||||
}
|
|
||||||
|
|
||||||
int pos_next_factor;
|
|
||||||
|
|
||||||
// Unsuccessfull shear factors
|
|
||||||
std::set<Int> bad_shears;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_ACK_SHEAR_CONTROLLER
|
|
|
@ -1,58 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_ACK_ENUMS_H
|
|
||||||
#define CGAL_ACK_ENUMS_H 1
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
enum Three_valued {
|
|
||||||
|
|
||||||
ROOT_OF_FIRST_SET = 1,
|
|
||||||
ROOT_OF_BOTH_SETS = 0,
|
|
||||||
ROOT_OF_SECOND_SET=-1
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Represents different strategies how to handle
|
|
||||||
* degenerate cases during the analysis
|
|
||||||
*
|
|
||||||
* Currently, there are two possible strategies implemented. See the
|
|
||||||
* constructor of \c Curve_analysis_2 for more details.
|
|
||||||
*/
|
|
||||||
enum Degeneracy_strategy {
|
|
||||||
|
|
||||||
SHEAR_STRATEGY = 0,
|
|
||||||
EXCEPTION_STRATEGY = 1,
|
|
||||||
SHEAR_ONLY_AT_IRRATIONAL_STRATEGY = 2
|
|
||||||
};
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,78 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_EXCEPTIONS_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_EXCEPTIONS_H
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Exception class for not sufficiently generic positions.
|
|
||||||
*
|
|
||||||
* Must be thrown whenever a curve cannot be analysed because its position
|
|
||||||
* is not "good enough".
|
|
||||||
*/
|
|
||||||
class Non_generic_position_exception {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//! Default constructible
|
|
||||||
Non_generic_position_exception() {}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* \brief Exception class for not sufficiently generic positions.
|
|
||||||
*
|
|
||||||
* Must be thrown whenever a curve cannot be analysed because its position
|
|
||||||
* is not "good enough".
|
|
||||||
*/
|
|
||||||
template<typename Polynomial>
|
|
||||||
class Zero_resultant_exception {
|
|
||||||
|
|
||||||
Polynomial curve1,curve2;
|
|
||||||
bool one_curve_failure;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
Zero_resultant_exception(Polynomial c)
|
|
||||||
: curve1(c), curve2(c),one_curve_failure(true)
|
|
||||||
{}
|
|
||||||
|
|
||||||
Zero_resultant_exception(Polynomial c1,Polynomial c2)
|
|
||||||
: curve1(c1),curve2(c2),one_curve_failure(false)
|
|
||||||
{}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,71 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_ACK_SHEAR_H
|
|
||||||
#define CGAL_ACK_SHEAR_H 1
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <CGAL/Polynomial_traits_d.h>
|
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include <vector>
|
|
||||||
#include <functional>
|
|
||||||
#include <iterator>
|
|
||||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
|
||||||
#include <CGAL/boost/iterator/counting_iterator.hpp>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
|
|
||||||
/*! \ingroup NiX_bivariate_polynomial_hacks
|
|
||||||
* \brief Computes the polynomial f(x+sy,y)
|
|
||||||
*/
|
|
||||||
template<class NT>
|
|
||||||
CGAL::Polynomial<CGAL::Polynomial<NT> >
|
|
||||||
shear(const CGAL::Polynomial<CGAL::Polynomial<NT> >& f,NT s) {
|
|
||||||
typedef CGAL::Polynomial<NT> Poly_1;
|
|
||||||
typedef CGAL::Polynomial<Poly_1> Poly_2;
|
|
||||||
|
|
||||||
Poly_1 x(NT(0),NT(1));
|
|
||||||
Poly_1 zero(NT(0));
|
|
||||||
Poly_1 one(NT(1));
|
|
||||||
Poly_2 for_x(x,Poly_1(NT(s)));
|
|
||||||
Poly_2 for_y(zero,one);
|
|
||||||
|
|
||||||
std::vector<Poly_2> coeffs;
|
|
||||||
coeffs.push_back(for_x);
|
|
||||||
coeffs.push_back(for_y);
|
|
||||||
|
|
||||||
return typename CGAL::Polynomial_traits_d<Poly_2>::Substitute()
|
|
||||||
(f,coeffs.begin(), coeffs.end());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // NiX_BIVARIATE_POLYNOMIAL_HACKS_H
|
|
||||||
// EOF
|
|
|
@ -1,680 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Hemmer <hemmer@mpi-inf.mpg.de>
|
|
||||||
// Sebastian Limbach <slimbach@mpi-inf.mpg.de>
|
|
||||||
// Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_D_1_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_D_1_H
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#ifndef CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
#define CGAL_AK_ENABLE_DEPRECATED_INTERFACE 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/flags.h>
|
|
||||||
#include <CGAL/Polynomial.h>
|
|
||||||
|
|
||||||
#include <CGAL/Arithmetic_kernel.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Algebraic_real_d_1.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Descartes.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Real_roots.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/refine_zero_against.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Interval_evaluate_1.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/bound_between_1.h>
|
|
||||||
#include <CGAL/ipower.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace internal {
|
|
||||||
template< class AlgebraicReal1, class Isolator_ >
|
|
||||||
class Algebraic_kernel_d_1_base {
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef AlgebraicReal1 Algebraic_real_1;
|
|
||||||
typedef Isolator_ Isolator;
|
|
||||||
|
|
||||||
typedef typename Algebraic_real_1::Coefficient Coefficient;
|
|
||||||
typedef typename Algebraic_real_1::Bound Bound;
|
|
||||||
typedef typename Algebraic_real_1::Polynomial_1 Polynomial_1;
|
|
||||||
|
|
||||||
// TODO: Other choice?
|
|
||||||
typedef int size_type;
|
|
||||||
typedef int Multiplicity_type;
|
|
||||||
|
|
||||||
private:
|
|
||||||
typedef CGAL::Polynomial_traits_d< Polynomial_1 > PT_1;
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// Some functors used for STL calls
|
|
||||||
template<typename A,typename B>
|
|
||||||
struct Pair_first : public CGAL::cpp98::unary_function<std::pair<A,B>,A> {
|
|
||||||
A operator() (std::pair<A,B> pair) const { return pair.first; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename A,typename B>
|
|
||||||
struct Pair_second : public CGAL::cpp98::unary_function<std::pair<A,B>,B> {
|
|
||||||
B operator() (std::pair<A,B> pair) const { return pair.second; }
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
class Algebraic_real_traits {
|
|
||||||
public:
|
|
||||||
typedef Algebraic_real_1 Type;
|
|
||||||
|
|
||||||
struct Bound_between
|
|
||||||
: public CGAL::cpp98::binary_function< Type, Type, Bound > {
|
|
||||||
Bound operator()( const Type& t1,
|
|
||||||
const Type& t2 ) const {
|
|
||||||
#if CGAL_AK_DONT_USE_SIMPLE_BOUND_BETWEEN
|
|
||||||
#warning uses deprecated bound_between_1 functor
|
|
||||||
return t1.rational_between( t2 );
|
|
||||||
#else
|
|
||||||
return internal::simple_bound_between(t1,t2);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Lower_bound
|
|
||||||
: public CGAL::cpp98::unary_function< Type, Bound > {
|
|
||||||
Bound operator()( const Type& t ) const {
|
|
||||||
return t.low();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Upper_bound
|
|
||||||
: public CGAL::cpp98::unary_function< Type, Bound > {
|
|
||||||
Bound operator()( const Type& t ) const {
|
|
||||||
return t.high();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Refine
|
|
||||||
: public CGAL::cpp98::unary_function< Type, void > {
|
|
||||||
void operator()( const Type& t ) const {
|
|
||||||
t.refine();
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator()( Type& t, int rel_prec ) const {
|
|
||||||
// If t is zero, we can refine the interval to
|
|
||||||
// infinite precission
|
|
||||||
if( CGAL::is_zero( t ) ) {
|
|
||||||
t = Type(0);
|
|
||||||
} else {
|
|
||||||
// Refine until both boundaries have the same sign
|
|
||||||
while( CGAL::sign( t.high() ) !=
|
|
||||||
CGAL::sign( t.low() ) )
|
|
||||||
t.refine();
|
|
||||||
|
|
||||||
CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO &&
|
|
||||||
CGAL::sign( t.low() ) != CGAL::ZERO );
|
|
||||||
|
|
||||||
// Calculate the needed precision
|
|
||||||
Bound prec = Bound(1) /
|
|
||||||
CGAL::ipower( Bound(2), rel_prec );
|
|
||||||
|
|
||||||
// Refine until precision is reached
|
|
||||||
while( CGAL::abs( t.high() - t.low() ) /
|
|
||||||
(CGAL::max)( CGAL::abs( t.high() ),
|
|
||||||
CGAL::abs( t.low() ) ) > prec ) {
|
|
||||||
t.refine();
|
|
||||||
|
|
||||||
CGAL_assertion( CGAL::sign( t.high() ) != CGAL::ZERO &&
|
|
||||||
CGAL::sign( t.low() ) != CGAL::ZERO );
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Approximate_absolute_1:
|
|
||||||
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
|
||||||
std::pair<Bound,Bound>
|
|
||||||
operator()(const Algebraic_real_1& x, int prec) const {
|
|
||||||
Lower_bound lower;
|
|
||||||
Upper_bound upper;
|
|
||||||
Refine refine;
|
|
||||||
Bound l = lower(x);
|
|
||||||
Bound u = upper(x);
|
|
||||||
Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec));
|
|
||||||
while((prec>0)?((u-l)*error>Bound(1)):((u-l)>error)){
|
|
||||||
refine(x);
|
|
||||||
u = upper(x);
|
|
||||||
l = lower(x);
|
|
||||||
}
|
|
||||||
return std::make_pair(l,u);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Approximate_relative_1:
|
|
||||||
public CGAL::cpp98::binary_function<Algebraic_real_1,int,std::pair<Bound,Bound> >{
|
|
||||||
std::pair<Bound,Bound>
|
|
||||||
operator()(const Algebraic_real_1& x, int prec) const {
|
|
||||||
|
|
||||||
if(CGAL::is_zero(x)) return std::make_pair(Bound(0),Bound(0));
|
|
||||||
|
|
||||||
Lower_bound lower;
|
|
||||||
Upper_bound upper;
|
|
||||||
Refine refine;
|
|
||||||
Bound l = lower(x);
|
|
||||||
Bound u = upper(x);
|
|
||||||
Bound error = CGAL::ipower(Bound(2),CGAL::abs(prec));
|
|
||||||
Bound min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l));
|
|
||||||
while((prec>0)?((u-l)*error>min_b):((u-l)>error*min_b)){
|
|
||||||
refine(x);
|
|
||||||
u = upper(x);
|
|
||||||
l = lower(x);
|
|
||||||
min_b = (CGAL::min)(CGAL::abs(u),CGAL::abs(l));
|
|
||||||
}
|
|
||||||
return std::make_pair(l,u);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#if CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
typedef Lower_bound Lower_boundary;
|
|
||||||
typedef Upper_bound Upper_boundary;
|
|
||||||
typedef Bound_between Boundary_between;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
}; // class Algebraic_real_traits
|
|
||||||
|
|
||||||
struct Construct_algebraic_real_1;
|
|
||||||
|
|
||||||
// Functors of Algebraic_kernel_d_1
|
|
||||||
struct Solve_1 {
|
|
||||||
public:
|
|
||||||
template <class OutputIterator>
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Polynomial_1& p, OutputIterator oi) const {
|
|
||||||
#if CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
#else
|
|
||||||
CGAL_precondition(!CGAL::is_zero(p));
|
|
||||||
#endif
|
|
||||||
internal::Real_roots< Algebraic_real_1, Isolator > real_roots;
|
|
||||||
std::list< int > mults;
|
|
||||||
std::list< Algebraic_real_1 > roots;
|
|
||||||
real_roots( p, std::back_inserter(roots), std::back_inserter( mults ) );
|
|
||||||
CGAL_assertion(roots.size()==mults.size());
|
|
||||||
std::list<int>::iterator mit =mults.begin();
|
|
||||||
typename std::list< Algebraic_real_1 >::iterator rit = roots.begin();
|
|
||||||
while(rit != roots.end()) {
|
|
||||||
//*oi++ = std::make_pair(*rit, (unsigned int)(*mit));
|
|
||||||
*oi++ = std::make_pair(*rit, *mit);
|
|
||||||
rit++;
|
|
||||||
mit++;
|
|
||||||
}
|
|
||||||
return oi;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if 1 || CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
template< class OutputIterator >
|
|
||||||
OutputIterator operator()(
|
|
||||||
const Polynomial_1& p,
|
|
||||||
OutputIterator oi ,
|
|
||||||
bool known_to_be_square_free) const {
|
|
||||||
return this->operator()(p,known_to_be_square_free,oi);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
template< class OutputIterator >
|
|
||||||
OutputIterator operator()(
|
|
||||||
const Polynomial_1& p,
|
|
||||||
bool known_to_be_square_free,
|
|
||||||
OutputIterator oi) const {
|
|
||||||
|
|
||||||
internal::Real_roots< Algebraic_real_1, Isolator > real_roots;
|
|
||||||
#if CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
#else
|
|
||||||
CGAL_precondition(!CGAL::is_zero(p));
|
|
||||||
#endif
|
|
||||||
std::list<Algebraic_real_1> roots;
|
|
||||||
if( known_to_be_square_free ){
|
|
||||||
real_roots(p,std::back_inserter(roots));
|
|
||||||
}else{
|
|
||||||
std::list<int> dummy;
|
|
||||||
real_roots(p,std::back_inserter(roots),std::back_inserter(dummy));
|
|
||||||
}
|
|
||||||
return std::copy(roots.begin(),roots.end(),oi);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
template< class OutputIteratorRoots , class OutputIteratorMults >
|
|
||||||
std::pair<OutputIteratorRoots,OutputIteratorMults>
|
|
||||||
operator()(
|
|
||||||
const Polynomial_1& p,
|
|
||||||
OutputIteratorRoots roi,
|
|
||||||
OutputIteratorMults moi) const {
|
|
||||||
|
|
||||||
internal::Real_roots< Algebraic_real_1, Isolator > real_roots;
|
|
||||||
real_roots(p,roi,moi);
|
|
||||||
return std::make_pair(roi,moi);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/*
|
|
||||||
// TODO: Can we avoid to use this?
|
|
||||||
struct Greater_compare :
|
|
||||||
public CGAL::cpp98::binary_function<Algebraic_real_1,Algebraic_real_1,bool> {
|
|
||||||
|
|
||||||
bool operator() (const Algebraic_real_1& a, const Algebraic_real_1& b)
|
|
||||||
const {
|
|
||||||
return a>b;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
template< class OutputIterator >
|
|
||||||
OutputIterator operator()(const Polynomial_1& p, Bound l, Bound u,
|
|
||||||
OutputIterator res) const {
|
|
||||||
|
|
||||||
std::vector<std::pair<Algebraic_real_1,Multiplicity_type> > roots;
|
|
||||||
this->operator() (p,std::back_inserter(roots));
|
|
||||||
Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l);
|
|
||||||
Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u);
|
|
||||||
typedef typename
|
|
||||||
std::vector<std::pair<Algebraic_real_1,Multiplicity_type> >::iterator
|
|
||||||
Iterator;
|
|
||||||
Pair_first<Algebraic_real_1,Multiplicity_type> pair_first;
|
|
||||||
Iterator it_start=std::lower_bound
|
|
||||||
(::boost::make_transform_iterator(roots.begin(),pair_first),
|
|
||||||
::boost::make_transform_iterator(roots.end(),pair_first),
|
|
||||||
alg_l).base();
|
|
||||||
Iterator it_end=std::upper_bound
|
|
||||||
(::boost::make_transform_iterator(it_start,pair_first),
|
|
||||||
::boost::make_transform_iterator(roots.end(),pair_first),
|
|
||||||
alg_u).base();
|
|
||||||
std::copy(it_start,it_end,res);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
template< class OutputIterator >
|
|
||||||
OutputIterator operator()(const Polynomial_1& p,
|
|
||||||
bool known_to_be_square_free,
|
|
||||||
Bound l, Bound u,
|
|
||||||
OutputIterator res) const {
|
|
||||||
|
|
||||||
std::vector<Algebraic_real_1 > roots;
|
|
||||||
this->operator() (p,known_to_be_square_free,std::back_inserter(roots));
|
|
||||||
Algebraic_real_1 alg_l=Construct_algebraic_real_1()(l);
|
|
||||||
Algebraic_real_1 alg_u=Construct_algebraic_real_1()(u);
|
|
||||||
typedef typename
|
|
||||||
std::vector<Algebraic_real_1>::iterator
|
|
||||||
Iterator;
|
|
||||||
Iterator it_start=std::lower_bound(roots.begin(),roots.end(),alg_l);
|
|
||||||
Iterator it_end=std::upper_bound(it_start,roots.end(),alg_u);
|
|
||||||
std::copy(it_start,it_end,res);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
class Number_of_solutions_1
|
|
||||||
: public CGAL::cpp98::unary_function<Polynomial_1,size_type> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
size_type operator()
|
|
||||||
(const Polynomial_1& p) const {
|
|
||||||
|
|
||||||
std::vector<std::pair<Algebraic_real_1,Multiplicity_type> > roots;
|
|
||||||
Solve_1()(p,std::back_inserter(roots));
|
|
||||||
return static_cast<size_type>(roots.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct Sign_at_1
|
|
||||||
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, CGAL::Sign > {
|
|
||||||
CGAL::Sign operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
|
|
||||||
if(CGAL::is_zero(p)) return ZERO;
|
|
||||||
if(CGAL::degree(p)==0) return p.sign_at(0);
|
|
||||||
if( ar.low() == ar.high() ) return p.sign_at( ar.low() );
|
|
||||||
|
|
||||||
if (p == ar.polynomial()) {
|
|
||||||
return ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
Polynomial_1 g = gcd_utcf(p,ar.polynomial());
|
|
||||||
if (g.sign_at(ar.low()) != g.sign_at(ar.high())) return ZERO;
|
|
||||||
|
|
||||||
while(internal::descartes(p,ar.low(),ar.high()) > 0) ar.refine();
|
|
||||||
while( p.sign_at(ar.low()) == ZERO ) ar.refine();
|
|
||||||
while( p.sign_at(ar.high()) == ZERO ) ar.refine();
|
|
||||||
|
|
||||||
CGAL::Sign result = p.sign_at(ar.low());
|
|
||||||
CGAL_assertion(result == p.sign_at(ar.high()));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
struct Is_zero_at_1
|
|
||||||
: public CGAL::cpp98::binary_function< Polynomial_1, Algebraic_real_1, bool > {
|
|
||||||
bool operator()( const Polynomial_1& p, const Algebraic_real_1& ar ) const {
|
|
||||||
if(CGAL::is_zero(p)) return true;
|
|
||||||
if( ar.low() == ar.high() ) return p.sign_at( ar.low() ) == ZERO;
|
|
||||||
Polynomial_1 g = gcd_utcf(p,ar.polynomial());
|
|
||||||
return g.sign_at(ar.low()) != g.sign_at(ar.high());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Is_square_free_1
|
|
||||||
: public CGAL::cpp98::unary_function< Polynomial_1, bool > {
|
|
||||||
bool operator()( const Polynomial_1& p ) const {
|
|
||||||
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Is_square_free isf;
|
|
||||||
return isf(p);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Is_coprime_1
|
|
||||||
: public CGAL::cpp98::binary_function< Polynomial_1, Polynomial_1, bool > {
|
|
||||||
bool operator()( const Polynomial_1& p1, const Polynomial_1& p2 ) const {
|
|
||||||
typename CGAL::Polynomial_traits_d< Polynomial_1 >::Total_degree total_degree;
|
|
||||||
|
|
||||||
// TODO: Is GCD already filtered?
|
|
||||||
return( total_degree( gcd_utcf( p1, p2 ) ) == 0 );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Make_square_free_1
|
|
||||||
: public CGAL::cpp98::unary_function< Polynomial_1, Polynomial_1 > {
|
|
||||||
Polynomial_1 operator()( const Polynomial_1& p ) const {
|
|
||||||
return typename CGAL::Polynomial_traits_d< Polynomial_1 >::Make_square_free()( p );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Make_coprime_1 {
|
|
||||||
typedef bool result_type;
|
|
||||||
typedef Polynomial_1 first_argument_type;
|
|
||||||
typedef Polynomial_1 second_argument_type;
|
|
||||||
typedef Polynomial_1 third_argument_type;
|
|
||||||
typedef Polynomial_1 fourth_argument_type;
|
|
||||||
typedef Polynomial_1 fifth_argument_type;
|
|
||||||
|
|
||||||
bool operator()( const Polynomial_1& p1,
|
|
||||||
const Polynomial_1& p2,
|
|
||||||
Polynomial_1& g, // ggT utcf
|
|
||||||
Polynomial_1& q1, // Rest utcf
|
|
||||||
Polynomial_1& q2 ) const {
|
|
||||||
g = typename CGAL::Polynomial_traits_d< Polynomial_1 >::Gcd_up_to_constant_factor()( p1, p2 );
|
|
||||||
q1 = p1 / g;
|
|
||||||
q2 = p2 / g;
|
|
||||||
return CGAL::is_one(g);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct Square_free_factorize_1 {
|
|
||||||
template< class OutputIterator>
|
|
||||||
OutputIterator operator()( const Polynomial_1& p, OutputIterator it) const {
|
|
||||||
typename PT_1::Square_free_factorize_up_to_constant_factor sqff;
|
|
||||||
return sqff(p,it);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Compute_polynomial_1 : public CGAL::cpp98::unary_function<Algebraic_real_1,
|
|
||||||
Polynomial_1> {
|
|
||||||
Polynomial_1 operator()(const Algebraic_real_1& x) const {
|
|
||||||
return x.polynomial();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Construct_algebraic_real_1 {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Algebraic_real_1 result_type;
|
|
||||||
|
|
||||||
result_type operator() (int a) const {
|
|
||||||
return Algebraic_real_1(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (Bound a) const {
|
|
||||||
return Algebraic_real_1(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator()
|
|
||||||
(typename CGAL::First_if_different<Coefficient,Bound>::Type a) const {
|
|
||||||
Coefficient coeffs[2] = {a,Coefficient(-1)};
|
|
||||||
Polynomial_1 p = typename PT_1::Construct_polynomial()
|
|
||||||
(coeffs,coeffs+2);
|
|
||||||
std::vector<Algebraic_real_1 > roots;
|
|
||||||
Solve_1()(p,true,std::back_inserter(roots));
|
|
||||||
CGAL_assertion(roots.size() == size_type(1));
|
|
||||||
return roots[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
result_type operator() (Polynomial_1 p,size_type i)
|
|
||||||
const {
|
|
||||||
std::vector<Algebraic_real_1 > roots;
|
|
||||||
Solve_1()(p,true,std::back_inserter(roots));
|
|
||||||
CGAL_assertion( size_type(roots.size()) > i);
|
|
||||||
return roots[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (Polynomial_1 p,
|
|
||||||
Bound l, Bound u) const {
|
|
||||||
CGAL_precondition(l<u);
|
|
||||||
return Algebraic_real_1(p,l,u);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Compare_1
|
|
||||||
: public CGAL::cpp98::binary_function<Algebraic_real_1,
|
|
||||||
Algebraic_real_1,
|
|
||||||
CGAL::Comparison_result>{
|
|
||||||
|
|
||||||
typedef CGAL::Comparison_result result_type;
|
|
||||||
|
|
||||||
result_type operator() (Algebraic_real_1 a,Algebraic_real_1 b) const {
|
|
||||||
return typename Real_embeddable_traits<Algebraic_real_1>
|
|
||||||
::Compare() (a,b);
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (Algebraic_real_1 a,int b) const {
|
|
||||||
return this->operator()(a,Construct_algebraic_real_1()(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (Algebraic_real_1 a,Bound b) const {
|
|
||||||
return this->operator()(a,Construct_algebraic_real_1()(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
result_type operator()
|
|
||||||
(Algebraic_real_1 a,
|
|
||||||
typename CGAL::First_if_different<Coefficient,Bound>::Type b) const {
|
|
||||||
return this->operator()(a,Construct_algebraic_real_1()(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (int a, Algebraic_real_1 b) const {
|
|
||||||
return this->operator()(Construct_algebraic_real_1()(a),b);
|
|
||||||
}
|
|
||||||
|
|
||||||
result_type operator() (Bound a,Algebraic_real_1 b) const {
|
|
||||||
return this->operator()(Construct_algebraic_real_1()(a),b);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
result_type operator()
|
|
||||||
(typename CGAL::First_if_different<Coefficient,Bound>::Type a,
|
|
||||||
Algebraic_real_1 b) const {
|
|
||||||
return this->operator()(Construct_algebraic_real_1()(a),b);
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
struct Isolate_1 : public CGAL::cpp98::binary_function
|
|
||||||
< Algebraic_real_1,Polynomial_1,std::pair<Bound,Bound> > {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::pair<Bound,Bound> operator() (const Algebraic_real_1 a,
|
|
||||||
const Polynomial_1 p) const {
|
|
||||||
|
|
||||||
if(p == a.polynomial()) return std::make_pair(a.low(),a.high());
|
|
||||||
|
|
||||||
std::vector<Algebraic_real_1> roots;
|
|
||||||
// First isolate p...
|
|
||||||
Solve_1()(p,false,std::back_inserter(roots));
|
|
||||||
typedef typename std::vector<Algebraic_real_1>::iterator Iterator;
|
|
||||||
// Binary search on the root to find a place where a could be inserted
|
|
||||||
std::pair<Iterator,Iterator> it_pair
|
|
||||||
= equal_range(roots.begin(),roots.end(),a);
|
|
||||||
CGAL_assertion(std::distance(it_pair.first,it_pair.second)==0 ||
|
|
||||||
std::distance(it_pair.first,it_pair.second)==1);
|
|
||||||
// If we can insert a in two places, it must have been in roots already
|
|
||||||
bool a_in_roots = std::distance(it_pair.first,it_pair.second)==1;
|
|
||||||
if(a_in_roots) {
|
|
||||||
// TODO: can we rely on the property that the isolating intervals
|
|
||||||
// of the roots in p are isolating from each other. What
|
|
||||||
// if p was factorized during isolation? Is that still
|
|
||||||
// guaranteed? To be sure, we do it this way:
|
|
||||||
if(it_pair.first!=roots.begin()) {
|
|
||||||
it_pair.first->strong_refine(*(it_pair.first-1));
|
|
||||||
}
|
|
||||||
if(it_pair.second!=roots.end()) {
|
|
||||||
it_pair.first->strong_refine(*(it_pair.second));
|
|
||||||
}
|
|
||||||
return std::make_pair(it_pair.first->low(),it_pair.first->high());
|
|
||||||
} else {
|
|
||||||
// Refine a until disjoint from neighbors
|
|
||||||
// This is probably not even necessary since the isolating
|
|
||||||
// interval of a isolates against all roots of p thanks to the
|
|
||||||
// comparisons. But to be sure...
|
|
||||||
if(it_pair.first!=roots.begin()) {
|
|
||||||
a.strong_refine(*(it_pair.first-1));
|
|
||||||
}
|
|
||||||
if(it_pair.first!=roots.end()) {
|
|
||||||
a.strong_refine(*(it_pair.first));
|
|
||||||
}
|
|
||||||
return std::make_pair(a.low(),a.high());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef typename Algebraic_real_traits::Bound_between Bound_between_1;
|
|
||||||
typedef typename Algebraic_real_traits::Approximate_absolute_1 Approximate_absolute_1;
|
|
||||||
typedef typename Algebraic_real_traits::Approximate_relative_1 Approximate_relative_1;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_1_PRED(Y,Z) Y Z() const { return Y(); }
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_1_PRED_WITH_KERNEL \
|
|
||||||
Y Z() const { return Y((const Algebraic_kernel_d_1*)this); }
|
|
||||||
|
|
||||||
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_square_free_1,
|
|
||||||
is_square_free_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_square_free_1,
|
|
||||||
make_square_free_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Square_free_factorize_1,
|
|
||||||
square_free_factorize_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_coprime_1,
|
|
||||||
is_coprime_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Make_coprime_1,
|
|
||||||
make_coprime_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Solve_1,
|
|
||||||
solve_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Number_of_solutions_1,
|
|
||||||
number_of_solutions_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Construct_algebraic_real_1,
|
|
||||||
construct_algebraic_real_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Sign_at_1,
|
|
||||||
sign_at_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Is_zero_at_1,
|
|
||||||
is_zero_at_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Compare_1,compare_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Bound_between_1,
|
|
||||||
bound_between_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Approximate_absolute_1,
|
|
||||||
approximate_absolute_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Approximate_relative_1,
|
|
||||||
approximate_relative_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Compute_polynomial_1,
|
|
||||||
compute_polynomial_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Isolate_1,
|
|
||||||
isolate_1_object);
|
|
||||||
|
|
||||||
// Deprecated
|
|
||||||
#if CGAL_AK_ENABLE_DEPRECATED_INTERFACE
|
|
||||||
typedef Bound Boundary;
|
|
||||||
typedef typename Algebraic_real_traits::Refine Refine_1;
|
|
||||||
typedef typename Algebraic_real_traits::Lower_bound Lower_bound_1;
|
|
||||||
typedef typename Algebraic_real_traits::Upper_bound Upper_bound_1;
|
|
||||||
typedef typename Algebraic_real_traits::Lower_bound Lower_boundary_1;
|
|
||||||
typedef typename Algebraic_real_traits::Upper_bound Upper_boundary_1;
|
|
||||||
typedef Bound_between_1 Boundary_between_1;
|
|
||||||
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Refine_1, refine_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Lower_bound_1, lower_bound_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Upper_bound_1, upper_bound_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Lower_boundary_1, lower_boundary_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Upper_boundary_1, upper_boundary_1_object);
|
|
||||||
CGAL_ALGEBRAIC_KERNEL_1_PRED(Boundary_between_1, boundary_between_1_object);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef CGAL_ALGEBRAIC_KERNEL_1_PRED
|
|
||||||
|
|
||||||
};
|
|
||||||
} // namespace internal
|
|
||||||
|
|
||||||
|
|
||||||
template< class Coefficient,
|
|
||||||
class Bound = typename CGAL::Get_arithmetic_kernel< Coefficient >::Arithmetic_kernel::Rational,
|
|
||||||
class RepClass = internal::Algebraic_real_rep< Coefficient, Bound >,
|
|
||||||
class Isolator = internal::Descartes< typename CGAL::Polynomial_type_generator<Coefficient,1>::Type, Bound > >
|
|
||||||
class Algebraic_kernel_d_1
|
|
||||||
: public internal::Algebraic_kernel_d_1_base<
|
|
||||||
|
|
||||||
// Template argument #1 (AlgebraicReal1)
|
|
||||||
internal::Algebraic_real_d_1<
|
|
||||||
Coefficient,
|
|
||||||
Bound,
|
|
||||||
::CGAL::Handle_policy_no_union,
|
|
||||||
RepClass >,
|
|
||||||
|
|
||||||
// Template argument #2 (Isolator_)
|
|
||||||
Isolator >
|
|
||||||
|
|
||||||
{};
|
|
||||||
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_D_1_H
|
|
|
@ -1,45 +0,0 @@
|
||||||
// Copyright (c) 2006-2009 Max-Planck-Institute Saarbruecken (Germany).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
|
||||||
// modify it under the terms of the GNU Lesser General Public License as
|
|
||||||
// published by the Free Software Foundation; either version 3 of the License,
|
|
||||||
// or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0+
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Michael Kerber <mkerber@mpi-inf.mpg.de>
|
|
||||||
//
|
|
||||||
// ============================================================================
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_D_2_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_D_2_H
|
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
|
|
||||||
#include <CGAL/Algebraic_kernel_d_1.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_d/Algebraic_curve_kernel_2.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template<typename Coefficient> class Algebraic_kernel_d_2
|
|
||||||
: public CGAL::Algebraic_curve_kernel_2
|
|
||||||
< CGAL::Algebraic_kernel_d_1 <Coefficient> >
|
|
||||||
{};
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#include <CGAL/enable_warnings.h>
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_D_1_H
|
|
|
@ -1,231 +0,0 @@
|
||||||
// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud, Sylvain Pion
|
|
||||||
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTION_OBJECTS_ON_ROOTS_AND_POLYNOMIALS_2_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTION_OBJECTS_ON_ROOTS_AND_POLYNOMIALS_2_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_2.h>
|
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomials_2_2.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_for_circles/internal_functions_on_roots_and_polynomial_1_2_and_2_2.h>
|
|
||||||
#include <CGAL/Algebraic_kernel_for_circles/internal_functions_comparison_root_for_circles_2_2.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
namespace AlgebraicFunctors {
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Solve
|
|
||||||
{
|
|
||||||
typedef typename AK::Polynomial_for_circles_2_2 Equation_Circle;
|
|
||||||
typedef typename AK::Polynomial_1_2 Equation_Line;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef void result_type;
|
|
||||||
|
|
||||||
template < class OutputIterator >
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Equation_Circle & e1,
|
|
||||||
const Equation_Circle & e2,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::solve<AK> ( e1, e2, res); }
|
|
||||||
|
|
||||||
template < class OutputIterator >
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Equation_Line & e1,
|
|
||||||
const Equation_Circle & e2,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::solve<AK> ( e1, e2, res); }
|
|
||||||
|
|
||||||
|
|
||||||
template < class OutputIterator >
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Equation_Circle & e1,
|
|
||||||
const Equation_Line & e2,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::solve<AK> ( e1, e2, res); }
|
|
||||||
|
|
||||||
template < class OutputIterator >
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Equation_Line & e1,
|
|
||||||
const Equation_Line & e2,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::solve<AK> ( e1, e2, res); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Construct_polynomial_for_circles_2_2
|
|
||||||
{
|
|
||||||
typedef typename AK::RT RT;
|
|
||||||
typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Polynomial_for_circles_2_2 result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()(const RT& xc, const RT& yc, const RT& r_sq) const
|
|
||||||
{ return Polynomial_for_circles_2_2(xc, yc, r_sq); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Construct_polynomial_1_2
|
|
||||||
{
|
|
||||||
typedef typename AK::RT RT;
|
|
||||||
typedef typename AK::Polynomial_1_2 Polynomial_1_2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef Polynomial_1_2 result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()( const RT& a, const RT& b, const RT& c) const
|
|
||||||
{ return Polynomial_1_2(a, b, c); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Sign_at
|
|
||||||
{
|
|
||||||
typedef typename AK::Polynomial_1_2 Polynomial_1_2;
|
|
||||||
typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2;
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef CGAL::Sign result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()( const Polynomial_for_circles_2_2 & equation,
|
|
||||||
const Root_for_circles_2_2 & r ) const
|
|
||||||
{ return AlgebraicFunctors::sign_at<AK>(equation, r); }
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()( const Polynomial_1_2 & equation,
|
|
||||||
const Root_for_circles_2_2 & r ) const
|
|
||||||
{ return AlgebraicFunctors::sign_at<AK>(equation, r); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class X_critical_points
|
|
||||||
{
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef void result_type;
|
|
||||||
|
|
||||||
Root_for_circles_2_2
|
|
||||||
operator()(const Polynomial_for_circles_2_2 & c,
|
|
||||||
bool i) const
|
|
||||||
{ return AlgebraicFunctors::x_critical_point<AK>(c,i); }
|
|
||||||
|
|
||||||
template <class OutputIterator>
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Polynomial_for_circles_2_2 & c,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::x_critical_points<AK>(c,res); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Y_critical_points
|
|
||||||
{
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
typedef typename AK::Polynomial_for_circles_2_2 Polynomial_for_circles_2_2;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef void result_type;
|
|
||||||
|
|
||||||
Root_for_circles_2_2
|
|
||||||
operator()(const Polynomial_for_circles_2_2 & c,
|
|
||||||
bool i) const
|
|
||||||
{ return AlgebraicFunctors::y_critical_point<AK>(c,i); }
|
|
||||||
|
|
||||||
template <class OutputIterator>
|
|
||||||
OutputIterator
|
|
||||||
operator()(const Polynomial_for_circles_2_2 & c,
|
|
||||||
OutputIterator res) const
|
|
||||||
{ return AlgebraicFunctors::y_critical_points<AK>(c,res); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Compare_x
|
|
||||||
{
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
typedef typename AK::RT RT;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef CGAL::Comparison_result result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()(const Root_for_circles_2_2& r1,
|
|
||||||
const Root_for_circles_2_2& r2) const
|
|
||||||
{ return AlgebraicFunctors::compare_x<RT>(r1, r2); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Compare_y
|
|
||||||
{
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
typedef typename AK::RT RT;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef CGAL::Comparison_result result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()(const Root_for_circles_2_2& r1,
|
|
||||||
const Root_for_circles_2_2& r2) const
|
|
||||||
{ return AlgebraicFunctors::compare_y<RT>(r1, r2); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
class Compare_xy
|
|
||||||
{
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
typedef typename AK::RT RT;
|
|
||||||
|
|
||||||
public:
|
|
||||||
typedef CGAL::Comparison_result result_type;
|
|
||||||
|
|
||||||
result_type
|
|
||||||
operator()(const Root_for_circles_2_2& r1,
|
|
||||||
const Root_for_circles_2_2& r2) const
|
|
||||||
{ return AlgebraicFunctors::compare_xy<RT>(r1, r2); }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace AlgebraicFunctors
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTION_OBJECTS_ON_ROOTS_AND_POLYNOMIALS_2_H
|
|
|
@ -1,61 +0,0 @@
|
||||||
// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck
|
|
||||||
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_COMPARISON_ROOT_FOR_CIRCLES_2_2_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_COMPARISON_ROOT_FOR_CIRCLES_2_2_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_2.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
namespace AlgebraicFunctors{
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_x(const CGAL::Root_for_circles_2_2<RT>& r1, const CGAL::Root_for_circles_2_2<RT>& r2){
|
|
||||||
return compare(r1.x(), r2.x());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_y(const CGAL::Root_for_circles_2_2<RT>& r1, const CGAL::Root_for_circles_2_2<RT>& r2){
|
|
||||||
return compare(r1.y(), r2.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_xy(const CGAL::Root_for_circles_2_2<RT>& r1, const CGAL::Root_for_circles_2_2<RT>& r2){
|
|
||||||
Comparison_result compx = compare_x(r1, r2);
|
|
||||||
if(compx != 0)
|
|
||||||
return compx;
|
|
||||||
return compare_y(r1, r2);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace AlgebraicFunctors
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_COMPARISON_ROOT_FOR_CIRCLES_2_2_H
|
|
|
@ -1,193 +0,0 @@
|
||||||
// Copyright (c) 2003-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud, Sylvain Pion, Julien Hazebrouck
|
|
||||||
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIAL_1_2_AND_2_2_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIAL_1_2_AND_2_2_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_2.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
namespace AlgebraicFunctors {
|
|
||||||
|
|
||||||
|
|
||||||
template < class AK, class OutputIterator >
|
|
||||||
inline
|
|
||||||
OutputIterator
|
|
||||||
solve( const typename AK::Polynomial_1_2 & e1,
|
|
||||||
const typename AK::Polynomial_for_circles_2_2 & e2,
|
|
||||||
OutputIterator res )
|
|
||||||
{
|
|
||||||
typedef typename AK::FT FT;
|
|
||||||
typedef typename AK::Root_of_2 Root_of_2;
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
if (is_zero(e1.a())){//horizontal line
|
|
||||||
|
|
||||||
const FT hy = -e1.c()/e1.b();
|
|
||||||
const FT hdisc = e2.r_sq() - CGAL::square(hy - e2.b());
|
|
||||||
CGAL::Sign sign_hdisc = CGAL::sign(hdisc);
|
|
||||||
|
|
||||||
if(sign_hdisc == NEGATIVE) return res;
|
|
||||||
if(sign_hdisc == ZERO) {
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(Root_of_2(e2.a()),
|
|
||||||
Root_of_2(hy)), 2u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
const Root_of_2 x_res1 = make_root_of_2(e2.a(),FT(-1),hdisc);
|
|
||||||
const Root_of_2 x_res2 = make_root_of_2(e2.a(),FT(1),hdisc);
|
|
||||||
const Root_of_2 y_res = Root_of_2(hy);
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(x_res1, y_res), 1u);
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(x_res2, y_res), 1u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
else if(is_zero(e1.b())){//vertical line
|
|
||||||
|
|
||||||
const FT vx = -e1.c()/e1.a();
|
|
||||||
const FT vdisc = e2.r_sq() - CGAL::square(vx - e2.a());
|
|
||||||
CGAL::Sign sign_vdisc = CGAL::sign(vdisc);
|
|
||||||
|
|
||||||
if(sign_vdisc == NEGATIVE) return res;
|
|
||||||
if(sign_vdisc == ZERO) {
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(Root_of_2(vx),
|
|
||||||
Root_of_2(e2.b())), 2u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Root_of_2 x_res = Root_of_2(vx);
|
|
||||||
const Root_of_2 y_res1 = make_root_of_2(e2.b(),FT(-1),vdisc);
|
|
||||||
const Root_of_2 y_res2 = make_root_of_2(e2.b(),FT(1),vdisc);
|
|
||||||
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(x_res, y_res1), 1u);
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(x_res, y_res2), 1u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
const FT line_factor = CGAL::square(e1.a()) + CGAL::square(e1.b());
|
|
||||||
const FT disc = line_factor*e2.r_sq() -
|
|
||||||
CGAL::square(e1.a()*e2.a() + e1.b()*e2.b() + e1.c());
|
|
||||||
CGAL::Sign sign_disc = CGAL::sign(disc);
|
|
||||||
|
|
||||||
if (sign_disc == NEGATIVE) return res;
|
|
||||||
|
|
||||||
const FT aux = e1.b()*e2.a() - e1.a()*e2.b();
|
|
||||||
const FT x_base = (aux*e1.b() - e1.a()*e1.c()) / line_factor;
|
|
||||||
const FT y_base = (-aux*e1.a() - e1.b()*e1.c()) / line_factor;
|
|
||||||
|
|
||||||
if (sign_disc == ZERO) {
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(Root_of_2(x_base),
|
|
||||||
Root_of_2(y_base)), 2u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
// We have two intersection points, whose coordinates are one-root numbers.
|
|
||||||
const FT x_root_coeff = e1.b() / line_factor;
|
|
||||||
const FT y_root_coeff = e1.a() / line_factor;
|
|
||||||
|
|
||||||
if (CGAL::sign(e1.b()) == POSITIVE) {
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc),
|
|
||||||
make_root_of_2(y_base, y_root_coeff, disc)), 1u);
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc),
|
|
||||||
make_root_of_2(y_base, -y_root_coeff, disc)), 1u);
|
|
||||||
} else {
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(make_root_of_2(x_base, x_root_coeff, disc),
|
|
||||||
make_root_of_2(y_base, -y_root_coeff, disc)), 1u);
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(make_root_of_2(x_base, -x_root_coeff, disc),
|
|
||||||
make_root_of_2(y_base, y_root_coeff, disc)), 1u);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template < class AK, class OutputIterator >
|
|
||||||
inline
|
|
||||||
OutputIterator
|
|
||||||
solve( const typename AK::Polynomial_for_circles_2_2 & e1,
|
|
||||||
const typename AK::Polynomial_1_2 & e2,
|
|
||||||
OutputIterator res )
|
|
||||||
{
|
|
||||||
return solve<AK> (e2, e1, res);
|
|
||||||
}
|
|
||||||
|
|
||||||
template < class AK, class OutputIterator >
|
|
||||||
inline
|
|
||||||
OutputIterator
|
|
||||||
solve( const typename AK::Polynomial_1_2 & e1,
|
|
||||||
const typename AK::Polynomial_1_2 & e2,
|
|
||||||
OutputIterator res )
|
|
||||||
{
|
|
||||||
typedef typename AK::FT FT;
|
|
||||||
typedef typename AK::Root_of_2 Root_of_2;
|
|
||||||
typedef typename AK::Root_for_circles_2_2 Root_for_circles_2_2;
|
|
||||||
//parallele case
|
|
||||||
const FT delta = e1.a()*e2.b() - e2.a()*e1.b();
|
|
||||||
if(is_zero(delta)) return res;
|
|
||||||
//case : e2 horizontal
|
|
||||||
if(is_zero(e2.a())){
|
|
||||||
const FT sol = -e2.c()/e2.b();
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(Root_of_2(-(e1.b()*sol + e1.c())/e1.a()),
|
|
||||||
Root_of_2(sol)), 1u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
//general case
|
|
||||||
const FT sol = (e2.a()*e1.c() - e2.c()*e1.a()) / delta;
|
|
||||||
*res++ = std::make_pair
|
|
||||||
( Root_for_circles_2_2(Root_of_2(-(e2.b()*sol + e2.c())/e2.a()),
|
|
||||||
Root_of_2(sol)), 1u);
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
template < class AK >
|
|
||||||
inline
|
|
||||||
Sign sign_at( const typename AK::Polynomial_1_2 & equation,
|
|
||||||
const typename AK::Root_for_circles_2_2 & r)
|
|
||||||
{
|
|
||||||
Comparison_result c = compare(r.x()*equation.a(),
|
|
||||||
-equation.c() - r.y()*equation.b());
|
|
||||||
if(c == EQUAL) return ZERO;
|
|
||||||
if(c == LARGER) return POSITIVE;
|
|
||||||
return NEGATIVE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace AlgebraicFunctors
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_FOR_CIRCLES_FUNCTIONS_ON_ROOTS_AND_POLYNOMIAL_1_2_AND_2_2_H
|
|
|
@ -1,79 +0,0 @@
|
||||||
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
|
|
||||||
// Sylvain Pion
|
|
||||||
// Pedro Machado
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_COMPARISON_ROOT_FOR_SPHERES_2_3_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_COMPARISON_ROOT_FOR_SPHERES_2_3_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_3.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
namespace AlgebraicSphereFunctors{
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_x(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
|
||||||
return compare(r1.x(), r2.x());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_y(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
|
||||||
return compare(r1.y(), r2.y());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_z(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
|
||||||
return compare(r1.z(), r2.z());
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_xy(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
|
||||||
Comparison_result compx = compare_x(r1, r2);
|
|
||||||
if(compx != 0)
|
|
||||||
return compx;
|
|
||||||
return compare_y(r1, r2);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename RT>
|
|
||||||
Comparison_result
|
|
||||||
compare_xyz(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
|
||||||
Comparison_result compxy = compare_xy(r1, r2);
|
|
||||||
if(compxy != 0)
|
|
||||||
return compxy;
|
|
||||||
return compare_z(r1, r2);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace AlgebraicSphereFunctors
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_ALGEBRAIC_KERNEL_COMPARISON_ROOT_FOR_SPHERES_2_3_H
|
|
|
@ -1,76 +0,0 @@
|
||||||
// Copyright (c) 2005-2006 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org).
|
|
||||||
// You can redistribute it and/or modify it under the terms of the GNU
|
|
||||||
// General Public License as published by the Free Software Foundation,
|
|
||||||
// either version 3 of the License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// Licensees holding a valid commercial license may use this file in
|
|
||||||
// accordance with the commercial license agreement provided with the software.
|
|
||||||
//
|
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
//
|
|
||||||
// Partially supported by the IST Programme of the EU as a Shared-cost
|
|
||||||
// RTD (FET Open) Project under Contract No IST-2000-26473
|
|
||||||
// (ECG - Effective Computational Geometry for Curves and Surfaces)
|
|
||||||
// and a STREP (FET Open) Project under Contract No IST-006413
|
|
||||||
// (ACS -- Algorithms for Complex Shapes)
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: GPL-3.0+
|
|
||||||
//
|
|
||||||
// Author(s) : Monique Teillaud <Monique.Teillaud@sophia.inria.fr>
|
|
||||||
// Sylvain Pion
|
|
||||||
// Pedro Machado
|
|
||||||
|
|
||||||
#ifndef CGAL_ALGEBRAIC_KERNEL_FUNCTIONS_ON_ROOTS_AND_POLYNOMIALS_1_3_H
|
|
||||||
#define CGAL_ALGEBRAIC_KERNEL_FUNCTIONS_ON_ROOTS_AND_POLYNOMIALS_1_3_H
|
|
||||||
|
|
||||||
#include <CGAL/license/Circular_kernel_3.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
namespace AlgebraicSphereFunctors {
|
|
||||||
|
|
||||||
template < class AK, class OutputIterator >
|
|
||||||
inline
|
|
||||||
OutputIterator
|
|
||||||
solve( const typename AK::Polynomial_1_3 & e1,
|
|
||||||
const typename AK::Polynomial_1_3 & e2,
|
|
||||||
const typename AK::Polynomial_1_3 & e3,
|
|
||||||
OutputIterator res )
|
|
||||||
{
|
|
||||||
typedef typename AK::FT FT;
|
|
||||||
typedef typename AK::Root_for_spheres_2_3 Root_for_spheres_2_3;
|
|
||||||
CGAL_kernel_precondition(!(same_solutions<FT>(e1,e2) || same_solutions<FT>(e1,e3) ||
|
|
||||||
same_solutions<FT>(e2,e3)));
|
|
||||||
const FT &a1 = e1.a();
|
|
||||||
const FT &a2 = e2.a();
|
|
||||||
const FT &a3 = e3.a();
|
|
||||||
const FT &b1 = e1.b();
|
|
||||||
const FT &b2 = e2.b();
|
|
||||||
const FT &b3 = e3.b();
|
|
||||||
const FT &c1 = e1.c();
|
|
||||||
const FT &c2 = e2.c();
|
|
||||||
const FT &c3 = e3.c();
|
|
||||||
const FT &d1 = e1.d();
|
|
||||||
const FT &d2 = e2.d();
|
|
||||||
const FT &d3 = e3.d();
|
|
||||||
FT denominateur = (a1*b2*c3-a1*b3*c2-a2*b1*c3+a2*b3*c1-a3*b2*c1+a3*b1*c2);
|
|
||||||
//if denominateur == 0 it's because the planes are parallel
|
|
||||||
if (denominateur == 0) return res;
|
|
||||||
FT z = -(a2*b3*d1-a1*b3*d2+a1*b2*d3-a3*b2*d1-a2*b1*d3+a3*b1*d2)/denominateur;
|
|
||||||
FT y = (-a1*d2*c3+a1*c2*d3-a2*c1*d3-a3*c2*d1+a3*c1*d2+a2*c3*d1)/denominateur;
|
|
||||||
FT x = -(-b1*d2*c3+b1*c2*d3+b3*c1*d2-b2*c1*d3+b2*d1*c3-b3*c2*d1)/denominateur;
|
|
||||||
*res++ = std::make_pair(Root_for_spheres_2_3(x,y,z),
|
|
||||||
static_cast<unsigned>(1));
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //CGAL_ALGEBRAIC_KERNEL_FUNCTIONS_ON_ROOTS_AND_POLYNOMIALS_1_3_H
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue