1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-20 16:26:54 +01:00

57 Commits

Author SHA1 Message Date
d786524508 proper cmake package config 2024-02-08 19:08:44 +01:00
534013fd87 source list fix 2024-02-08 19:08:17 +01:00
1c8add56ef cmake comments 2024-02-08 15:00:09 +01:00
cce9faaba6 fix and cleanup of library compilation 2024-02-08 14:50:29 +01:00
4419139bd1 CMake first working compilation for library 2024-01-29 17:00:32 +01:00
0b5c6e851c first cmake draft, source relocation, not working 2024-01-28 22:13:07 -03:00
0b5da3866e remove LatAnalyze link 2024-01-28 19:33:38 -03:00
4823426d55 update build helper scripts 2024-01-19 22:50:12 -03:00
a620ff7b1c gitignore update 2024-01-19 22:44:15 -03:00
00cf854408 DWT fix 2024-01-19 22:42:46 -03:00
b938a855e3 DataFilter cleanup and Laplacian filter with CDR optimisation 2024-01-19 22:39:52 -03:00
83e09b82fc moving covariance matrix to StatArray 2024-01-19 22:39:16 -03:00
fde57d79f3 moving variance matrix to StatArray 2024-01-19 22:36:29 -03:00
145155f733 general interface for filtering data 2024-01-14 20:23:02 -03:00
6739019c83 log scale basis in plots 2024-01-12 14:22:23 +01:00
13fddf4947 DWT concatenation and CDR 2024-01-12 14:22:05 +01:00
1604b4712f CDR & NSDR 2024-01-12 14:21:39 +01:00
c73b609ac5 2pt fit: option to bypass parameter guess 2023-08-18 13:54:55 +01:00
05138baa08 fix of potential conflict with std::size 2023-06-20 15:47:58 +01:00
a0bdbfd9dd Update build-macos.yml 2023-03-20 14:04:17 +00:00
7fd31d1fcc object to plot single point 2022-08-03 14:24:36 +01:00
f0c3fd4d7d PlotData fix 2022-08-03 14:24:20 +01:00
470aff3b4a Laplace filter in 2-pt fit 2022-04-29 16:45:02 +01:00
c9ea23dc92 Merge branch 'master' into develop 2022-03-10 08:34:53 +00:00
58a355478a Merge branch 'feature/dwt' into develop 2022-03-10 08:21:40 +00:00
4f919bc007 tool to merge samples 2022-03-10 08:21:26 +00:00
9455e2c66e correlation matrix plot compute dynamic range 2022-03-10 08:21:10 +00:00
43dd295f94 data plots compatible with multi-column arrays 2022-03-10 08:20:38 +00:00
9afd40a1ad utility to compute sample DWT 2022-03-10 08:16:40 +00:00
9e78b96260 DWT working and tested 2022-02-18 14:06:52 +00:00
65a656f257 first skeleton for DWT 2022-02-17 19:24:34 +00:00
47d0b3f040 correlation dynamic range renaming 2022-02-16 19:03:19 +00:00
35f6733292 sample-plot-corr better palette 2022-02-16 18:55:24 +00:00
ebc1bd4c2e fit: stable variance inversion and SVD dynamic range 2022-02-16 18:55:08 +00:00
857a8e59c9 corr to var and SVD dynamic range 2022-02-16 18:54:16 +00:00
0de8091f3c Eigen plugin const 2022-02-16 18:53:45 +00:00
e4cefae515 special macro to plot correlation matrices 2021-12-28 12:17:02 +01:00
8cd29c2bee XYStatData fixes 2021-12-26 22:21:03 +01:00
bac8356de5 Ignore verbose minimiser for samples 2021-12-21 18:18:14 +01:00
60d91cbff5 plot data with points 2021-12-20 01:30:26 +01:00
adf2c9cc69 normalised residuals routines 2021-12-20 01:30:03 +01:00
24a7b9c203 remove new covariance routine regression code 2021-12-20 01:29:29 +01:00
57c6004797 significant optimisation of covariance routines + checks 2021-12-20 01:25:13 +01:00
c796187d1e Absolute value plot (useful for log scale) 2021-12-14 13:13:36 +00:00
b92fb84e9d adding pthread link 2021-11-29 00:03:19 +00:00
5e04a0321e Merge branch 'master' into develop 2021-11-28 23:57:15 +00:00
78351a9b76 better interface for critical threaded sections 2021-11-28 23:51:56 +00:00
fe8c6c6630 Merge branch 'develop' of github.com:aportelli/LatAnalyze into develop 2021-11-28 23:26:20 +00:00
5f192ad30f Thread pool implementation 2021-11-28 23:26:17 +00:00
ccb837a244 Update build-macos.yml 2021-11-17 16:37:05 +00:00
75485219d8 CI uses HDF5 1.10.8 hoping to solve compilation issues on Big Sur 2021-11-17 16:17:45 +00:00
a3054a0f44 first GitHub CI 2021-11-17 16:06:26 +00:00
d6e5ba724d CI scripts expose number of build tasks 2021-11-16 21:35:35 +00:00
9341a31cf4 gitignore update 2021-11-16 21:34:39 +00:00
b4b6bd22fa compatible with Minuit2 in ROOT 2021-11-16 21:34:25 +00:00
d4704267d6 Dev version number 2020-11-27 13:34:58 +00:00
d67a25245e Merge tag 'v3.5.1' into develop 2020-11-27 13:34:26 +00:00
127 changed files with 2529 additions and 227 deletions

26
.github/workflows/build-macos.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Build macOS
on: [push, workflow_dispatch]
jobs:
build:
runs-on: macos-11
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install basic dependencies
run: brew install automake autoconf libtool bison flex
- name: Build dependencies
shell: bash
run: |
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:${PATH}
cd ci-scripts
./install-deps.sh prefix 6
- name: Build LatAnalyze
shell: bash
run: |
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:${PATH}
cd ci-scripts
./install-latan.sh prefix 6

26
.github/workflows/build-ubuntu.yml vendored Normal file
View File

@ -0,0 +1,26 @@
name: Build Ubuntu
on: [push]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install basic dependencies
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
sudo apt install cmake bison flex
- name: Build dependencies
shell: bash
run: |
cd ci-scripts
CC=clang CXX=clang++ ./install-deps.sh prefix 6
- name: Build LatAnalyze
shell: bash
run: |
cd ci-scripts
CC=clang CXX=clang++ ./install-latan.sh prefix 6

16
.gitignore vendored
View File

@ -12,21 +12,19 @@ sandbox/*
# autotools
autom4te.cache/*
*.in
*.in~
config.h*
configure
configure~
.buildutils/*
aclocal.m4
# bison/flex generated sources
lib/*Lexer.cpp
lib/*Parser.cpp
lib/*Parser.hpp
lib/LatAnalyze/*Lexer.cpp
lib/LatAnalyze/*Parser.cpp
lib/LatAnalyze/*Parser.hpp
# Eigen headers
lib/Eigen/*
lib/eigen_files.mk
# Eigen headers and archives
lib/LatAnalyze/Eigen
eigen-*.tar.bz2
# CI builds
ci-scripts/local/*

64
CMakeLists.txt Normal file
View File

@ -0,0 +1,64 @@
# package config
cmake_minimum_required(VERSION 3.11.0)
project(
LatAnalyze
VERSION 3.6
LANGUAGES C CXX)
# includes
include(CMakePackageConfigHelpers)
include(FetchContent)
include(FindPackageMessage)
include(GNUInstallDirs)
# C++ standard
set(CMAKE_CXX_STANDARD 14)
# fetch and create symbolic link to Eigen headers
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/deps)
FetchContent_Declare(
Eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0)
FetchContent_GetProperties(Eigen3)
if(NOT eigen3_POPULATED)
FetchContent_Populate(Eigen3)
message(STATUS "Eigen3 fetched")
endif()
file(CREATE_LINK ${eigen3_SOURCE_DIR}/Eigen ${CMAKE_SOURCE_DIR}/lib/LatAnalyze/Eigen
SYMBOLIC)
# dependencies
find_package(GSL REQUIRED)
find_package(HDF5 REQUIRED COMPONENTS C CXX)
find_package(Minuit2 QUIET)
if(Minuit2_FOUND)
set(Minuit2_MSG "yes")
find_package_message(
Minuit2
"Found Minuit2: ${Minuit2_DIR} (found version \"${Minuit2_VERSION}\")" " ")
else()
set(Minuit2_MSG "no")
message(STATUS "Minuit2 not found")
endif()
find_package(NLopt QUIET)
if(NLopt_FOUND)
set(NLopt_MSG "yes")
find_package_message(
NLopt "Found NLopt: ${NLopt_DIR} (found version \"${NLopt_VERSION}\")" " ")
else()
set(NLopt_MSG "no")
message(STATUS "NLopt not found")
endif()
# subdirectories
add_subdirectory(lib)
# summary
message(STATUS "---------------------------")
message(STATUS "LatAnalyze v${PROJECT_VERSION} configured")
message(STATUS "---------------------------")
message(STATUS " install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Minuit2 minimisers: ${Minuit2_MSG}")
message(STATUS " NLopt minimisers: ${NLopt_MSG}")
message(STATUS "---------------------------")

View File

@ -2,5 +2,5 @@
rm -rf .buildutils
mkdir -p .buildutils/m4
./update_eigen.sh eigen-3.3.8.tar.bz2
./update_eigen.sh eigen-3.4.0.tar.bz2
autoreconf -fvi

View File

@ -1,24 +0,0 @@
#!/bin/bash
set -e
PREFIX=`cat Makefile | grep '^prefix =' | awk '{print $3}'`
case $1 in
'')
echo '-- building...'
make -j8
echo '-- installing...'
make uninstall 1>/dev/null
make install 1>/dev/null;;
# if [[ `basename \`pwd\`` == "lib" ]]
# then
# echo '-- creating debug symbols...'
# dsymutil .libs/libLatAnalyze.0.dylib -o ${PREFIX}/lib/libLatAnalyze.0.dylib.dSYM
# fi;;
'clean')
echo '-- cleaning...'
make -j8 clean;;
*)
echo 'error: unknown action' 1>&2
exit 1;;
esac

View File

@ -1,15 +1,16 @@
#!/usr/bin/env bash
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
mkdir -p local/build
for d in gsl nlopt minuit hdf5; do
if [ ! -e local/.built.${d} ]; then
./install-${d}.sh ${PREFIX}
./install-${d}.sh ${PREFIX} ${NTASKS}
fi
done

View File

@ -2,11 +2,12 @@
NAME='gsl-2.6'
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
INITDIR=$(pwd -P)
@ -19,7 +20,7 @@ tar -xzvf ${NAME}.tar.gz
mkdir -p ${NAME}/build
cd ${NAME}/build
../configure --prefix=${PREFIX}
make -j4
make -j${NTASKS}
make install
cd ${INITDIR}/local
touch .built.gsl

View File

@ -1,12 +1,13 @@
#!/usr/bin/env bash
NAME='hdf5-1.10.5'
NAME='hdf5-1.10.8'
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
INITDIR=$(pwd -P)
@ -19,7 +20,7 @@ tar -xzvf ${NAME}.tar.gz
mkdir ${NAME}/build
cd ${NAME}/build
../configure --prefix=${PREFIX} --enable-cxx
make -j4
make -j${NTASKS}
make install
cd ${INITDIR}/local
touch .built.hdf5

View File

@ -1,10 +1,11 @@
#!/usr/bin/env bash
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
INITDIR=$(pwd -P)
@ -12,11 +13,11 @@ mkdir -p ${PREFIX}
cd ${PREFIX}
PREFIX=$(pwd -P)
cd ${INITDIR}
./install-deps.sh ${PREFIX}
./install-deps.sh ${PREFIX} ${NTASKS}
cd ..
./bootstrap.sh
mkdir -p build
cd build
../configure --prefix=${PREFIX} --with-minuit=${PREFIX} --with-nlopt=${PREFIX} --with-hdf5=${PREFIX} --with-gsl=${PREFIX} CXXFLAGS="${CXXFLAGS} -O3 -march=haswell -mtune=haswell"
make -j4
../configure --prefix=${PREFIX} --with-minuit=${PREFIX} --with-nlopt=${PREFIX} --with-hdf5=${PREFIX} --with-gsl=${PREFIX} CXXFLAGS="${CXXFLAGS} -O3 -march=native -mtune=native"
make -j${NTASKS}
make install

View File

@ -1,12 +1,12 @@
#!/usr/bin/env bash
NAME='Minuit2-5.34.14'
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
INITDIR=$(pwd -P)
@ -14,12 +14,12 @@ mkdir -p ${PREFIX}
cd ${PREFIX}
PREFIX=$(pwd -P)
cd ${INITDIR}/local/build
wget http://www.cern.ch/mathlibs/sw/5_34_14/Minuit2/${NAME}.tar.gz
tar -xzvf ${NAME}.tar.gz
mkdir -p ${NAME}/build
cd ${NAME}/build
../configure --prefix=${PREFIX} --disable-openmp
make -j4
rm -rf root
git clone https://github.com/root-project/root.git
cd root/math/minuit2/
mkdir build; cd build
cmake .. -Dminuit2_standalone=ON -DCMAKE_INSTALL_PREFIX=${PREFIX}
make -j${NTASKS}
make install
cd ${INITDIR}/local
touch .built.minuit

View File

@ -2,11 +2,12 @@
NAME='2.6.1'
if (( $# != 1 )); then
echo "usage: `basename $0` <prefix>" 1>&2
if (( $# != 2 )); then
echo "usage: `basename $0` <prefix> <ntasks>" 1>&2
exit 1
fi
PREFIX=$1
NTASKS=$2
set -ex
INITDIR=$(pwd -P)
@ -20,7 +21,7 @@ NAME=nlopt-${NAME}
mkdir -p ${NAME}/build
cd ${NAME}/build
cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=TRUE -DCMAKE_INSTALL_NAME_DIR="${PREFIX}/lib" ..
make -j4
make -j${NTASKS}
make install
cd ${INITDIR}/local
touch .built.nlopt

View File

@ -2,7 +2,7 @@
# Initialization
AC_PREREQ([2.63])
AC_INIT([LatAnalyze],[3.5.1],[antonin.portelli@me.com],[LatAnalyze])
AC_INIT([LatAnalyze],[3.5.1-dev],[antonin.portelli@me.com],[LatAnalyze])
AC_CONFIG_AUX_DIR([.buildutils])
AC_CONFIG_SRCDIR([lib/Global.cpp])
AC_CONFIG_SRCDIR([utils/sample_read.cpp])
@ -36,7 +36,7 @@ AC_ARG_WITH([gsl],
AC_ARG_WITH([minuit],
[AS_HELP_STRING([--with-minuit=prefix],
[try this for a non-standard install prefix of the Minuit2 library])],
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_minuit/include"]
[AM_CXXFLAGS="$AM_CXXFLAGS -I$with_minuit/include -I$with_minuit/include/Minuit2 -I$with_minuit/include/Fit"]
[AM_LDFLAGS="$AM_LDFLAGS -L$with_minuit/lib"])
AC_ARG_WITH([nlopt],
[AS_HELP_STRING([--with-nlopt=prefix],
@ -74,6 +74,7 @@ CXXFLAGS_CPY=$CXXFLAGS
LDFLAGS_CPY=$LDFLAGS
CXXFLAGS="$AM_CXXFLAGS $CXXFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
AC_CHECK_LIB([pthread],[pthread_create],[],[AC_MSG_ERROR([pthread library not found])])
AC_CHECK_LIB([m],[cos],[],[AC_MSG_ERROR([libm library not found])])
AC_CHECK_LIB([gslcblas],[cblas_dgemm],[],
[AC_MSG_ERROR([GSL CBLAS library not found])])
@ -90,10 +91,10 @@ AC_CHECK_LIB([hdf5_cpp],[H5Fopen],
[AC_MSG_ERROR([HDF5 library not found])], [-lhdf5])
SAVED_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -lMinuit2"
AC_MSG_CHECKING([for ROOT::Minuit2::BasicMinimumError in -lMinuit2]);
AC_MSG_CHECKING([for ROOT::Minuit2::VariableMetricMinimizer in -lMinuit2]);
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <Minuit2/BasicMinimumError.h>],
[ROOT::Minuit2::BasicMinimumError dummy(0)])],
[AC_LANG_PROGRAM([#include <Minuit2/VariableMetricMinimizer.h>],
[ROOT::Minuit2::VariableMetricMinimizer dummy()])],
[LIBS="$LIBS -lMinuit2"]
[AC_DEFINE([HAVE_MINUIT2],
[1],
@ -103,6 +104,20 @@ AC_LINK_IFELSE(
[have_minuit=false]
[AC_MSG_RESULT([no])])
AM_CONDITIONAL([HAVE_MINUIT], [test x$have_minuit = xtrue])
LDFLAGS="$LDFLAGS -lMinuit2Math"
AC_MSG_CHECKING([for ROOT::Math::MinimizerOptions in -lMinuit2Math]);
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <Minuit2/Math/MinimizerOptions.h>],
[ROOT::Math::MinimizerOptions dummy()])],
[LIBS="$LIBS -lMinuit2Math"]
[AC_DEFINE([HAVE_MINUIT2MATH],
[1],
[Define to 1 if you have the `Minuit2Math' library (-lMinuit2Math).])]
[have_minuitmath=true]
[AC_MSG_RESULT([yes])],
[have_minuitmath=false]
[AC_MSG_RESULT([no])])
AM_CONDITIONAL([HAVE_MINUITMATH], [test x$have_minuit = xtrue])
LDFLAGS=$SAVED_LDFLAGS
CXXFLAGS=$CXXFLAGS_CPY
LDFLAGS=$LDFLAGS_CPY

Binary file not shown.

View File

@ -9,6 +9,7 @@ endif
noinst_PROGRAMS = \
exCompiledDoubleFunction\
exDerivative \
exDWT \
exFit \
exFitSample \
exIntegrator \
@ -19,7 +20,8 @@ noinst_PROGRAMS = \
exPlot \
exPValue \
exRand \
exRootFinder
exRootFinder \
exThreadPool
exCompiledDoubleFunction_SOURCES = exCompiledDoubleFunction.cpp
exCompiledDoubleFunction_CXXFLAGS = $(COM_CXXFLAGS)
@ -29,6 +31,10 @@ exDerivative_SOURCES = exDerivative.cpp
exDerivative_CXXFLAGS = $(COM_CXXFLAGS)
exDerivative_LDFLAGS = -L../lib/.libs -lLatAnalyze
exDWT_SOURCES = exDWT.cpp
exDWT_CXXFLAGS = $(COM_CXXFLAGS)
exDWT_LDFLAGS = -L../lib/.libs -lLatAnalyze
exFit_SOURCES = exFit.cpp
exFit_CXXFLAGS = $(COM_CXXFLAGS)
exFit_LDFLAGS = -L../lib/.libs -lLatAnalyze
@ -73,4 +79,8 @@ exRootFinder_SOURCES = exRootFinder.cpp
exRootFinder_CXXFLAGS = $(COM_CXXFLAGS)
exRootFinder_LDFLAGS = -L../lib/.libs -lLatAnalyze
exThreadPool_SOURCES = exThreadPool.cpp
exThreadPool_CXXFLAGS = $(COM_CXXFLAGS)
exThreadPool_LDFLAGS = -L../lib/.libs -lLatAnalyze
ACLOCAL_AMFLAGS = -I .buildutils/m4

28
examples/exDWT.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <LatAnalyze/Numerical/DWT.hpp>
using namespace std;
using namespace Latan;
int main(void)
{
DVec data, dataRec;
vector<DWT::DWTLevel> dataDWT;
DWT dwt(DWTFilters::db3);
cout << "-- random data" << endl;
data.setRandom(16);
cout << data.transpose() << endl;
cout << "-- compute Daubechies 3 DWT" << endl;
dataDWT = dwt.forward(data, 4);
for (unsigned int l = 0; l < dataDWT.size(); ++l)
{
cout << "* level " << l << endl;
cout << "L= " << dataDWT[l].first.transpose() << endl;
cout << "H= " << dataDWT[l].second.transpose() << endl;
}
cout << "-- check inverse DWT" << endl;
dataRec = dwt.backward(dataDWT);
cout << "rel diff = " << 2.*(data - dataRec).norm()/(data + dataRec).norm() << endl;
return EXIT_SUCCESS;
}

View File

@ -7,7 +7,7 @@
using namespace std;
using namespace Latan;
constexpr Index size = 8;
constexpr Index n = 8;
constexpr Index nDraw = 20000;
constexpr Index nSample = 2000;
const string stateFileName = "exRand.seed";
@ -40,14 +40,14 @@ int main(void)
p << PlotFunction(compile("return exp(-x_0^2/2)/sqrt(2*pi);", 1), -5., 5.);
p.display();
DMat var(size, size);
DVec mean(size);
DMatSample sample(nSample, size, 1);
DMat var(n, n);
DVec mean(n);
DMatSample sample(nSample, n, 1);
cout << "-- generating " << nSample << " Gaussian random vectors..." << endl;
var = DMat::Random(size, size);
var = DMat::Random(n, n);
var *= var.adjoint();
mean = DVec::Random(size);
mean = DVec::Random(n);
RandomNormal mgauss(mean, var, rd());
sample[central] = mgauss();
FOR_STAT_ARRAY(sample, s)

29
examples/exThreadPool.cpp Normal file
View File

@ -0,0 +1,29 @@
#include <LatAnalyze/Core/ThreadPool.hpp>
using namespace std;
using namespace Latan;
int main(void)
{
ThreadPool pool;
cout << "Using " << pool.getThreadNum() << " threads" << endl;
for (unsigned int i = 1; i <= 20; ++i)
{
pool.addJob([i, &pool](void)
{
pool.critical([i](void)
{
cout << "job " << i << " wait for " << i*100 << " ms" << endl;
});
this_thread::sleep_for(chrono::milliseconds(i*100));
pool.critical([i](void)
{
cout << "job " << i << " done" << endl;
});
});
}
pool.terminate();
return EXIT_SUCCESS;
}

81
lib/CMakeLists.txt Normal file
View File

@ -0,0 +1,81 @@
# rpath config
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
# config.h header for package version and name
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
# find bison & flex
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
# ASCII parser
bison_target(
AsciiParser LatAnalyze/Io/AsciiParser.ypp
${CMAKE_CURRENT_BINARY_DIR}/AsciiParser.cpp COMPILE_FLAGS "-Wno-deprecated")
flex_target(AsciiLexer LatAnalyze/Io/AsciiLexer.lpp
${CMAKE_CURRENT_BINARY_DIR}/AsciiLexer.cpp)
add_flex_bison_dependency(AsciiLexer AsciiParser)
# math parser
bison_target(
MathParser LatAnalyze/Core/MathParser.ypp
${CMAKE_CURRENT_BINARY_DIR}/MathParser.cpp COMPILE_FLAGS "-Wno-deprecated")
flex_target(MathLexer LatAnalyze/Core/MathLexer.lpp
${CMAKE_CURRENT_BINARY_DIR}/MathLexer.cpp)
add_flex_bison_dependency(MathLexer MathParser)
# library target
add_library(LatAnalyze SHARED)
file(GLOB_RECURSE EIGEN_HEADERS LatAnalyze/Eigen/*)
target_include_directories(LatAnalyze PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
include(source-list.cmake)
target_sources(
LatAnalyze
PRIVATE ${BISON_AsciiParser_OUTPUTS} ${FLEX_AsciiLexer_OUTPUTS}
${BISON_MathParser_OUTPUTS} ${FLEX_MathLexer_OUTPUTS}
${CMAKE_CURRENT_BINARY_DIR}/config.h ${LATAN_SOURCES}
PUBLIC FILE_SET
public_headers
TYPE
HEADERS
FILES
${EIGEN_HEADERS}
${LATAN_HEADERS})
target_link_libraries(LatAnalyze PUBLIC GSL::gsl hdf5::hdf5 hdf5::hdf5_cpp)
if(Minuit2_FOUND)
target_link_libraries(LatAnalyze PUBLIC Minuit2::Minuit2)
endif()
if(NLopt_FOUND)
target_link_libraries(LatAnalyze PUBLIC NLopt::nlopt)
endif()
set_target_properties(LatAnalyze PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(
LatAnalyze PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
# installation
install(
TARGETS LatAnalyze
EXPORT LatAnalyzeTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FILE_SET public_headers
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(
EXPORT LatAnalyzeTargets
FILE LatAnalyzeTargets.cmake
NAMESPACE LatAnalyze::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LatAnalyze)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/LatAnalyzeConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LatAnalyze)
write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/LatAnalyzeConfigVersion.cmake"
VERSION "${PROJECT_VERSION}"
COMPATIBILITY AnyNewerVersion)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LatAnalyzeConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/LatAnalyzeConfigVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LatAnalyze)

28
lib/Config.cmake.in Normal file
View File

@ -0,0 +1,28 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(GSL REQUIRED)
find_dependency(HDF5 REQUIRED COMPONENTS C CXX)
set(HAVE_Minuit2 @Minuit2_FOUND@)
set(HAVE_NLopt @NLopt_FOUND@)
if(HAVE_Minuit2)
find_dependency(Minuit2 REQUIRED)
list(APPEND _LatAnalyze_supported_components MINUIT2)
set(LatAnalyze_MINUIT2_FOUND True)
endif()
if(HAVE_NLopt)
find_dependency(NLopt REQUIRED)
list(APPEND _LatAnalyze_supported_components NLOPT)
set(LatAnalyze_NLOPT_FOUND True)
endif()
foreach(_comp ${LatAnalyze_FIND_COMPONENTS})
if (NOT ";${_LatAnalyze_supported_components};" MATCHES ";${_comp};")
set(LatAnalyze_FOUND False)
set(LatAnalyze_NOT_FOUND_MESSAGE "Unsupported LatAnalyze component: ${_comp}")
endif()
endforeach()
include("${CMAKE_CURRENT_LIST_DIR}/LatAnalyzeTargets.cmake")
check_required_components(LatAnalyze)

View File

@ -1 +0,0 @@
.

View File

@ -17,7 +17,7 @@
* along with LatAnalyze. If not, see <http://www.gnu.org/licenses/>.
*/
Derived pInverse(const double tolerance = 1.0e-10)
Derived pInverse(const double tolerance = 1.0e-10) const
{
auto svd = jacobiSvd(Eigen::ComputeThinU|Eigen::ComputeThinV);
const auto u = svd.matrixU();
@ -52,7 +52,7 @@ Derived pInverse(const double tolerance = 1.0e-10)
return v*s.asDiagonal()*u.transpose();
}
Derived singularValues(void)
Derived singularValues(void) const
{
auto svd = jacobiSvd();

View File

@ -18,6 +18,7 @@
*/
#include <LatAnalyze/Core/Math.hpp>
#include <LatAnalyze/Numerical/GslFFT.hpp>
#include <LatAnalyze/includes.hpp>
#include <gsl/gsl_cdf.h>
@ -29,7 +30,8 @@ using namespace Latan;
******************************************************************************/
DMat MATH_NAMESPACE::varToCorr(const DMat &var)
{
DMat res = var, invDiag = res.diagonal();
DMat res = var;
DVec invDiag = res.diagonal();
invDiag = invDiag.cwiseInverse().cwiseSqrt();
res = (invDiag*invDiag.transpose()).cwiseProduct(res);
@ -37,6 +39,54 @@ DMat MATH_NAMESPACE::varToCorr(const DMat &var)
return res;
}
DMat MATH_NAMESPACE::corrToVar(const DMat &corr, const DVec &varDiag)
{
DMat res = corr;
DVec varSqrtDiag = varDiag.cwiseSqrt();
res = (varSqrtDiag*varSqrtDiag.transpose()).cwiseProduct(res);
return res;
}
double MATH_NAMESPACE::conditionNumber(const DMat &mat)
{
DVec s = mat.singularValues();
return s.maxCoeff()/s.minCoeff();
}
double MATH_NAMESPACE::cdr(const DMat &mat)
{
return 10.*log10(conditionNumber(mat));
}
template <typename FFT>
double nsdr(const DMat &m)
{
Index n = m.rows();
FFT fft(n);
CMat buf(n, 1);
FOR_VEC(buf, i)
{
buf(i) = 0.;
for (Index j = 0; j < n; ++j)
{
buf(i) += m(j, (i+j) % n);
}
buf(i) /= n;
}
fft(buf, FFT::Forward);
return 10.*log10(buf.real().maxCoeff()/buf.real().minCoeff());
}
double MATH_NAMESPACE::nsdr(const DMat &mat)
{
return ::nsdr<GslFFT>(mat);
}
/******************************************************************************
* Standard C functions *
******************************************************************************/

View File

@ -70,6 +70,12 @@ namespace MATH_NAMESPACE
// convert variance matrix to correlation matrix
DMat varToCorr(const DMat &var);
DMat corrToVar(const DMat &corr, const DVec &varDiag);
// matrix SVD dynamic range
double conditionNumber(const DMat &mat);
double cdr(const DMat &mat);
double nsdr(const DMat &mat);
// Constants
constexpr double pi = 3.1415926535897932384626433832795028841970;

View File

@ -72,7 +72,7 @@ string PlotObject::dumpToTmpFile(const DMat &m)
for (Index j = 0; j < m.cols(); ++j)
{
}
sprintf(tmpFileName, "%s/latan_plot_tmp.XXXXXX.dat", P_tmpdir);
snprintf(tmpFileName, sizeof(tmpFileName), "%s/latan_plot_tmp.XXXXXX.dat", P_tmpdir);
fd = mkstemps(tmpFileName, 4);
if (fd == -1)
{
@ -112,7 +112,7 @@ PlotHeadCommand::PlotHeadCommand(const string &command)
}
// PlotData constructor ////////////////////////////////////////////////////////
PlotData::PlotData(const DMatSample &x, const DMatSample &y)
PlotData::PlotData(const DMatSample &x, const DMatSample &y, const bool abs)
{
if (x[central].rows() != y[central].rows())
{
@ -122,16 +122,23 @@ PlotData::PlotData(const DMatSample &x, const DMatSample &y)
DMat d(x[central].rows(), 4);
string usingCmd, tmpFileName;
d.col(0) = x[central];
d.col(2) = y[central];
d.col(1) = x.variance().cwiseSqrt();
d.col(3) = y.variance().cwiseSqrt();
d.col(0) = x[central].col(0);
d.col(2) = y[central].col(0);
d.col(1) = x.variance().cwiseSqrt().col(0);
d.col(3) = y.variance().cwiseSqrt().col(0);
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
if (!abs)
{
setCommand("'" + tmpFileName + "' u 1:3:2:4 w xyerr");
}
else
{
setCommand("'" + tmpFileName + "' u 1:(abs($3)):2:4 w xyerr");
}
}
PlotData::PlotData(const DVec &x, const DMatSample &y)
PlotData::PlotData(const DVec &x, const DMatSample &y, const bool abs)
{
if (x.rows() != y[central].rows())
{
@ -142,14 +149,21 @@ PlotData::PlotData(const DVec &x, const DMatSample &y)
string usingCmd, tmpFileName;
d.col(0) = x;
d.col(1) = y[central];
d.col(2) = y.variance().cwiseSqrt();
d.col(1) = y[central].col(0);
d.col(2) = y.variance().cwiseSqrt().col(0);
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
if (!abs)
{
setCommand("'" + tmpFileName + "' u 1:2:3 w yerr");
}
else
{
setCommand("'" + tmpFileName + "' u 1:(abs($2)):3 w yerr");
}
}
PlotData::PlotData(const DMatSample &x, const DVec &y)
PlotData::PlotData(const DMatSample &x, const DVec &y, const bool abs)
{
if (x[central].rows() != y.rows())
{
@ -159,24 +173,93 @@ PlotData::PlotData(const DMatSample &x, const DVec &y)
DMat d(x[central].rows(), 3), xerr, yerr;
string usingCmd, tmpFileName;
d.col(0) = x[central];
d.col(0) = x[central].col(0);
d.col(2) = y;
d.col(1) = x.variance().cwiseSqrt();
d.col(1) = x.variance().cwiseSqrt().col(0);
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
if (!abs)
{
setCommand("'" + tmpFileName + "' u 1:3:2 w xerr");
}
else
{
setCommand("'" + tmpFileName + "' u 1:(abs($3)):2 w xerr");
}
}
PlotData::PlotData(const XYStatData &data, const Index i, const Index j, const bool abs)
{
string usingCmd, tmpFileName;
if (!abs)
{
usingCmd = (data.isXExact(i)) ? "u 1:3:4 w yerr" : "u 1:3:2:4 w xyerr";
}
else
{
usingCmd = (data.isXExact(i)) ? "u 1:(abs($3)):4 w yerr" : "u 1:(abs($3)):2:4 w xyerr";
}
tmpFileName = dumpToTmpFile(data.getTable(i, j));
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' " + usingCmd);
}
// PlotPoint constructor ///////////////////////////////////////////////////////
PlotPoint::PlotPoint(const double x, const double y)
{
DMat d(1, 2);
string usingCmd, tmpFileName;
d(0, 0) = x;
d(0, 1) = y;
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:2");
}
PlotPoint::PlotPoint(const DSample &x, const double y)
{
DMat d(1, 3);
string usingCmd, tmpFileName;
d(0, 0) = x[central];
d(0, 2) = y;
d(0, 1) = sqrt(x.variance());
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:3:2 w xerr");
}
PlotData::PlotData(const XYStatData &data, const Index i, const Index j)
PlotPoint::PlotPoint(const double x, const DSample &y)
{
DMat d(1, 3);
string usingCmd, tmpFileName;
usingCmd = (data.isXExact(i)) ? "u 1:3:4 w yerr" : "u 1:3:2:4 w xyerr";
tmpFileName = dumpToTmpFile(data.getTable(i, j));
d(0, 0) = x;
d(0, 1) = y[central];
d(0, 2) = sqrt(y.variance());
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' " + usingCmd);
setCommand("'" + tmpFileName + "' u 1:2:3 w yerr");
}
PlotPoint::PlotPoint(const DSample &x, const DSample &y)
{
DMat d(1, 4);
string usingCmd, tmpFileName;
d(0, 0) = x[central];
d(0, 2) = y[central];
d(0, 1) = sqrt(x.variance());
d(0, 3) = sqrt(y.variance());
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:3:2:4 w xyerr");
}
// PlotLine constructor ////////////////////////////////////////////////////////
PlotLine::PlotLine(const DVec &x, const DVec &y)
{
@ -195,6 +278,24 @@ PlotLine::PlotLine(const DVec &x, const DVec &y)
setCommand("'" + tmpFileName + "' u 1:2 w lines");
}
// PlotPoints constructor ////////////////////////////////////////////////////////
PlotPoints::PlotPoints(const DVec &x, const DVec &y)
{
if (x.size() != y.size())
{
LATAN_ERROR(Size, "x and y vectors do not have the same size");
}
DMat d(x.size(), 2);
string usingCmd, tmpFileName;
d.col(0) = x;
d.col(1) = y;
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
setCommand("'" + tmpFileName + "' u 1:2");
}
// PlotHLine constructor ///////////////////////////////////////////////////////
PlotHLine::PlotHLine(const double y)
{
@ -217,7 +318,8 @@ PlotBand::PlotBand(const double xMin, const double xMax, const double yMin,
// PlotFunction constructor ////////////////////////////////////////////////////
PlotFunction::PlotFunction(const DoubleFunction &function, const double xMin,
const double xMax, const unsigned int nPoint)
const double xMax, const unsigned int nPoint,
const bool abs)
{
DMat d(nPoint, 2);
string tmpFileName;
@ -230,7 +332,14 @@ PlotFunction::PlotFunction(const DoubleFunction &function, const double xMin,
}
tmpFileName = dumpToTmpFile(d);
pushTmpFile(tmpFileName);
if (!abs)
{
setCommand("'" + tmpFileName + "' u 1:2 w lines");
}
else
{
setCommand("'" + tmpFileName + "' u 1:(abs($2)) w lines");
}
}
// PlotPredBand constructor ////////////////////////////////////////////////////
@ -406,14 +515,16 @@ void Dash::operator()(PlotOptions &option) const
}
// LogScale constructor ////////////////////////////////////////////////////////
LogScale::LogScale(const Axis axis)
LogScale::LogScale(const Axis axis, const double basis)
: axis_(axis)
, basis_(basis)
{}
// Logscale modifier ///////////////////////////////////////////////////////////
void LogScale::operator()(PlotOptions &option) const
{
option.scaleMode[static_cast<int>(axis_)] |= Plot::Scale::log;
option.logScaleBasis[static_cast<int>(axis_)] = basis_;
}
// PlotRange constructors //////////////////////////////////////////////////////
@ -588,7 +699,7 @@ Plot & Plot::operator<<(PlotModifier &&modifier)
// find gnuplot ////////////////////////////////////////////////////////////////
#define SEARCH_DIR(dir) \
sprintf(buf, "%s/%s", dir, gnuplotBin_.c_str());\
snprintf(buf, sizeof(buf), "%s/%s", dir, gnuplotBin_.c_str());\
if (access(buf, X_OK) == 0)\
{\
return dir;\
@ -806,11 +917,11 @@ ostream & Latan::operator<<(ostream &out, const Plot &plot)
out << "unset log" << endl;
if (plot.options_.scaleMode[x] & Plot::Scale::log)
{
out << "set log x" << endl;
out << "set log x " << plot.options_.logScaleBasis[x] << endl;;
}
if (plot.options_.scaleMode[y] & Plot::Scale::log)
{
out << "set log y" << endl;
out << "set log y " << plot.options_.logScaleBasis[y] << endl;
}
if (!plot.options_.label[x].empty())
{

View File

@ -89,14 +89,27 @@ class PlotData: public PlotObject
{
public:
// constructor
PlotData(const DMatSample &x, const DMatSample &y);
PlotData(const DVec &x, const DMatSample &y);
PlotData(const DMatSample &x, const DVec &y);
PlotData(const XYStatData &data, const Index i = 0, const Index j = 0);
PlotData(const DMatSample &x, const DMatSample &y, const bool abs = false);
PlotData(const DVec &x, const DMatSample &y, const bool abs = false);
PlotData(const DMatSample &x, const DVec &y, const bool abs = false);
PlotData(const XYStatData &data, const Index i = 0, const Index j = 0,
const bool abs = false);
// destructor
virtual ~PlotData(void) = default;
};
class PlotPoint: public PlotObject
{
public:
// constructor
PlotPoint(const double x, const double y);
PlotPoint(const DSample &x, const double y);
PlotPoint(const double x, const DSample &y);
PlotPoint(const DSample &x, const DSample &y);
// destructor
virtual ~PlotPoint(void) = default;
};
class PlotHLine: public PlotObject
{
public:
@ -115,6 +128,15 @@ public:
virtual ~PlotLine(void) = default;
};
class PlotPoints: public PlotObject
{
public:
// constructor
PlotPoints(const DVec &x, const DVec &y);
// destructor
virtual ~PlotPoints(void) = default;
};
class PlotBand: public PlotObject
{
public:
@ -130,7 +152,8 @@ class PlotFunction: public PlotObject
public:
// constructor
PlotFunction(const DoubleFunction &function, const double xMin,
const double xMax, const unsigned int nPoint = 1000);
const double xMax, const unsigned int nPoint = 1000,
const bool abs = false);
// destructor
virtual ~PlotFunction(void) = default;
};
@ -182,6 +205,11 @@ PlotRange(Axis::x, -.5, (m).cols() - .5) <<\
PlotRange(Axis::y, (m).rows() - .5, -.5) <<\
PlotMatrixNoRange(m)
#define PlotCorrMatrix(m)\
PlotHeadCommand("set cbrange [-1:1]") <<\
PlotHeadCommand("set palette defined (0 'blue', 1 'white', 2 'red')") <<\
PlotMatrix(m)
/******************************************************************************
* Plot modifiers *
******************************************************************************/
@ -199,6 +227,7 @@ struct PlotOptions
std::string caption;
std::string title;
unsigned int scaleMode[2];
double logScaleBasis[2];
Range scale[2];
std::string label[2];
std::string lineColor;
@ -286,13 +315,14 @@ class LogScale: public PlotModifier
{
public:
// constructor
explicit LogScale(const Axis axis);
explicit LogScale(const Axis axis, const double basis = 10);
// destructor
virtual ~LogScale(void) = default;
// modifier
virtual void operator()(PlotOptions &option) const;
private:
const Axis axis_;
const double basis_;
};
class PlotRange: public PlotModifier

View File

@ -0,0 +1,117 @@
/*
* ThreadPool.cpp, part of LatAnalyze 3
*
* Copyright (C) 2013 - 2021 Antonin Portelli
*
* LatAnalyze 3 is free software: 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.
*
* LatAnalyze 3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze 3. If not, see <http://www.gnu.org/licenses/>.
*/
#include <LatAnalyze/Core/ThreadPool.hpp>
#include <LatAnalyze/includes.hpp>
using namespace std;
using namespace Latan;
/******************************************************************************
* ThreadPool implementation *
******************************************************************************/
// constructors ////////////////////////////////////////////////////////////////
ThreadPool::ThreadPool(void)
: ThreadPool(std::thread::hardware_concurrency())
{}
ThreadPool::ThreadPool(const unsigned int nThreads)
: nThreads_(nThreads)
{
for (unsigned int t = 0; t < nThreads_; ++t)
{
threads_.push_back(thread(&ThreadPool::workerLoop, this));
}
}
// destructor //////////////////////////////////////////////////////////////////
ThreadPool::~ThreadPool(void)
{
terminate();
}
// get the number of threads ///////////////////////////////////////////////////
unsigned int ThreadPool::getThreadNum(void) const
{
return nThreads_;
}
// get the pool mutex for synchronisation //////////////////////////////////////
std::mutex & ThreadPool::getMutex(void)
{
return mutex_;
}
// worker loop /////////////////////////////////////////////////////////////////
void ThreadPool::workerLoop(void)
{
while (true)
{
Job job;
{
unique_lock<mutex> lock(mutex_);
condition_.wait(lock, [this](){
return !queue_.empty() || terminatePool_;
});
if (terminatePool_ and queue_.empty())
{
return;
}
job = queue_.front();
queue_.pop();
}
job();
}
}
// add jobs ////////////////////////////////////////////////////////////////////
void ThreadPool::addJob(Job newJob)
{
{
unique_lock<mutex> lock(mutex_);
queue_.push(newJob);
}
condition_.notify_one();
}
// critical section ////////////////////////////////////////////////////////////
void ThreadPool::critical(Job fn)
{
unique_lock<mutex> lock(mutex_);
fn();
}
// wait for completion /////////////////////////////////////////////////////////
void ThreadPool::terminate(void)
{
{
unique_lock<mutex> lock(mutex_);
terminatePool_ = true;
}
condition_.notify_all();
for (auto &thread: threads_)
{
thread.join();
}
threads_.clear();
}

View File

@ -0,0 +1,56 @@
/*
* ThreadPool.hpp, part of LatAnalyze 3
*
* Copyright (C) 2013 - 2021 Antonin Portelli
*
* LatAnalyze 3 is free software: 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.
*
* LatAnalyze 3 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze 3. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Latan_ThreadPool_hpp_
#define Latan_ThreadPool_hpp_
#include <LatAnalyze/Global.hpp>
class ThreadPool
{
public:
typedef std::function<void(void)> Job;
public:
// constructors/destructor
ThreadPool(void);
ThreadPool(const unsigned int nThreads);
virtual ~ThreadPool(void);
// get the number of threads
unsigned int getThreadNum(void) const;
// get the pool mutex for synchronisation
std::mutex & getMutex(void);
// add jobs
void addJob(Job newJob);
// critical section
void critical(Job fn);
// wait for completion and terminate
void terminate(void);
private:
// worker loop
void workerLoop(void);
private:
unsigned int nThreads_;
std::condition_variable condition_;
std::vector<std::thread> threads_;
bool terminatePool_{false};
std::queue<Job> queue_;
std::mutex mutex_;
};
#endif

View File

@ -24,6 +24,7 @@
#include <array>
#include <chrono>
#include <complex>
#include <condition_variable>
#include <fstream>
#include <functional>
#include <iostream>
@ -40,6 +41,7 @@
#include <stack>
#include <string>
#include <sstream>
#include <thread>
#include <type_traits>
#include <unordered_map>
#include <utility>

View File

@ -25,11 +25,10 @@ using namespace Latan;
PlaceHolder Latan::_;
const string Env::fullName = PACKAGE_STRING;
const string Env::name = PACKAGE_NAME;
const string Env::version = PACKAGE_VERSION;
const string Env::msgPrefix = "[" + strFrom(PACKAGE_NAME) + " v"
+ strFrom(PACKAGE_VERSION) + "] ";
const string Env::fullName = strFrom(PROJECT_NAME) + " v" + strFrom(PROJECT_VERSION);
const string Env::name = PROJECT_NAME;
const string Env::version = PROJECT_VERSION;
const string Env::msgPrefix = "[" + Env::fullName + "] ";
void Env::function(void)
{}

View File

@ -32,6 +32,7 @@ libLatAnalyze_la_SOURCES = \
Core/MathParser.ypp \
Core/OptParser.cpp \
Core/Plot.cpp \
Core/ThreadPool.cpp \
Core/Utilities.cpp \
Functional/CompiledFunction.cpp \
Functional/CompiledModel.cpp \
@ -47,6 +48,8 @@ libLatAnalyze_la_SOURCES = \
Io/XmlReader.cpp \
Io/Xml/tinyxml2.cpp \
Numerical/Derivative.cpp \
Numerical/DWT.cpp \
Numerical/DWTFilters.cpp \
Numerical/GslFFT.cpp \
Numerical/GslHybridRootFinder.cpp\
Numerical/GslMinimizer.cpp \
@ -55,6 +58,7 @@ libLatAnalyze_la_SOURCES = \
Numerical/RootFinder.cpp \
Numerical/Solver.cpp \
Physics/CorrelatorFitter.cpp \
Physics/DataFilter.cpp \
Physics/EffectiveMass.cpp \
Statistics/FitInterface.cpp \
Statistics/Histogram.cpp \
@ -75,6 +79,7 @@ HPPFILES = \
Core/OptParser.hpp \
Core/ParserState.hpp \
Core/Plot.hpp \
Core/ThreadPool.hpp \
Core/stdincludes.hpp \
Core/Utilities.hpp \
Functional/CompiledFunction.hpp \
@ -90,6 +95,8 @@ HPPFILES = \
Io/IoObject.hpp \
Io/XmlReader.hpp \
Numerical/Derivative.hpp \
Numerical/DWT.hpp \
Numerical/DWTFilters.hpp \
Numerical/FFT.hpp \
Numerical/GslFFT.hpp \
Numerical/GslHybridRootFinder.hpp\
@ -100,6 +107,7 @@ HPPFILES = \
Numerical/RootFinder.hpp \
Numerical/Solver.hpp \
Physics/CorrelatorFitter.hpp \
Physics/DataFilter.hpp \
Physics/EffectiveMass.hpp \
Statistics/Dataset.hpp \
Statistics/FitInterface.hpp \

View File

@ -0,0 +1,205 @@
/*
* DWT.cpp, part of LatAnalyze
*
* Copyright (C) 2013 - 2020 Antonin Portelli
*
* LatAnalyze is free software: 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.
*
* LatAnalyze is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze. If not, see <http://www.gnu.org/licenses/>.
*/
#include <LatAnalyze/Numerical/DWT.hpp>
#include <LatAnalyze/includes.hpp>
using namespace std;
using namespace Latan;
/******************************************************************************
* DWT implementation *
******************************************************************************/
// constructor /////////////////////////////////////////////////////////////////
DWT::DWT(const DWTFilter &filter)
: filter_(filter)
{}
// convolution primitive ///////////////////////////////////////////////////////
template <typename MatType>
void filterConvolution(MatType &out, const MatType &data,
const std::vector<double> &filter, const Index offset)
{
Index n = data.rows(), nf = n*filter.size();
out.resizeLike(data);
out.fill(0.);
for (unsigned int i = 0; i < filter.size(); ++i)
{
FOR_MAT(out, j, k)
{
out(j, k) += filter[i]*data((j + i + nf - offset) % n, k);
}
}
}
void DWT::filterConvolution(DVec &out, const DVec &data,
const std::vector<double> &filter, const Index offset)
{
::filterConvolution(out, data, filter, offset);
}
void DWT::filterConvolution(DMat &out, const DMat &data,
const std::vector<double> &filter, const Index offset)
{
::filterConvolution(out, data, filter, offset);
}
// downsampling/upsampling primitives //////////////////////////////////////////
template <typename MatType>
void downsample(MatType &out, const MatType &in)
{
if (out.rows() < in.rows()/2)
{
LATAN_ERROR(Size, "output rows smaller than half the input vector rows");
}
if (out.cols() != in.cols())
{
LATAN_ERROR(Size, "output and input number of columns mismatch");
}
for (Index j = 0; j < in.cols(); j++)
for (Index i = 0; i < in.rows(); i += 2)
{
out(i/2, j) = in(i, j);
}
}
void DWT::downsample(DVec &out, const DVec &in)
{
::downsample(out, in);
}
void DWT::downsample(DMat &out, const DMat &in)
{
::downsample(out, in);
}
template <typename MatType>
void upsample(MatType &out, const MatType &in)
{
if (out.size() < 2*in.size())
{
LATAN_ERROR(Size, "output rows smaller than twice the input rows");
}
if (out.cols() != in.cols())
{
LATAN_ERROR(Size, "output and input number of columns mismatch");
}
out.block(0, 0, 2*in.size(), out.cols()).fill(0.);
for (Index j = 0; j < in.cols(); j++)
for (Index i = 0; i < in.size(); i ++)
{
out(2*i, j) = in(i, j);
}
}
void DWT::upsample(DVec &out, const DVec &in)
{
::upsample(out, in);
}
void DWT::upsample(DMat &out, const DMat &in)
{
::upsample(out, in);
}
// DWT /////////////////////////////////////////////////////////////////////////
std::vector<DWT::DWTLevel>
DWT::forward(const DVec &data, const unsigned int level) const
{
std::vector<DWTLevel> dwt(level);
DVec *finePt = const_cast<DVec *>(&data);
DVec tmp;
Index n = data.size(), o = filter_.fwdL.size()/2, minSize;
minSize = 1;
for (unsigned int l = 0; l < level; ++l) minSize *= 2;
if (n < minSize)
{
LATAN_ERROR(Size, "data vector too small for a " + strFrom(level)
+ "-level DWT (data size is " + strFrom(n) + ")");
}
for (unsigned int l = 0; l < level; ++l)
{
n /= 2;
dwt[l].first.resize(n);
dwt[l].second.resize(n);
filterConvolution(tmp, *finePt, filter_.fwdL, o);
downsample(dwt[l].first, tmp);
filterConvolution(tmp, *finePt, filter_.fwdH, o);
downsample(dwt[l].second, tmp);
finePt = &dwt[l].first;
}
return dwt;
}
DVec DWT::backward(const std::vector<DWTLevel>& dwt) const
{
unsigned int level = dwt.size();
Index n = dwt.back().second.size(), o = filter_.bwdL.size()/2 - 1;
DVec res, tmp, conv;
res = dwt.back().first;
for (int l = level - 2; l >= 0; --l)
{
n *= 2;
if (dwt[l].second.size() != n)
{
LATAN_ERROR(Size, "DWT result size mismatch");
}
}
n = dwt.back().second.size();
for (int l = level - 1; l >= 0; --l)
{
n *= 2;
tmp.resize(n);
upsample(tmp, res);
filterConvolution(conv, tmp, filter_.bwdL, o);
res = conv;
upsample(tmp, dwt[l].second);
filterConvolution(conv, tmp, filter_.bwdH, o);
res += conv;
}
return res;
}
// concatenate levels //////////////////////////////////////////////////////////
DVec DWT::concat(const std::vector<DWTLevel> &dwt, const int maxLevel, const bool dropLow)
{
unsigned int level = ((maxLevel >= 0) ? (maxLevel + 1) : dwt.size());
Index nlast = dwt[level - 1].first.size();
Index n = 2*dwt.front().first.size() - ((dropLow) ? nlast : 0);
Index pt = n, nl;
DVec res(n);
for (unsigned int l = 0; l < level; ++l)
{
nl = dwt[l].second.size();
pt -= nl;
res.segment(pt, nl) = dwt[l].second;
}
if (!dropLow)
{
res.segment(0, nl) = dwt[level-1].first;
}
return res;
}

View File

@ -0,0 +1,62 @@
/*
* DWT.hpp, part of LatAnalyze
*
* Copyright (C) 2013 - 2020 Antonin Portelli
*
* LatAnalyze is free software: 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.
*
* LatAnalyze is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Latan_DWT_hpp_
#define Latan_DWT_hpp_
#include <LatAnalyze/Global.hpp>
#include <LatAnalyze/Numerical/DWTFilters.hpp>
#include <LatAnalyze/Core/Mat.hpp>
BEGIN_LATAN_NAMESPACE
/******************************************************************************
* Discrete wavelet transform class *
******************************************************************************/
class DWT
{
public:
typedef std::pair<DVec, DVec> DWTLevel;
public:
// constructor
DWT(const DWTFilter &filter);
// destructor
virtual ~DWT(void) = default;
// convolution primitive
static void filterConvolution(DVec &out, const DVec &data,
const std::vector<double> &filter, const Index offset);
static void filterConvolution(DMat &out, const DMat &data,
const std::vector<double> &filter, const Index offset);
// downsampling/upsampling primitives
static void downsample(DVec &out, const DVec &in);
static void downsample(DMat &out, const DMat &in);
static void upsample(DVec &out, const DVec &in);
static void upsample(DMat &out, const DMat &in);
// DWT
std::vector<DWTLevel> forward(const DVec &data, const unsigned int level) const;
DVec backward(const std::vector<DWTLevel>& dwt) const;
// concatenate levels
static DVec concat(const std::vector<DWTLevel>& dwt, const int maxLevel = -1, const bool dropLow = false);
private:
DWTFilter filter_;
};
END_LATAN_NAMESPACE
#endif // Latan_DWT_hpp_

View File

@ -0,0 +1,528 @@
/*
* DWTFilters.cpp, part of LatAnalyze
*
* Copyright (C) 2013 - 2020 Antonin Portelli
*
* LatAnalyze is free software: 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.
*
* LatAnalyze is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze. If not, see <http://www.gnu.org/licenses/>.
*/
#include <LatAnalyze/Numerical/DWTFilters.hpp>
#include <LatAnalyze/includes.hpp>
// cf. http://wavelets.pybytes.com
// *here we implement the reverse filters more convenient for convolutions*
using namespace std;
using namespace Latan;
#define FILTDICT(x) {#x, &DWTFilters::x}
std::map<std::string, const DWTFilter *> DWTFilters::fromName = {
FILTDICT(haar),
FILTDICT(db2),
FILTDICT(db3),
FILTDICT(db4),
FILTDICT(db5),
FILTDICT(db6),
FILTDICT(bior13),
FILTDICT(bior15),
FILTDICT(bior22),
FILTDICT(bior24),
FILTDICT(bior31),
FILTDICT(bior33),
FILTDICT(bior35)
};
DWTFilter DWTFilters::haar = {
// fwdL
{0.7071067811865476,
0.7071067811865476},
// fwdH
{0.7071067811865476,
-0.7071067811865476},
// bwdL
{0.7071067811865476,
0.7071067811865476},
// bwdH
{-0.7071067811865476,
0.7071067811865476}
};
DWTFilter DWTFilters::db2 = {
// fwdL
{0.48296291314469025,
0.836516303737469,
0.22414386804185735,
-0.12940952255092145},
// fwdH
{-0.12940952255092145,
-0.22414386804185735,
0.836516303737469,
-0.48296291314469025},
// bwdL
{-0.12940952255092145,
0.22414386804185735,
0.836516303737469,
0.48296291314469025},
// bwdH
{-0.48296291314469025,
0.836516303737469,
-0.22414386804185735,
-0.12940952255092145}
};
DWTFilter DWTFilters::db3 = {
// fwdL
{0.3326705529509569,
0.8068915093133388,
0.4598775021193313,
-0.13501102001039084,
-0.08544127388224149,
0.035226291882100656},
// fwdH
{0.035226291882100656,
0.08544127388224149,
-0.13501102001039084,
-0.4598775021193313,
0.8068915093133388,
-0.3326705529509569},
// bwdL
{0.035226291882100656,
-0.08544127388224149,
-0.13501102001039084,
0.4598775021193313,
0.8068915093133388,
0.3326705529509569},
// bwdH
{-0.3326705529509569,
0.8068915093133388,
-0.4598775021193313,
-0.13501102001039084,
0.08544127388224149,
0.035226291882100656}
};
DWTFilter DWTFilters::db4 = {
// fwdL
{0.23037781330885523,
0.7148465705525415,
0.6308807679295904,
-0.02798376941698385,
-0.18703481171888114,
0.030841381835986965,
0.032883011666982945,
-0.010597401784997278},
// fwdH
{-0.010597401784997278,
-0.032883011666982945,
0.030841381835986965,
0.18703481171888114,
-0.02798376941698385,
-0.6308807679295904,
0.7148465705525415,
-0.23037781330885523},
// bwdL
{-0.010597401784997278,
0.032883011666982945,
0.030841381835986965,
-0.18703481171888114,
-0.02798376941698385,
0.6308807679295904,
0.7148465705525415,
0.23037781330885523},
// bwdH
{-0.23037781330885523,
0.7148465705525415,
-0.6308807679295904,
-0.02798376941698385,
0.18703481171888114,
0.030841381835986965,
-0.032883011666982945,
-0.010597401784997278}
};
DWTFilter DWTFilters::db5 = {
// fwdL
{0.160102397974125,
0.6038292697974729,
0.7243085284385744,
0.13842814590110342,
-0.24229488706619015,
-0.03224486958502952,
0.07757149384006515,
-0.006241490213011705,
-0.012580751999015526,
0.003335725285001549},
// fwdH
{0.003335725285001549,
0.012580751999015526,
-0.006241490213011705,
-0.07757149384006515,
-0.03224486958502952,
0.24229488706619015,
0.13842814590110342,
-0.7243085284385744,
0.6038292697974729,
-0.160102397974125},
// bwdL
{0.003335725285001549,
-0.012580751999015526,
-0.006241490213011705,
0.07757149384006515,
-0.03224486958502952,
-0.24229488706619015,
0.13842814590110342,
0.7243085284385744,
0.6038292697974729,
0.160102397974125},
// bwdH
{-0.160102397974125,
0.6038292697974729,
-0.7243085284385744,
0.13842814590110342,
0.24229488706619015,
-0.03224486958502952,
-0.07757149384006515,
-0.006241490213011705,
0.012580751999015526,
0.003335725285001549}
};
DWTFilter DWTFilters::db6 = {
// fwdL
{0.11154074335008017,
0.4946238903983854,
0.7511339080215775,
0.3152503517092432,
-0.22626469396516913,
-0.12976686756709563,
0.09750160558707936,
0.02752286553001629,
-0.031582039318031156,
0.0005538422009938016,
0.004777257511010651,
-0.00107730108499558},
// fwdH
{-0.00107730108499558,
-0.004777257511010651,
0.0005538422009938016,
0.031582039318031156,
0.02752286553001629,
-0.09750160558707936,
-0.12976686756709563,
0.22626469396516913,
0.3152503517092432,
-0.7511339080215775,
0.4946238903983854,
-0.11154074335008017},
// bwdL
{-0.00107730108499558,
0.004777257511010651,
0.0005538422009938016,
-0.031582039318031156,
0.02752286553001629,
0.09750160558707936,
-0.12976686756709563,
-0.22626469396516913,
0.3152503517092432,
0.7511339080215775,
0.4946238903983854,
0.11154074335008017},
// bwdH
{-0.11154074335008017,
0.4946238903983854,
-0.7511339080215775,
0.3152503517092432,
0.22626469396516913,
-0.12976686756709563,
-0.09750160558707936,
0.02752286553001629,
0.031582039318031156,
0.0005538422009938016,
-0.004777257511010651,
-0.00107730108499558}
};
DWTFilter DWTFilters::bior13 = {
// fwdL
{-0.08838834764831845,
0.08838834764831845,
0.7071067811865476,
0.7071067811865476,
0.08838834764831845,
-0.08838834764831845},
// fwdH
{0.0,
0.0,
0.7071067811865476,
-0.7071067811865476,
0.0,
0.0},
// bwdL
{0.0,
0.0,
0.7071067811865476,
0.7071067811865476,
0.0,
0.0},
// bwdH
{0.08838834764831845,
0.08838834764831845,
-0.7071067811865476,
0.7071067811865476,
-0.08838834764831845,
-0.08838834764831845}
};
DWTFilter DWTFilters::bior15 = {
// fwdL
{0.01657281518405971,
-0.01657281518405971,
-0.12153397801643787,
0.12153397801643787,
0.7071067811865476,
0.7071067811865476,
0.12153397801643787,
-0.12153397801643787,
-0.01657281518405971,
0.01657281518405971},
// fwdH
{0.0,
0.0,
0.0,
0.0,
0.7071067811865476,
-0.7071067811865476,
0.0,
0.0,
0.0,
0.0},
// bwdL
{0.0,
0.0,
0.0,
0.0,
0.7071067811865476,
0.7071067811865476,
0.0,
0.0,
0.0,
0.0},
// bwdH
{-0.01657281518405971,
-0.01657281518405971,
0.12153397801643787,
0.12153397801643787,
-0.7071067811865476,
0.7071067811865476,
-0.12153397801643787,
-0.12153397801643787,
0.01657281518405971,
0.01657281518405971}
};
DWTFilter DWTFilters::bior22 = {
// fwdL
{-0.1767766952966369,
0.3535533905932738,
1.0606601717798214,
0.3535533905932738,
-0.1767766952966369,
0.0},
// fwdH
{0.0,
0.0,
0.3535533905932738,
-0.7071067811865476,
0.3535533905932738,
0.0},
// bwdL
{0.0,
0.0,
0.3535533905932738,
0.7071067811865476,
0.3535533905932738,
0.0},
// bwdH
{0.1767766952966369,
0.3535533905932738,
-1.0606601717798214,
0.3535533905932738,
0.1767766952966369,
0.0}
};
DWTFilter DWTFilters::bior24 = {
// fwdL
{0.03314563036811942,
-0.06629126073623884,
-0.1767766952966369,
0.4198446513295126,
0.9943689110435825,
0.4198446513295126,
-0.1767766952966369,
-0.06629126073623884,
0.03314563036811942,
0.0},
// fwdH
{0.0,
0.0,
0.0,
0.0,
0.3535533905932738,
-0.7071067811865476,
0.3535533905932738,
0.0,
0.0,
0.0},
// bwdL
{0.0,
0.0,
0.0,
0.0,
0.3535533905932738,
0.7071067811865476,
0.3535533905932738,
0.0,
0.0,
0.0},
// bwdH
{-0.03314563036811942,
-0.06629126073623884,
0.1767766952966369,
0.4198446513295126,
-0.9943689110435825,
0.4198446513295126,
0.1767766952966369,
-0.06629126073623884,
-0.03314563036811942,
0.0}
};
DWTFilter DWTFilters::bior31 = {
// fwdL
{-0.3535533905932738,
1.0606601717798214,
1.0606601717798214,
-0.3535533905932738},
// fwdH
{0.1767766952966369,
-0.5303300858899107,
0.5303300858899107,
-0.1767766952966369},
// bwdL
{0.1767766952966369,
0.5303300858899107,
0.5303300858899107,
0.1767766952966369},
// bwdH
{0.3535533905932738,
1.0606601717798214,
-1.0606601717798214,
-0.3535533905932738}
};
DWTFilter DWTFilters::bior33 = {
// fwdL
{0.06629126073623884,
-0.19887378220871652,
-0.15467960838455727,
0.9943689110435825,
0.9943689110435825,
-0.15467960838455727,
-0.19887378220871652,
0.06629126073623884},
// fwdH
{0.0,
0.0,
0.1767766952966369,
-0.5303300858899107,
0.5303300858899107,
-0.1767766952966369,
0.0,
0.0},
// bwdL
{0.0,
0.0,
0.1767766952966369,
0.5303300858899107,
0.5303300858899107,
0.1767766952966369,
0.0,
0.0},
// bwdH
{-0.06629126073623884,
-0.19887378220871652,
0.15467960838455727,
0.9943689110435825,
-0.9943689110435825,
-0.15467960838455727,
0.19887378220871652,
0.06629126073623884}
};
DWTFilter DWTFilters::bior35 = {
// fwdL
{-0.013810679320049757,
0.04143203796014927,
0.052480581416189075,
-0.26792717880896527,
-0.07181553246425874,
0.966747552403483,
0.966747552403483,
-0.07181553246425874,
-0.26792717880896527,
0.052480581416189075,
0.04143203796014927,
-0.013810679320049757},
// fwdH
{0.0,
0.0,
0.0,
0.0,
0.1767766952966369,
-0.5303300858899107,
0.5303300858899107,
-0.1767766952966369,
0.0,
0.0,
0.0,
0.0},
// bwdL
{0.0,
0.0,
0.0,
0.0,
0.1767766952966369,
0.5303300858899107,
0.5303300858899107,
0.1767766952966369,
0.0,
0.0,
0.0,
0.0},
// bwdH
{0.013810679320049757,
0.04143203796014927,
-0.052480581416189075,
-0.26792717880896527,
0.07181553246425874,
0.966747552403483,
-0.966747552403483,
-0.07181553246425874,
0.26792717880896527,
0.052480581416189075,
-0.04143203796014927,
-0.013810679320049757}
};

View File

@ -0,0 +1,53 @@
/*
* DWTFilters.hpp, part of LatAnalyze
*
* Copyright (C) 2013 - 2020 Antonin Portelli
*
* LatAnalyze is free software: 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.
*
* LatAnalyze is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LatAnalyze. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef Latan_DWTFilters_hpp_
#define Latan_DWTFilters_hpp_
#include <LatAnalyze/Global.hpp>
BEGIN_LATAN_NAMESPACE
struct DWTFilter
{
const std::vector<double> fwdL, fwdH, bwdL, bwdH;
};
namespace DWTFilters
{
extern DWTFilter haar;
extern DWTFilter db2;
extern DWTFilter db3;
extern DWTFilter db4;
extern DWTFilter db5;
extern DWTFilter db6;
extern DWTFilter bior13;
extern DWTFilter bior15;
extern DWTFilter bior22;
extern DWTFilter bior24;
extern DWTFilter bior31;
extern DWTFilter bior33;
extern DWTFilter bior35;
extern std::map<std::string, const DWTFilter *> fromName;
}
END_LATAN_NAMESPACE
#endif // Latan_DWTFilters_hpp_

View File

@ -19,6 +19,24 @@
#include <LatAnalyze/Numerical/MinuitMinimizer.hpp>
#include <LatAnalyze/includes.hpp>
// forward declaration necessary in the ROOT-based version of Minuit2
namespace ROOT
{
namespace Fit
{
class ParameterSettings;
};
};
// macros necessary in the ROOT-based version of Minuit2
#ifndef ROOT_Math_VecTypes
#define ROOT_Math_VecTypes
#endif
#ifndef MATHCORE_STANDALONE
#define MATHCORE_STANDALONE
#endif
#include <Minuit2/Minuit2Minimizer.h>
#include <Math/Functor.h>

Some files were not shown because too many files have changed in this diff Show More