From 8558896f9beae50f698b6a4dd7389a98510c1553 Mon Sep 17 00:00:00 2001 From: jkriege2 Date: Sat, 23 Jul 2022 15:31:56 +0200 Subject: [PATCH] split jkqtcommon into basic tools and jkqtcommon_statistics_and_math for advanced math tools not used by all libs --- JKQtPlotterBuildAllExamples.pro | 14 +- JKQtPlotterBuildLibsOnly.pro | 8 +- doc/dox/jkqtcommon.dox | 55 ++++++ doc/dox/jkqtcommon_statistics_and_math.dox | 95 ++++++++++ doc/dox/jkqtplotter.dox | 135 -------------- doc/dox/whatsnew.dox | 1 + .../datastore_groupedstat.cpp | 2 +- .../datastore_regression.cpp | 2 +- .../datastore_statistics.cpp | 2 +- .../datastore_statistics_2d.cpp | 2 +- examples/violinplot/violinplot.cpp | 2 +- lib/CMakeLists.txt | 1 + lib/README.md | 19 +- lib/{jkqtpcommon.pri => jkqtcommon.pri} | 21 --- lib/jkqtcommon/CMakeLists.txt | 36 ---- lib/jkqtcommon/private/jkqtcommon_precomp.h | 4 + lib/jkqtcommon_statistics_and_math.pri | 52 ++++++ .../CMakeLists.txt | 164 ++++++++++++++++++ .../LibTarget.cmake.in | 13 ++ .../jkqtcommon_statistics_and_math_imexport.h | 94 ++++++++++ .../jkqtpalgorithms.cpp | 2 +- .../jkqtpalgorithms.h | 2 +- .../jkqtparraytools.cpp | 0 .../jkqtparraytools.h | 2 +- .../jkqtplinalgtools.cpp | 0 .../jkqtplinalgtools.h | 4 +- .../jkqtpmathparser.cpp | 2 +- .../jkqtpmathparser.h | 34 ++-- .../jkqtpstatbasics.cpp | 0 .../jkqtpstatbasics.h | 8 +- .../jkqtpstatgrouped.cpp | 2 +- .../jkqtpstatgrouped.h | 16 +- .../jkqtpstathistogram.cpp | 0 .../jkqtpstathistogram.h | 8 +- .../jkqtpstatisticstools.h | 12 +- .../jkqtpstatkde.cpp | 2 +- .../jkqtpstatkde.h | 32 ++-- .../jkqtpstatpoly.cpp | 0 .../jkqtpstatpoly.h | 6 +- .../jkqtpstatregression.cpp | 0 .../jkqtpstatregression.h | 22 +-- .../jkqtcommon_statistics_and_math_precomp.h | 55 ++++++ lib/jkqtplotter/CMakeLists.txt | 4 +- lib/jkqtplotter/graphs/jkqtpparsedfunction.h | 2 +- .../graphs/jkqtpstatisticsadaptors.h | 2 +- lib/jkqtplotter/jkqtptools.h | 2 +- lib/jkqtplotter/private/jkqtplotter_precomp.h | 4 +- .../jkqtcommonlib.pro} | 6 +- .../jkqtcommonstatisticsandmathlib.pro | 18 ++ .../jkqtfastplotterlib/jkqtfastplotterlib.pro | 2 +- .../jkqtmathtextlib/jkqtmathtextlib.pro | 2 +- .../jkqtplotterlib/jkqtplotterlib.pro | 5 +- .../jkqtcommonlib.pro} | 6 +- .../jkqtcommonstatisticsandmathlib.pro | 13 ++ .../jkqtfastplotterlib/jkqtfastplotterlib.pro | 2 +- .../jkqtmathtextlib/jkqtmathtextlib.pro | 2 +- .../jkqtplotterlib/jkqtplotterlib.pro | 5 +- 57 files changed, 687 insertions(+), 319 deletions(-) create mode 100644 doc/dox/jkqtcommon.dox create mode 100644 doc/dox/jkqtcommon_statistics_and_math.dox rename lib/{jkqtpcommon.pri => jkqtcommon.pri} (63%) create mode 100644 lib/jkqtcommon_statistics_and_math.pri create mode 100644 lib/jkqtcommon_statistics_and_math/CMakeLists.txt create mode 100644 lib/jkqtcommon_statistics_and_math/LibTarget.cmake.in create mode 100644 lib/jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpalgorithms.cpp (90%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpalgorithms.h (95%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtparraytools.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtparraytools.h (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtplinalgtools.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtplinalgtools.h (97%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpmathparser.cpp (97%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpmathparser.h (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatbasics.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatbasics.h (97%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatgrouped.cpp (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatgrouped.h (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstathistogram.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstathistogram.h (95%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatisticstools.h (70%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatkde.cpp (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatkde.h (92%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatpoly.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatpoly.h (93%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatregression.cpp (100%) rename lib/{jkqtcommon => jkqtcommon_statistics_and_math}/jkqtpstatregression.h (94%) create mode 100644 lib/jkqtcommon_statistics_and_math/private/jkqtcommon_statistics_and_math_precomp.h rename qmake/sharedlib/{jkqtpcommonlib/jkqtpcommonlib.pro => jkqtcommonlib/jkqtcommonlib.pro} (71%) create mode 100644 qmake/sharedlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro rename qmake/staticlib/{jkqtpcommonlib/jkqtpcommonlib.pro => jkqtcommonlib/jkqtcommonlib.pro} (63%) create mode 100644 qmake/staticlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro diff --git a/JKQtPlotterBuildAllExamples.pro b/JKQtPlotterBuildAllExamples.pro index ec7002a141..2fe0d4caf8 100644 --- a/JKQtPlotterBuildAllExamples.pro +++ b/JKQtPlotterBuildAllExamples.pro @@ -4,8 +4,8 @@ SUBDIRS += jkqtplotterlib \ jkqtplotterlib_sharedlib \ jkqtmathtextlib \ jkqtmathtextlib_sharedlib \ - jkqtpcommonlib \ - jkqtpcommonlib_sharedlib \ + jkqtcommonlib \ + jkqtcommonlib_sharedlib \ jkqtfastplotterlib \ jkqtfastplotterlib_sharedlib \ jkqtmathtext_simpletest \ @@ -24,20 +24,20 @@ jkqtplotterlib_sharedlib.file = qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pr jkqtmathtextlib.file = qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro jkqtmathtextlib_sharedlib.file = qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro -jkqtpcommonlib.file = qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro -jkqtpcommonlib_sharedlib.file = qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro +jkqtcommonlib.file = qmake/staticlib/jkqtcommonlib/jkqtcommonlib.pro +jkqtcommonlib_sharedlib.file = qmake/sharedlib/jkqtcommonlib/jkqtcommonlib.pro jkqtfastplotterlib.file = qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro jkqtfastplotterlib_sharedlib.file = qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro jkqtmathtext_simpletest.subdir = examples/jkqtmathtext_simpletest -jkqtmathtext_simpletest.depends = jkqtmathtextlib jkqtpcommonlib +jkqtmathtext_simpletest.depends = jkqtmathtextlib jkqtcommonlib jkqtmathtext_test.subdir = examples/jkqtmathtext_test -jkqtmathtext_test.depends = jkqtplotterlib jkqtpcommonlib +jkqtmathtext_test.depends = jkqtplotterlib jkqtcommonlib jkqtplotter_simpletest.file = examples/simpletest/simpletest.pro -jkqtplotter_simpletest.depends = jkqtplotterlib jkqtpcommonlib +jkqtplotter_simpletest.depends = jkqtplotterlib jkqtcommonlib jkqtplot_test.file = examples/jkqtplot_test/jkqtplot_test.pro jkqtplot_test.depends = jkqtplotterlib diff --git a/JKQtPlotterBuildLibsOnly.pro b/JKQtPlotterBuildLibsOnly.pro index 40cef824a6..b4f38c4836 100644 --- a/JKQtPlotterBuildLibsOnly.pro +++ b/JKQtPlotterBuildLibsOnly.pro @@ -4,8 +4,8 @@ SUBDIRS += jkqtplotterlib \ jkqtplotterlib_sharedlib \ jkqtmathtextlib \ jkqtmathtextlib_sharedlib \ - jkqtpcommonlib \ - jkqtpcommonlib_sharedlib \ + jkqtcommonlib \ + jkqtcommonlib_sharedlib \ jkqtfastplotterlib \ jkqtfastplotterlib_sharedlib @@ -16,8 +16,8 @@ jkqtplotterlib_sharedlib.file = qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pr jkqtmathtextlib.file = qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro jkqtmathtextlib_sharedlib.file = qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro -jkqtpcommonlib.file = qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro -jkqtpcommonlib_sharedlib.file = qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro +jkqtcommonlib.file = qmake/staticlib/jkqtcommonlib/jkqtcommonlib.pro +jkqtcommonlib_sharedlib.file = qmake/sharedlib/jkqtcommonlib/jkqtcommonlib.pro jkqtfastplotterlib.file = qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro jkqtfastplotterlib_sharedlib.file = qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro diff --git a/doc/dox/jkqtcommon.dox b/doc/dox/jkqtcommon.dox new file mode 100644 index 0000000000..ba05121825 --- /dev/null +++ b/doc/dox/jkqtcommon.dox @@ -0,0 +1,55 @@ +/*! + +\defgroup jkqtptools Support Function libraries (e.g. for JKQTPlotter) + +This group contains several tool functions and datatypesthat are neccessary for +JKQTPlotter, JKQTMathtext and the other major classes in this library, but may +also be used separately. The functions and datatypes are sorted into several +functionaly groups. + + +\defgroup jkqtptools_jkqtcommon JKQTCommon: Diverse Basic Utilities +\ingroup jkqtptools + +This summarizes all functions from JKQTCommon-library, which provides basic (Qt-bound) tools for all other libs in the package JKQtPlotter (i.e. also JKQtFastPlotter and JKQtMathText). + + +\defgroup jkqtptools_math_basic Mathematical Functions & Tools +\ingroup jkqtptools_math + + +This group assembles a variety of mathematical tool functions that are used in different places. + + + +\defgroup jkqtptools_string String/String-Conversion Tool Functions +\ingroup jkqtptools + +Offers diverse function to convert different datatypes (e.g. double, int, diverse enums) to and from strings and for string manipulation. + +\defgroup jkqtptools_qt Additional Tools for Qt +\ingroup jkqtptools + + +\defgroup jkqtptools_qtwidgets Additional Widgets for Qt +\ingroup jkqtptools + +\defgroup jkqtptools_drawing Drawing & Graphics Tools +\ingroup jkqtptools + +Specialized drawing functions used by the plotters and LaTeX renderers. + +\defgroup jkqtptools_debugging Debugging Tools +\ingroup jkqtptools + +Functions that help during debugging (e.g. an assert function/macro). + +\defgroup jkqtptools_codestructuring Code Structuring Tools +\ingroup jkqtptools + +Classes and functions that help to structure the code (e.g. RAII constructs) + + + + +*/ \ No newline at end of file diff --git a/doc/dox/jkqtcommon_statistics_and_math.dox b/doc/dox/jkqtcommon_statistics_and_math.dox new file mode 100644 index 0000000000..8e4722dfe4 --- /dev/null +++ b/doc/dox/jkqtcommon_statistics_and_math.dox @@ -0,0 +1,95 @@ +/*! + + +\defgroup jkqtcommon_statistics_and_math JKQTCommonStatisticsAndMath: Special Math and Statistics Utilities +\ingroup jkqtptools + +This summarizes all functions from JKQTCommonStatisticsAndMath-library, which provides special and advanced math and statistics tools, mostly used by JKQtPlotter. + + +\defgroup jkqtptools_algorithms Diverse Algorithms +\ingroup jkqtcommon_statistics_and_math + +\defgroup jkqtptools_math Mathematical Computations & Expression Parsing +\ingroup jkqtcommon_statistics_and_math + +\defgroup jkqtptools_math_array Data Array Tools +\ingroup jkqtcommon_statistics_and_math + +Functions in this group form the basis for the statistics (\ref jkqtptools_math_statistics ) and linear algebra libraries (\ref jkqtptools_math_linalg ), by providing allocation and freeing of (aligned) memory arrays. + +\see JKQTPlotterBasicJKQTPDatastoreStatistics + +\defgroup jkqtptools_math_linalg Linear Algebra Tools +\ingroup jkqtcommon_statistics_and_math + +This group assembles a basic set of linear algebra methods, including matrix inversion, which are required e.g. by the statistics library (\ref jkqtptools_math_statistics ) + +\defgroup jkqtptools_math_statistics Statistical Computations +\ingroup jkqtcommon_statistics_and_math + +This group contains a statistics library, which offers several basic methods and is based on an iterator interface: + - \ref jkqtptools_math_statistics_basic + - \ref jkqtptools_math_statistics_grouped + - \ref jkqtptools_math_statistics_regression + - \ref jkqtptools_math_statistics_poly + - \ref jkqtptools_math_statistics_1dhist + - \ref jkqtptools_math_statistics_2dhist + - \ref jkqtptools_math_statistics_1dkde + - \ref jkqtptools_math_statistics_2dkde +. +In addition there is a set of "adaptors" (see \ref jkqtptools_math_statistics_adaptors ) that shortcut the calculation of a statistical property and the subsequent parametrization of a plot with the results. With these adaptors you can add e.g. a boxplot or histogram chart to a plot by calling only one function. + + +All statistics functions use an iterator-based interface, comparable to the interface of the algorithms in the C++ standard template library. To this end, the class `JKQTPDatastore` provides an iterator interface to its columns, using the functions `JKQTPDatastore::begin()` and `JKQTPDatastore::end()`. Both functions simply receive the column ID as parameter and exist in a const and a mutable variant. the latter allows to also edit the data. In addition the function `JKQTPDatastore::backInserter()` returns a back-inserter iterator (like generated for STL containers with `std::back_inserter(container)`) that also allows to append to the column. + +Note that the iterator interface allows to use these functions with any container that provides such iterators (e.g. `std::vector`, `std::list`, `std::set`, `QVector`...). + +Code using one of these statistics functions therefore may look e.g. like this: +\code + // mean of a column in a JKQTPDatastore: + double mean=jkqtpstatAverage(datastore1->begin(randomdatacol1), datastore1->end(randomdatacol1)); + + // mean of a std::vector + std::vector data {1,2,4,5,7,8,10,2,1,3,5}; + double meanvec=jkqtpstatAverage(data.begin(), data.end()); +\endcode + +All statistics functions use all values in the given range and convert each value to a `double`, using `jkqtp_todouble()`. The return values is always a dohble. Therefore you can use these functions to calculate statistics of ranges of any type that can be converted to `double`. Values that do not result in a valid `double`are not used in calculating the statistics. Therefore you can exclude values by setting them `JKQTP_DOUBLE_NAN` (i.e. "not a number"). + +\see see for detailed examples: \ref JKQTPlotterBasicJKQTPDatastoreStatistics + +\defgroup jkqtptools_math_statistics_basic Basic statistics +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_grouped Grouped statistics +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_regression Regression Analysis +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_poly Polynomial Fits/Regression +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_1dhist 1-dimensional Histograms +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_2dhist 2-dimensional Histograms +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_1dkde 1-dimensional Kernel Density Estimates +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_1dkde_kernels Kernels for 1-dimensional Histograms +\ingroup jkqtptools_math_statistics_1dkde + +\defgroup jkqtptools_math_statistics_2dkde 2-dimensional Kernel Density Estimates +\ingroup jkqtptools_math_statistics + +\defgroup jkqtptools_math_statistics_2dkde_kernels Kernels for 2-dimensional Histograms +\ingroup jkqtptools_math_statistics_2dkde + +\defgroup jkqtptools_math_statistics_adaptors Statistics To Plot Adaptors +\ingroup jkqtptools_math_statistics + +*/ \ No newline at end of file diff --git a/doc/dox/jkqtplotter.dox b/doc/dox/jkqtplotter.dox index f0f97a933e..54efa3244b 100644 --- a/doc/dox/jkqtplotter.dox +++ b/doc/dox/jkqtplotter.dox @@ -1,140 +1,5 @@ /*! -\defgroup jkqtptools Support Function library (e.g. for JKQTPlotter) - -This group contains several tool functions and datatypesthat are neccessary for -JKQTPlotter, JKQTMathtext and the other major classes in this library, but may -also be used separately. The functions and datatypes are sorted into several -functionaly groups. - - -\defgroup jkqtptools_algorithms Diverse Algorithms -\ingroup jkqtptools - -\defgroup jkqtptools_math Mathematical Computations & Expression Parsing -\ingroup jkqtptools - -\defgroup jkqtptools_math_basic Mathematical Functions & Tools -\ingroup jkqtptools_math - - -This group assembles a variety of mathematical tool functions that are used in different places. - -\defgroup jkqtptools_math_array Data Array Tools -\ingroup jkqtptools_math - -Functions in this group form the basis for the statistics (\ref jkqtptools_math_statistics ) and linear algebra libraries (\ref jkqtptools_math_linalg ), by providing allocation and freeing of (aligned) memory arrays. - -\see JKQTPlotterBasicJKQTPDatastoreStatistics - -\defgroup jkqtptools_math_linalg Linear Algebra Tools -\ingroup jkqtptools_math - -This group assembles a basic set of linear algebra methods, including matrix inversion, which are required e.g. by the statistics library (\ref jkqtptools_math_statistics ) - -\defgroup jkqtptools_math_statistics Statistical Computations -\ingroup jkqtptools_math - -This group contains a statistics library, which offers several basic methods and is based on an iterator interface: - - \ref jkqtptools_math_statistics_basic - - \ref jkqtptools_math_statistics_grouped - - \ref jkqtptools_math_statistics_regression - - \ref jkqtptools_math_statistics_poly - - \ref jkqtptools_math_statistics_1dhist - - \ref jkqtptools_math_statistics_2dhist - - \ref jkqtptools_math_statistics_1dkde - - \ref jkqtptools_math_statistics_2dkde -. -In addition there is a set of "adaptors" (see \ref jkqtptools_math_statistics_adaptors ) that shortcut the calculation of a statistical property and the subsequent parametrization of a plot with the results. With these adaptors you can add e.g. a boxplot or histogram chart to a plot by calling only one function. - - -All statistics functions use an iterator-based interface, comparable to the interface of the algorithms in the C++ standard template library. To this end, the class `JKQTPDatastore` provides an iterator interface to its columns, using the functions `JKQTPDatastore::begin()` and `JKQTPDatastore::end()`. Both functions simply receive the column ID as parameter and exist in a const and a mutable variant. the latter allows to also edit the data. In addition the function `JKQTPDatastore::backInserter()` returns a back-inserter iterator (like generated for STL containers with `std::back_inserter(container)`) that also allows to append to the column. - -Note that the iterator interface allows to use these functions with any container that provides such iterators (e.g. `std::vector`, `std::list`, `std::set`, `QVector`...). - -Code using one of these statistics functions therefore may look e.g. like this: -\code - // mean of a column in a JKQTPDatastore: - double mean=jkqtpstatAverage(datastore1->begin(randomdatacol1), datastore1->end(randomdatacol1)); - - // mean of a std::vector - std::vector data {1,2,4,5,7,8,10,2,1,3,5}; - double meanvec=jkqtpstatAverage(data.begin(), data.end()); -\endcode - -All statistics functions use all values in the given range and convert each value to a `double`, using `jkqtp_todouble()`. The return values is always a dohble. Therefore you can use these functions to calculate statistics of ranges of any type that can be converted to `double`. Values that do not result in a valid `double`are not used in calculating the statistics. Therefore you can exclude values by setting them `JKQTP_DOUBLE_NAN` (i.e. "not a number"). - -\see see for detailed examples: \ref JKQTPlotterBasicJKQTPDatastoreStatistics - -\defgroup jkqtptools_math_statistics_basic Basic statistics -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_grouped Grouped statistics -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_regression Regression Analysis -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_poly Polynomial Fits/Regression -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_1dhist 1-dimensional Histograms -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_2dhist 2-dimensional Histograms -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_1dkde 1-dimensional Kernel Density Estimates -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_1dkde_kernels Kernels for 1-dimensional Histograms -\ingroup jkqtptools_math_statistics_1dkde - -\defgroup jkqtptools_math_statistics_2dkde 2-dimensional Kernel Density Estimates -\ingroup jkqtptools_math_statistics - -\defgroup jkqtptools_math_statistics_2dkde_kernels Kernels for 2-dimensional Histograms -\ingroup jkqtptools_math_statistics_2dkde - -\defgroup jkqtptools_math_statistics_adaptors Statistics To Plot Adaptors -\ingroup jkqtptools_math_statistics - - - -\defgroup jkqtptools_string String/String-Conversion Tool Functions -\ingroup jkqtptools - -Offers diverse function to convert different datatypes (e.g. double, int, diverse enums) to and from strings and for string manipulation. - -\defgroup jkqtptools_qt Additional Tools for Qt -\ingroup jkqtptools - - -\defgroup jkqtptools_qtwidgets Additional Widgets for Qt -\ingroup jkqtptools - -\defgroup jkqtptools_drawing Drawing & Graphics Tools -\ingroup jkqtptools - -Specialized drawing functions used by the plotters and LaTeX renderers. - -\defgroup jkqtptools_debugging Debugging Tools -\ingroup jkqtptools - -Functions that help during debugging (e.g. an assert function/macro). - -\defgroup jkqtptools_codestructuring Code Structuring Tools -\ingroup jkqtptools - -Classes and functions that help to structure the code (e.g. RAII constructs) - -\defgroup jkqtptools_enums Enums for JKQTPlotter (including String Conversion) -\ingroup jkqtptools - -Assembles diverse ENUMs required by JKQTPlotter. - - - \defgroup jkqtplotter JKQTPlotter: Qt based Scientific Plotter Class A Qt based plotter for 2D scientific graphs. Main Plotting widget is JKQTPlotter. diff --git a/doc/dox/whatsnew.dox b/doc/dox/whatsnew.dox index 8eb0b98026..9ffe17e9e8 100644 --- a/doc/dox/whatsnew.dox +++ b/doc/dox/whatsnew.dox @@ -17,6 +17,7 @@ Changes, compared to \ref page_whatsnew_V4_0_0 "v4.0.0" include:
  • General:
    • CLEANUP (BREAKING) of library structure
    • NEW: Using precompiled headers in CMake-build to speed up build times
    • +
    • NEW/BREAKING: split jkqtcommon into basic tools and jkqtcommon_statistics_and_math for advanced math tools not used by all libs
  • JKQtPlotter:
    • FIXED issue described in #62: Fix custom labels draw, because giving exactly two label-strings did not display all of them, thanks to user:FalsinSoft
    • diff --git a/examples/datastore_groupedstat/datastore_groupedstat.cpp b/examples/datastore_groupedstat/datastore_groupedstat.cpp index b4b459395e..e216af5e21 100644 --- a/examples/datastore_groupedstat/datastore_groupedstat.cpp +++ b/examples/datastore_groupedstat/datastore_groupedstat.cpp @@ -9,7 +9,7 @@ #include "jkqtplotter/graphs/jkqtpscatter.h" #include "jkqtplotter/graphs/jkqtpbarchart.h" #include "jkqtplotter/graphs/jkqtpstatisticsadaptors.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include "jkqtcommon/jkqtpstringtools.h" #include #include diff --git a/examples/datastore_regression/datastore_regression.cpp b/examples/datastore_regression/datastore_regression.cpp index 7ceeafd34d..eb819b15cd 100644 --- a/examples/datastore_regression/datastore_regression.cpp +++ b/examples/datastore_regression/datastore_regression.cpp @@ -10,7 +10,7 @@ #include "jkqtplotter/graphs/jkqtpboxplot.h" #include "jkqtplotter/graphs/jkqtpstatisticsadaptors.h" #include "jkqtplotter/graphs/jkqtpevaluatedfunction.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include "jkqtcommon/jkqtpstringtools.h" #include #include diff --git a/examples/datastore_statistics/datastore_statistics.cpp b/examples/datastore_statistics/datastore_statistics.cpp index 975776f34a..255db1d3d6 100644 --- a/examples/datastore_statistics/datastore_statistics.cpp +++ b/examples/datastore_statistics/datastore_statistics.cpp @@ -10,7 +10,7 @@ #include "jkqtplotter/graphs/jkqtpboxplot.h" #include "jkqtplotter/graphs/jkqtpstatisticsadaptors.h" #include "jkqtplotter/graphs/jkqtpevaluatedfunction.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include "jkqtcommon/jkqtpstringtools.h" #include #include diff --git a/examples/datastore_statistics_2d/datastore_statistics_2d.cpp b/examples/datastore_statistics_2d/datastore_statistics_2d.cpp index 6f55435fce..a983e403e1 100644 --- a/examples/datastore_statistics_2d/datastore_statistics_2d.cpp +++ b/examples/datastore_statistics_2d/datastore_statistics_2d.cpp @@ -10,7 +10,7 @@ #include "jkqtplotter/graphs/jkqtpstatisticsadaptors.h" #include "jkqtplotter/graphs/jkqtpgeometric.h" #include "jkqtplotter/graphs/jkqtpscatter.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include "jkqtcommon/jkqtpstringtools.h" #include #include diff --git a/examples/violinplot/violinplot.cpp b/examples/violinplot/violinplot.cpp index 35295a36ae..9f22ddac6e 100644 --- a/examples/violinplot/violinplot.cpp +++ b/examples/violinplot/violinplot.cpp @@ -9,7 +9,7 @@ #include "jkqtplotter/graphs/jkqtpviolinplot.h" #include "jkqtplotter/graphs/jkqtpsinglecolumnsymbols.h" #include "jkqtplotter/graphs/jkqtpstatisticsadaptors.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include #include diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 9abd8b3abd..5f5f4ffa9d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -46,6 +46,7 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/jkqtplotter_version.h.in include_directories(.) add_subdirectory(jkqtcommon) +add_subdirectory(jkqtcommon_statistics_and_math) add_subdirectory(jkqtmathtext) add_subdirectory(jkqtfastplotter) add_subdirectory(jkqtplotter) diff --git a/lib/README.md b/lib/README.md index 853da3147c..0e503dce62 100644 --- a/lib/README.md +++ b/lib/README.md @@ -1,17 +1,12 @@ # JKQTPlotter: LIB subdirectory -This directory contains all files that belong to the JKQTPlotter library (including the files of the JKQTFastPlotter and JKMathText). There are several ways to add these to your program: +This directory contains all files that belong to the JKQTPlotter library (including the files of the JKQTFastPlotter and JKMathText). -### simply include all necessary files -If you use QMake and simply want to include all necessary files into your project, include one of these `PRI`-files into your QMake Project: -- `jkqtplotter.pri` contains all files in this library, including `JKQTFastPlotter` and `JKQTMathText` -- `jkqtfastplotter.pri` contains only those files from this directory which are necessary to build `JKQTFastPlotter` -- `jkqtmathtext.pri` contains only those files from this directory which are necessary to build `JKQTMathText` -- `jkqtpcommon.pri` common support library for all libraries above (math tools, basic drawing tools, ...) +The single libs are: + - jkqtcommon: general tool functions, used by many of the other libs + - jkqtcommon_statistics_and_math: advanced math features used only by few of the other libs + - jkqtfastplotter: a fast plotter variant wiith fewer features + - jkqtmathtext: a LaTeX parser and renderer used by JKQtPlotter + - jkqtplotter: the full-featured plotter library -### Build static libraries -In the directory [`../staticlib`](../staticlib) you will find several Project files that build a static library of the full JKQTPlotter (including JKQTFastPlotter and JKMathText), or of subsets of this library. You can then link against these libs in your project. - -### Build shared libraries (DLLs, SOs, ...) -In the directory [`../sharedlib`](../sharedlib) you will find several Project files that build a dynamic shared library of the full JKQTPlotter (including JKQTFastPlotter and JKMathText), or of subsets of this library. You can then link against these libs in your project. diff --git a/lib/jkqtpcommon.pri b/lib/jkqtcommon.pri similarity index 63% rename from lib/jkqtpcommon.pri rename to lib/jkqtcommon.pri index b382d1a56f..590653689c 100644 --- a/lib/jkqtpcommon.pri +++ b/lib/jkqtcommon.pri @@ -19,49 +19,28 @@ isEmpty(JKQTP_COMMON_PRI_INCLUDED) { HEADERS += $$PWD/jkqtcommon/jkqtcommon_imexport.h \ $$PWD/jkqtcommon/jkqtpdebuggingtools.h \ $$PWD/jkqtcommon/jkqtpmathtools.h \ - $$PWD/jkqtcommon/jkqtpalgorithms.h \ $$PWD/jkqtcommon/jkqtpstringtools.h \ - $$PWD/jkqtcommon/jkqtplinalgtools.h \ $$PWD/jkqtcommon/jkqtpcodestructuring.h \ $$PWD/jkqtcommon/jkqtpbasicimagetools.h \ $$PWD/jkqtcommon/jkqtpgeometrytools.h \ $$PWD/jkqtcommon/jkqtpdrawingtools.h \ $$PWD/jkqtcommon/jkqtpenhancedpainter.h \ $$PWD/jkqtcommon/jkqtphighrestimer.h \ - $$PWD/jkqtcommon/jkqtpmathparser.h \ $$PWD/jkqtcommon/jkqttools.h \ - $$PWD/jkqtcommon/jkqtparraytools.h \ - $$PWD/jkqtcommon/jkqtpstatisticstools.h \ - $$PWD/jkqtcommon/jkqtpstatbasics.h \ - $$PWD/jkqtcommon/jkqtpstathistogram.h \ - $$PWD/jkqtcommon/jkqtpstatkde.h \ - $$PWD/jkqtcommon/jkqtpstatregression.h \ - $$PWD/jkqtcommon/jkqtpstatpoly.h \ - $$PWD/jkqtcommon/jkqtpstatgrouped.h \ $$PWD/jkqtcommon/jkqtpicons.h SOURCES += $$PWD/jkqtcommon/jkqtpdebuggingtools.cpp \ $$PWD/jkqtcommon/jkqtpmathtools.cpp \ - $$PWD/jkqtcommon/jkqtpalgorithms.cpp \ $$PWD/jkqtcommon/jkqtpstringtools.cpp \ - $$PWD/jkqtcommon/jkqtplinalgtools.cpp \ $$PWD/jkqtcommon/jkqtpcodestructuring.cpp \ $$PWD/jkqtcommon/jkqtpbasicimagetools.cpp \ $$PWD/jkqtcommon/jkqtpgeometrytools.cpp \ $$PWD/jkqtcommon/jkqtpdrawingtools.cpp \ $$PWD/jkqtcommon/jkqtpenhancedpainter.cpp \ $$PWD/jkqtcommon/jkqtphighrestimer.cpp \ - $$PWD/jkqtcommon/jkqtpmathparser.cpp \ $$PWD/jkqtcommon/jkqttools.cpp \ - $$PWD/jkqtcommon/jkqtparraytools.cpp \ - $$PWD/jkqtcommon/jkqtpstatbasics.cpp \ - $$PWD/jkqtcommon/jkqtpstathistogram.cpp \ - $$PWD/jkqtcommon/jkqtpstatkde.cpp \ - $$PWD/jkqtcommon/jkqtpstatregression.cpp \ - $$PWD/jkqtcommon/jkqtpstatpoly.cpp \ - $$PWD/jkqtcommon/jkqtpstatgrouped.cpp \ $$PWD/jkqtcommon/jkqtpicons.cpp diff --git a/lib/jkqtcommon/CMakeLists.txt b/lib/jkqtcommon/CMakeLists.txt index de22101f89..64f8ec257a 100644 --- a/lib/jkqtcommon/CMakeLists.txt +++ b/lib/jkqtcommon/CMakeLists.txt @@ -23,24 +23,14 @@ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) set(SOURCES ${CMAKE_CURRENT_LIST_DIR}/jkqtpdebuggingtools.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpmathtools.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpalgorithms.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpstringtools.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtplinalgtools.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpcodestructuring.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpbasicimagetools.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpgeometrytools.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpdrawingtools.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpenhancedpainter.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtphighrestimer.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpmathparser.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqttools.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtparraytools.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatbasics.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstathistogram.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatkde.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatregression.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatpoly.cpp - ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatgrouped.cpp ${CMAKE_CURRENT_LIST_DIR}/jkqtpicons.cpp ) @@ -49,46 +39,20 @@ set(HEADERS $ $ $ - $ - $ - $ - $ $ $ - $ - $ $ $ $ $ - $ - $ $ $ $ $ $ $ - $ - $ $ $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ $ $ ) diff --git a/lib/jkqtcommon/private/jkqtcommon_precomp.h b/lib/jkqtcommon/private/jkqtcommon_precomp.h index 80671e7538..edf2f7c555 100644 --- a/lib/jkqtcommon/private/jkqtcommon_precomp.h +++ b/lib/jkqtcommon/private/jkqtcommon_precomp.h @@ -68,4 +68,8 @@ #include #include #include +#include "jkqtcommon/jkqtpmathtools.h" +#include "jkqtcommon/jkqtpcodestructuring.h" +#include "jkqtcommon/jkqtpdebuggingtools.h" + #endif // jkqtcommon_precomp_h diff --git a/lib/jkqtcommon_statistics_and_math.pri b/lib/jkqtcommon_statistics_and_math.pri new file mode 100644 index 0000000000..fbd5e1ed7f --- /dev/null +++ b/lib/jkqtcommon_statistics_and_math.pri @@ -0,0 +1,52 @@ +# include guard against multiple inclusion +isEmpty(JKQTP_COMMON_STATISCTICS_AND_MATH_PRI_INCLUDED) { + JKQTP_COMMON_STATISCTICS_AND_MATH_PRI_INCLUDED = 1 + + !win32-msvc* { + QMAKE_CXXFLAGS += -fexceptions + } else { + QMAKE_CXXFLAGS += /EHsc + # /std:c++14 + # To enable M_PI, M_E,... + DEFINES += _USE_MATH_DEFINES + # To fix error: C2338: va_start argument must not + # have reference type and must not be parenthesized + DEFINES += _CRT_NO_VA_START_VALIDATION + # fix errors with min()/max() macros from windows + DEFINES += NOMINMAX + } + + HEADERS += $$PWD/jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpalgorithms.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtplinalgtools.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpmathparser.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtparraytools.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatisticstools.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatbasics.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstathistogram.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatkde.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatregression.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatpoly.h \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatgrouped.h + + + + SOURCES += $$PWD/jkqtcommon_statistics_and_math/jkqtpalgorithms.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtplinalgtools.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpmathparser.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtparraytools.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatbasics.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstathistogram.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatkde.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatregression.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatpoly.cpp \ + $$PWD/jkqtcommon_statistics_and_math/jkqtpstatgrouped.cpp + + + INCLUDEPATH += $$PWD + + QT += core gui + greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport + + CONFIG += c++11 +} diff --git a/lib/jkqtcommon_statistics_and_math/CMakeLists.txt b/lib/jkqtcommon_statistics_and_math/CMakeLists.txt new file mode 100644 index 0000000000..36f5d50cf1 --- /dev/null +++ b/lib/jkqtcommon_statistics_and_math/CMakeLists.txt @@ -0,0 +1,164 @@ +cmake_minimum_required(VERSION 3.15) + +set(libBasename JKQTCommonStatisticsAndMath) +set(libIncludeSubdir jkqtcommon_statistics_and_math) + +if(JKQtPlotter_BUILD_SHARED_LIBS) + set(libsh_name ${libBasename}SharedLib) + set(libsh_name_decorated ${libsh_name}${JKQtPlotter_LIBNAME_ADDITION}) + set(${libBasename}_SHARED_LIBRARY ${libsh_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE) + message( STATUS "-- Building ${libsh_name}" ) +endif(JKQtPlotter_BUILD_SHARED_LIBS) + +if(JKQtPlotter_BUILD_STATIC_LIBS) + set(lib_name ${libBasename}Lib) + set(lib_name_decorated ${lib_name}${JKQtPlotter_LIBNAME_ADDITION}) + set(${libBasename}_STATIC_LIBRARY ${lib_name_decorated} CACHE STRING "name of static library for ${libBasename}" FORCE) + message( STATUS "-- Building ${lib_name}" ) +endif(JKQtPlotter_BUILD_STATIC_LIBS) + +set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) + +# Set up source files +set(SOURCES + ${CMAKE_CURRENT_LIST_DIR}/jkqtpalgorithms.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtplinalgtools.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpmathparser.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtparraytools.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatbasics.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstathistogram.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatkde.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatregression.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatpoly.cpp + ${CMAKE_CURRENT_LIST_DIR}/jkqtpstatgrouped.cpp +) + +set(HEADERS + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ +) + +include(CMakePackageConfigHelpers) + +function(JKQtCommon_setDefaultLibOptions TARGETNAME) + set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}") + target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core ) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD}) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}) + target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE}) + if(MINGW) + # COMPILER-SETTINGS FOR MINGW + target_compile_options(${TARGETNAME} PUBLIC -fexceptions) + elseif(MSVC) + # COMPILER-SETTINGS FOR MS VISUAL C++ + target_compile_options(${TARGETNAME} PUBLIC /EHsc) + target_compile_definitions(${TARGETNAME} PUBLIC NOMINMAX) + endif() + target_include_directories(${TARGETNAME} PUBLIC + $ + $ + ) + # precomiled headers to speed up compilation + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_statistics_and_math_precomp.h) + target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_statistics_and_math_precomp.h) + endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) +endfunction() + + +if(JKQtPlotter_BUILD_SHARED_LIBS) + add_library(${libsh_name} SHARED ${SOURCES} ${HEADERS} ) + JKQtCommon_setDefaultLibOptions(${libsh_name}) + set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") + target_compile_definitions(${libsh_name} PUBLIC JKQTCOMMON_STATISTICS_AND_MATH_LIB_IN_DLL) + target_compile_definitions(${libsh_name} PRIVATE JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT_LIBRARY) + target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib) + set_target_properties(${libsh_name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS "ON") + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion ) +endif() + +if(JKQtPlotter_BUILD_STATIC_LIBS) + add_library(${lib_name} STATIC ${SOURCES} ${HEADERS}) + JKQtCommon_setDefaultLibOptions(${lib_name}) + target_link_libraries(${libsh_name} PUBLIC JKQTCommonLib) + set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}") + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion ) +endif() + + + +# Installation +if(JKQtPlotter_BUILD_SHARED_LIBS) + install(TARGETS ${libsh_name} EXPORT ${libsh_name}_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + ) + + set(JKQTP_CURRENT_TARGET_FILENAME "${libsh_name}Targets.cmake") + configure_file(LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Config.cmake" @ONLY) + install(EXPORT ${libsh_name}_TARGETS + FILE "${JKQTP_CURRENT_TARGET_FILENAME}" + DESTINATION lib/cmake + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Version.cmake" + DESTINATION lib/cmake ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${libsh_name}Config.cmake" + DESTINATION lib/cmake ) +endif(JKQtPlotter_BUILD_SHARED_LIBS) + +if(JKQtPlotter_BUILD_STATIC_LIBS) + install(TARGETS ${lib_name} EXPORT ${lib_name}_TARGETS + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + ) + set(JKQTP_CURRENT_TARGET_FILENAME "${lib_name}Targets.cmake") + configure_file(LibTarget.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" @ONLY) + install(EXPORT ${lib_name}_TARGETS + FILE "${JKQTP_CURRENT_TARGET_FILENAME}" + DESTINATION lib/cmake + ) + + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake" + DESTINATION lib/cmake ) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Config.cmake" + DESTINATION lib/cmake ) + +endif(JKQtPlotter_BUILD_STATIC_LIBS) + +install(FILES ${HEADERS} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${libIncludeSubdir} + COMPONENT Headers) + +configure_file(${PROJECT_SOURCE_DIR}/readme.txt.in ${CMAKE_CURRENT_BINARY_DIR}/${lib_name}_Readme.txt @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${lib_name}_Readme.txt" DESTINATION doc/JKQtPlotter ) +install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION doc/JKQtPlotter RENAME "${lib_name}_LICENSE.txt" ) + diff --git a/lib/jkqtcommon_statistics_and_math/LibTarget.cmake.in b/lib/jkqtcommon_statistics_and_math/LibTarget.cmake.in new file mode 100644 index 0000000000..5dbcee9667 --- /dev/null +++ b/lib/jkqtcommon_statistics_and_math/LibTarget.cmake.in @@ -0,0 +1,13 @@ +# Package-config file for @libBasename@ library +# (part of JKQtPlotter, version @PROJECT_VERSION@) +# +# see: https://github.com/jkriege2/JKQtPlotter +# Copyright: (c) Jan Krieger +# + + +# package requires Qt 5/6 +find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core REQUIRED) + +# include auto-generated targets.cmake file +include("${CMAKE_CURRENT_LIST_DIR}/@JKQTP_CURRENT_TARGET_FILENAME@") \ No newline at end of file diff --git a/lib/jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h b/lib/jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h new file mode 100644 index 0000000000..50b6558d09 --- /dev/null +++ b/lib/jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h @@ -0,0 +1,94 @@ +#ifndef jkqtcommon_statistics_and_math_IMPORT_H +#define jkqtcommon_statistics_and_math_IMPORT_H + +/* + Copyright (c) 2008-2022 Jan W. Krieger () + + last modification: $LastChangedDate: 2015-04-02 13:55:22 +0200 (Do, 02 Apr 2015) $ (revision $Rev: 3902 $) + + This software is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License (LGPL) as published by + the Free Software Foundation, either version 2.1 of the License, or + (at your option) any later version. + + This program 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 Lesser General Public License (LGPL) for more details. + + You should have received a copy of the GNU Lesser General Public License (LGPL) + along with this program. If not, see . +*/ + + + + +/*! \def JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT + \ingroup tools + + This define allows to export functions and classes from the jkqtcommon_statistics_and_math-library when building a dynamic/shared library. + Usage is as follows: + \code + #include "jkqtcommon_statistics_and_math_imexport/jkqtcommon_statistics_and_math_imexport.h" + + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT exportedClassName { + ... + }; + + JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT void exportedFunctionName(); + \endcode + + These macros append the appropriate \c Q_DECL_EXPORT and \c Q_DECL_IMPORT + to the function/class body and thus tell windows compilers to export these sysmbols from + the shared library, or import them from a shared library. + + Note that these attributes are only necessary on windows systems! + + These macros are controlled by two other macros: + - \c JKQTCOMMON_STATISTICS_AND_MATH_LIB_IN_DLL declares that the application should link against a shared version of + JKQTCommonStatisticsAndMath, i.e. \c JKQTCommonStatisticsAndMathSharedLib_XYZ . + This needs to be defined while compiling the library and while compiling + any application linking against \c JKQTCommonStatisticsAndMathSharedLib_XYZ. + - \c JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT_LIBRARY is only defined while compiling JKQTCommonStatisticsAndMath into \c JKQTCommonStatisticsAndMathSharedLib_XYZ + and ensures thet the symbols are exported. If it is not defined (e.g. while + compiling an application), the symbols are imported + . + + */ + +/*! \def JKQTCOMMON_STATISTICS_AND_MATH_LIB_IN_DLL + \ingroup tools + \brief declares that the application should link against a shared version of + JKQTCommonStatisticsAndMath, i.e. \c JKQTCommonStatisticsAndMathSharedLib_XYZ . + This needs to be defined while compiling the library and while compiling + any application linking against \c JKQTCommonStatisticsAndMathSharedLib_XYZ. +*/ + +/*! \def JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT_LIBRARY + \ingroup tools + \brief is only defined while compiling JKQTCommonStatisticsAndMath into \c JKQTCommonStatisticsAndMathSharedLib_XYZ + and ensures thet the symbols are exported. If it is not defined (e.g. while + compiling an application), the symbols are imported +*/ + +#include +# ifdef JKQTCOMMON_STATISTICS_AND_MATH_LIB_IN_DLL +# ifndef JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT +# ifdef JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT_LIBRARY + /* We are building this library */ +# define JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT Q_DECL_EXPORT +# else + /* We are using this library */ +# define JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT Q_DECL_IMPORT +# endif +# endif +# else +# ifndef JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT +# define JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT +# endif +# endif + + + +#endif // jkqtcommon_statistics_and_math_IMPORT_H + diff --git a/lib/jkqtcommon/jkqtpalgorithms.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.cpp similarity index 90% rename from lib/jkqtcommon/jkqtpalgorithms.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.cpp index 0c8762ec41..5b46fb7e90 100644 --- a/lib/jkqtcommon/jkqtpalgorithms.cpp +++ b/lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.cpp @@ -18,4 +18,4 @@ -#include "jkqtcommon/jkqtpalgorithms.h" +#include "jkqtcommon_statistics_and_math/jkqtpalgorithms.h" diff --git a/lib/jkqtcommon/jkqtpalgorithms.h b/lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.h similarity index 95% rename from lib/jkqtcommon/jkqtpalgorithms.h rename to lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.h index 5989a21471..4c4abc4ccc 100644 --- a/lib/jkqtcommon/jkqtpalgorithms.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpalgorithms.h @@ -21,7 +21,7 @@ #ifndef JKQTPALGORITHMS_H_INCLUDED #define JKQTPALGORITHMS_H_INCLUDED -#include "jkqtcommon/jkqtcommon_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" diff --git a/lib/jkqtcommon/jkqtparraytools.cpp b/lib/jkqtcommon_statistics_and_math/jkqtparraytools.cpp similarity index 100% rename from lib/jkqtcommon/jkqtparraytools.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtparraytools.cpp diff --git a/lib/jkqtcommon/jkqtparraytools.h b/lib/jkqtcommon_statistics_and_math/jkqtparraytools.h similarity index 93% rename from lib/jkqtcommon/jkqtparraytools.h rename to lib/jkqtcommon_statistics_and_math/jkqtparraytools.h index 2e0d968d56..77849fb446 100644 --- a/lib/jkqtcommon/jkqtparraytools.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtparraytools.h @@ -34,7 +34,7 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" #ifdef _OPENMP diff --git a/lib/jkqtcommon/jkqtplinalgtools.cpp b/lib/jkqtcommon_statistics_and_math/jkqtplinalgtools.cpp similarity index 100% rename from lib/jkqtcommon/jkqtplinalgtools.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtplinalgtools.cpp diff --git a/lib/jkqtcommon/jkqtplinalgtools.h b/lib/jkqtcommon_statistics_and_math/jkqtplinalgtools.h similarity index 97% rename from lib/jkqtcommon/jkqtplinalgtools.h rename to lib/jkqtcommon_statistics_and_math/jkqtplinalgtools.h index 292dab4754..853e9434a7 100644 --- a/lib/jkqtcommon/jkqtplinalgtools.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtplinalgtools.h @@ -35,8 +35,8 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpmathtools.h" #include "jkqtcommon/jkqtpstringtools.h" diff --git a/lib/jkqtcommon/jkqtpmathparser.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpmathparser.cpp similarity index 97% rename from lib/jkqtcommon/jkqtpmathparser.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpmathparser.cpp index a8f3ca347c..7890f7eeef 100644 --- a/lib/jkqtcommon/jkqtpmathparser.cpp +++ b/lib/jkqtcommon_statistics_and_math/jkqtpmathparser.cpp @@ -22,7 +22,7 @@ #define COMPILING_THIS_JKMATHPARSER #define _USE_MATH_DEFINES #include -#include "jkqtcommon/jkqtpmathparser.h" // class's header file +#include "jkqtcommon_statistics_and_math/jkqtpmathparser.h" // class's header file #include #include #include diff --git a/lib/jkqtcommon/jkqtpmathparser.h b/lib/jkqtcommon_statistics_and_math/jkqtpmathparser.h similarity index 93% rename from lib/jkqtcommon/jkqtpmathparser.h rename to lib/jkqtcommon_statistics_and_math/jkqtpmathparser.h index 77701d21b1..247f812826 100644 --- a/lib/jkqtcommon/jkqtpmathparser.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpmathparser.h @@ -46,7 +46,7 @@ #include #include #include -#include "jkqtcommon_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" #ifndef JKQTPMATHPARSER_H #define JKQTPMATHPARSER_H @@ -234,7 +234,7 @@ } \endcode */ -class JKQTCOMMON_LIB_EXPORT JKQTPMathParser +class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT JKQTPMathParser { protected: void* data; @@ -314,7 +314,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser /** \brief result of any expression * \ingroup jkmpultil*/ - struct JKQTCOMMON_LIB_EXPORT jkmpResult { + struct JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpResult { jkmpResult(); bool isValid; @@ -335,7 +335,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * only contains pointers to the data * \ingroup jkmpultil */ - struct JKQTCOMMON_LIB_EXPORT jkmpVariable { + struct JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpVariable { jkmpVariable(); jkmpResultType type; /*!< \brief type of the variable */ bool internal; /*!< \brief this is an internal variable */ @@ -347,7 +347,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser /** \brief This struct is for managing temporary variables. It is generally like jkmpVariable. * \ingroup jkmpultil */ - struct JKQTCOMMON_LIB_EXPORT jkmpTempVariable { + struct JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpTempVariable { std::string name; /*!< \brief name of the variable */ jkmpResultType type; /*!< \brief type of the variable */ bool internal; /*!< \brief this is an internal variable */ @@ -384,7 +384,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser /** \brief description of a user registered function */ - struct JKQTCOMMON_LIB_EXPORT jkmpFunctionDescriptor { + struct JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpFunctionDescriptor { jkmpEvaluateFunc function; /*!< \brief a pointer to the function implementation */ std::string name; /*!< \brief name of the function */ }; @@ -399,7 +399,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * All allowed node types must inherit from jkmpNode * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpNode { protected: JKQTPMathParser* parser; /*!< \brief points to the parser object that is used to evaluate this node */ jkmpNode* parent; /*!< \brief points to the parent node */ @@ -429,7 +429,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * add (+), subtract (-), multiply (*), divide (/), a to the power of b (a^b) * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpBinaryArithmeticNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpBinaryArithmeticNode: public jkmpNode { private: jkmpNode* left, *right; char operation; @@ -454,7 +454,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a binary boolean operation: and, or, xor, nor, nand * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpBinaryBoolNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpBinaryBoolNode: public jkmpNode { private: jkmpNode* left, *right; char operation; @@ -479,7 +479,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a binary compare operation: !=, ==, >=, <=, >, < * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpCompareNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpCompareNode: public jkmpNode { private: jkmpNode* left, *right; char operation; @@ -504,7 +504,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a unary operations: ! (bool negation), - (arithmetic negation) * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpUnaryNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpUnaryNode: public jkmpNode { private: jkmpNode* child; char operation; @@ -528,7 +528,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a variable assignment (a = expression) * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpVariableAssignNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpVariableAssignNode: public jkmpNode { private: jkmpNode* child; std::string variable; @@ -553,7 +553,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a number, a string contant or a boolean contant (true/false) * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpConstantNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpConstantNode: public jkmpNode { private: jkmpResult data; public: @@ -572,7 +572,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * \brief This class represents a variable. * \ingroup jkmpNodes */ - class JKQTCOMMON_LIB_EXPORT jkmpVariableNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpVariableNode: public jkmpNode { private: std::string var; public: @@ -597,7 +597,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * * Functions may have 8 parameters at the most. */ - class JKQTCOMMON_LIB_EXPORT jkmpFunctionNode: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpFunctionNode: public jkmpNode { private: std::string fun; jkmpNode** child; @@ -626,7 +626,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * * when evaluating the result will be the result of the last node in the list. */ - class JKQTCOMMON_LIB_EXPORT jkmpNodeList: public jkmpNode { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpNodeList: public jkmpNode { private: std::vector list; public: @@ -665,7 +665,7 @@ class JKQTCOMMON_LIB_EXPORT JKQTPMathParser * error handler and assign it (function pointer) to the global variable jkmathparser_exception_function. * If this is not nullptr this function will be called instead of throwing an exception. */ - class JKQTCOMMON_LIB_EXPORT jkmpException : public std::exception { + class JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT jkmpException : public std::exception { private: /** \brief the error message */ std::string errormessage; diff --git a/lib/jkqtcommon/jkqtpstatbasics.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstatbasics.cpp similarity index 100% rename from lib/jkqtcommon/jkqtpstatbasics.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstatbasics.cpp diff --git a/lib/jkqtcommon/jkqtpstatbasics.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatbasics.h similarity index 97% rename from lib/jkqtcommon/jkqtpstatbasics.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatbasics.h index 3e9e387f28..89bf21354c 100644 --- a/lib/jkqtcommon/jkqtpstatbasics.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatbasics.h @@ -34,9 +34,9 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" @@ -1019,7 +1019,7 @@ inline void jkqtpstat5NumberStatisticsAndOutliers(InputIt first, InputIt last, O \ingroup jkqtptools_math_statistics_basic \see https://en.wikipedia.org/wiki/Five-number_summary, jkqtpstat5NumberStatistics() */ -struct JKQTCOMMON_LIB_EXPORT JKQTPStat5NumberStatistics { +struct JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT JKQTPStat5NumberStatistics { JKQTPStat5NumberStatistics(); /** \brief minimum value */ diff --git a/lib/jkqtcommon/jkqtpstatgrouped.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.cpp similarity index 93% rename from lib/jkqtcommon/jkqtpstatgrouped.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.cpp index 5365a5bde1..976caeabdd 100644 --- a/lib/jkqtcommon/jkqtpstatgrouped.cpp +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.cpp @@ -19,7 +19,7 @@ -#include "jkqtpstatgrouped.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatgrouped.h" double jkqtpstatGroupingIdentity1D(double v) { return v; diff --git a/lib/jkqtcommon/jkqtpstatgrouped.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.h similarity index 93% rename from lib/jkqtcommon/jkqtpstatgrouped.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.h index 54b4509563..2ed1d63f9d 100644 --- a/lib/jkqtcommon/jkqtpstatgrouped.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatgrouped.h @@ -34,11 +34,11 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" -#include "jkqtcommon/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" /*! \brief a functor \f$ f(x): \mathbb{R}\rightarrow\mathbb{R} \f$ which assignes a value \f$ x \f$ to a group center \f$ f(x) \f$ \ingroup jkqtptools_math_statistics_grouped @@ -60,13 +60,13 @@ typedef std::function JKQTPStatGroupDefinitionFunctor1D; \see JKQTPStatGroupDefinitionFunctor1D */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatGroupingIdentity1D(double v); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatGroupingIdentity1D(double v); /*! \brief use a rounded column value as group ID directly \f$ f(x)=\mbox{round}(x) \f$ \ingroup jkqtptools_math_statistics_grouped \see JKQTPStatGroupDefinitionFunctor1D */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatGroupingRound1D(double v); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatGroupingRound1D(double v); /*! \brief assign each value to groups \f$ \mbox{firstGroupCenter} \f$ , \f$ \mbox{firstGroupCenter}\pm\mbox{groupWidth}/2\f$ , \f$ \mbox{firstGroupCenter}\pm2\cdot\mbox{groupWidth}/2 \f$ , \f$ \mbox{firstGroupCenter}\pm3\cdot\mbox{groupWidth}/2 \f$ , ... \ingroup jkqtptools_math_statistics_grouped @@ -74,7 +74,7 @@ JKQTCOMMON_LIB_EXPORT double jkqtpstatGroupingRound1D(double v); \see JKQTPStatGroupDefinitionFunctor1D, jkqtpstatMakeGroupingCustomRound1D() for a factory-function that returns a functor of this function bound to specific arguments. */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatGroupingCustomRound1D(double v, double firstGroupCenter, double groupWidth); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatGroupingCustomRound1D(double v, double firstGroupCenter, double groupWidth); /*! \brief generates a functor of jkqtpstatGroupingCustomRound1D() with the two paramaters \a firstGroupCenter and \a groupWidth fixed to the given values \ingroup jkqtptools_math_statistics_grouped @@ -82,7 +82,7 @@ JKQTCOMMON_LIB_EXPORT double jkqtpstatGroupingCustomRound1D(double v, double fir \see JKQTPStatGroupDefinitionFunctor1D, jkqtpstatGroupingCustomRound1D() */ -JKQTCOMMON_LIB_EXPORT JKQTPStatGroupDefinitionFunctor1D jkqtpstatMakeGroupingCustomRound1D(double firstGroupCenter, double groupWidth); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT JKQTPStatGroupDefinitionFunctor1D jkqtpstatMakeGroupingCustomRound1D(double firstGroupCenter, double groupWidth); diff --git a/lib/jkqtcommon/jkqtpstathistogram.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstathistogram.cpp similarity index 100% rename from lib/jkqtcommon/jkqtpstathistogram.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstathistogram.cpp diff --git a/lib/jkqtcommon/jkqtpstathistogram.h b/lib/jkqtcommon_statistics_and_math/jkqtpstathistogram.h similarity index 95% rename from lib/jkqtcommon/jkqtpstathistogram.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstathistogram.h index 9cf54d401a..4be7972d7a 100644 --- a/lib/jkqtcommon/jkqtpstathistogram.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstathistogram.h @@ -34,11 +34,11 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" -#include "jkqtcommon/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" diff --git a/lib/jkqtcommon/jkqtpstatisticstools.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatisticstools.h similarity index 70% rename from lib/jkqtcommon/jkqtpstatisticstools.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatisticstools.h index 32f350371a..585cf48731 100644 --- a/lib/jkqtcommon/jkqtpstatisticstools.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatisticstools.h @@ -22,12 +22,12 @@ #define JKQTPSTATISTICSTOOLS_H_INCLUDED -#include "jkqtcommon/jkqtpstatbasics.h" -#include "jkqtcommon/jkqtpstathistogram.h" -#include "jkqtcommon/jkqtpstatkde.h" -#include "jkqtcommon/jkqtpstatpoly.h" -#include "jkqtcommon/jkqtpstatregression.h" -#include "jkqtcommon/jkqtpstatgrouped.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtpstathistogram.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatkde.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatpoly.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatregression.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatgrouped.h" #endif // JKQTPSTATISTICSTOOLS_H_INCLUDED diff --git a/lib/jkqtcommon/jkqtpstatkde.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstatkde.cpp similarity index 93% rename from lib/jkqtcommon/jkqtpstatkde.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstatkde.cpp index fb817b2f83..40f1b68f05 100644 --- a/lib/jkqtcommon/jkqtpstatkde.cpp +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatkde.cpp @@ -19,7 +19,7 @@ -#include "jkqtpstatkde.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatkde.h" double jkqtpstatKernel1DGaussian(double t) { diff --git a/lib/jkqtcommon/jkqtpstatkde.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatkde.h similarity index 92% rename from lib/jkqtcommon/jkqtpstatkde.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatkde.h index 218504cb5a..a6c3bd0f1f 100644 --- a/lib/jkqtcommon/jkqtpstatkde.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatkde.h @@ -34,11 +34,11 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" -#include "jkqtcommon/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" @@ -49,64 +49,64 @@ \f[ k(t):=\frac{1}{\sqrt{2\pi}}\exp \left(-\frac{1}{2}t^2\right) \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DGaussian(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DGaussian(double t); /*! \brief a 1D Cauchy kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t):=\frac{1}{\pi(1+t^2)} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DCauchy(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DCauchy(double t); /*! \brief a 1D Picard kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t):=\frac{1}{2}\exp(-|t|) \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DPicard(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DPicard(double t); /*! \brief a 1D Epanechnikov kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}\frac{3}{4} ( 1- t^2 ), & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DEpanechnikov(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DEpanechnikov(double t); /*! \brief a 1D uniform kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}0.5, & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DUniform(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DUniform(double t); /*! \brief a 1D Epanechnikov kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}1-|t|, & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DTriangle(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DTriangle(double t); /*! \brief a 1D quartic kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}\frac{15}{16}(1-t^2)^2, & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DQuartic(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DQuartic(double t); /*! \brief a 1D triweight kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}\frac{35}{32}(1-t^2)^3, & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DTriweight(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DTriweight(double t); /*! \brief a 1D tricube kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}\frac{70}{81}(1-|t|^3)^3, & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DTricube(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DTricube(double t); /*! \brief a 1D cosine kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_1dkde_kernels \f[ k(t) :=\begin{cases}\frac{\pi}{4}\cos\left(\frac{\pi}{2}t\right), & \text{if }t\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DCosine(double t); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel1DCosine(double t); @@ -125,14 +125,14 @@ JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel1DCosine(double t); \f[ k(t_x, t_y):=\frac{1}{2\pi}\exp \left(-\frac{t_x^2+t_y^2}{2}\right) \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel2DGaussian(double tx, double ty); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel2DGaussian(double tx, double ty); /*! \brief a 1D Gaussian kernel function, e.g. for Kernel Density Estimation \ingroup jkqtptools_math_statistics_2dkde_kernels \f[ k(t_x, t_y):=\begin{cases}\frac{1}{4}, & \text{if }t_x,t_y\in [-1;1]\\0, & \text{else}\end{cases} \f] */ -JKQTCOMMON_LIB_EXPORT double jkqtpstatKernel2DUniform(double tx, double ty); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT double jkqtpstatKernel2DUniform(double tx, double ty); diff --git a/lib/jkqtcommon/jkqtpstatpoly.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstatpoly.cpp similarity index 100% rename from lib/jkqtcommon/jkqtpstatpoly.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstatpoly.cpp diff --git a/lib/jkqtcommon/jkqtpstatpoly.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatpoly.h similarity index 93% rename from lib/jkqtcommon/jkqtpstatpoly.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatpoly.h index 9aa7998316..8463ee876c 100644 --- a/lib/jkqtcommon/jkqtpstatpoly.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatpoly.h @@ -34,9 +34,9 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" diff --git a/lib/jkqtcommon/jkqtpstatregression.cpp b/lib/jkqtcommon_statistics_and_math/jkqtpstatregression.cpp similarity index 100% rename from lib/jkqtcommon/jkqtpstatregression.cpp rename to lib/jkqtcommon_statistics_and_math/jkqtpstatregression.cpp diff --git a/lib/jkqtcommon/jkqtpstatregression.h b/lib/jkqtcommon_statistics_and_math/jkqtpstatregression.h similarity index 94% rename from lib/jkqtcommon/jkqtpstatregression.h rename to lib/jkqtcommon_statistics_and_math/jkqtpstatregression.h index 62985ba432..4096eebc98 100644 --- a/lib/jkqtcommon/jkqtpstatregression.h +++ b/lib/jkqtcommon_statistics_and_math/jkqtpstatregression.h @@ -34,12 +34,12 @@ #include #include #include -#include "jkqtcommon/jkqtcommon_imexport.h" -#include "jkqtcommon/jkqtplinalgtools.h" -#include "jkqtcommon/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtcommon_statistics_and_math_imexport.h" +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" -#include "jkqtcommon/jkqtpstatbasics.h" -#include "jkqtcommon/jkqtpstatpoly.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatpoly.h" @@ -278,37 +278,37 @@ enum class JKQTPStatRegressionModelType { /*! \brief Generates functors \c f(x,a,b) for the models from JKQTPStatRegressionModelType in \a type \ingroup jkqtptools_math_statistics_regression */ -JKQTCOMMON_LIB_EXPORT std::function jkqtpStatGenerateRegressionModel(JKQTPStatRegressionModelType type); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT std::function jkqtpStatGenerateRegressionModel(JKQTPStatRegressionModelType type); /*! \brief Generates a LaTeX string for the models from JKQTPStatRegressionModelType in \a type \ingroup jkqtptools_math_statistics_regression */ -JKQTCOMMON_LIB_EXPORT QString jkqtpstatRegressionModel2Latex(JKQTPStatRegressionModelType type, double a, double b); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT QString jkqtpstatRegressionModel2Latex(JKQTPStatRegressionModelType type, double a, double b); /*! \brief Generates functors \c f(x) for the models from JKQTPStatRegressionModelType in \a type and binds the parameter values \a and \a b to the returned function \ingroup jkqtptools_math_statistics_regression */ -JKQTCOMMON_LIB_EXPORT std::function jkqtpStatGenerateRegressionModel(JKQTPStatRegressionModelType type, double a, double b); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT std::function jkqtpStatGenerateRegressionModel(JKQTPStatRegressionModelType type, double a, double b); /*! \brief Generates the transformation function for x-data (\c result.first ) and y-data (\c result.second ) for each regression model in JKQTPStatRegressionModelType in \a type \ingroup jkqtptools_math_statistics_regression \internal */ -JKQTCOMMON_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateTransformation(JKQTPStatRegressionModelType type); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateTransformation(JKQTPStatRegressionModelType type); /*! \brief Generates the transformation function for a-parameter (offset, \c result.first : transform, \c result.second : back-transform) for each regression model in JKQTPStatRegressionModelType in \a type \ingroup jkqtptools_math_statistics_regression \internal */ -JKQTCOMMON_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateParameterATransformation(JKQTPStatRegressionModelType type); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateParameterATransformation(JKQTPStatRegressionModelType type); /*! \brief Generates the transformation function for b-parameter (slope, \c result.first : transform, \c result.second : back-transform) for each regression model in JKQTPStatRegressionModelType in \a type \ingroup jkqtptools_math_statistics_regression \internal */ -JKQTCOMMON_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateParameterBTransformation(JKQTPStatRegressionModelType type); +JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT std::pair,std::function > jkqtpStatGenerateParameterBTransformation(JKQTPStatRegressionModelType type); /*! \brief calculate the linear regression coefficients for a given data range \a firstX / \a firstY ... \a lastX / \a lastY where the model is defined by \a type diff --git a/lib/jkqtcommon_statistics_and_math/private/jkqtcommon_statistics_and_math_precomp.h b/lib/jkqtcommon_statistics_and_math/private/jkqtcommon_statistics_and_math_precomp.h new file mode 100644 index 0000000000..7631f3ef73 --- /dev/null +++ b/lib/jkqtcommon_statistics_and_math/private/jkqtcommon_statistics_and_math_precomp.h @@ -0,0 +1,55 @@ +/* THIS IS a PRECOMILED HEADER-File for JKQTCommon-Lib + * it is not intended for external use! + */ + +#ifndef jkqtcommon_statistics_and_math_precomp_H +#define jkqtcommon_statistics_and_math_precomp_H + +/* + Copyright (c) 2008-2022 Jan W. Krieger () + + + + This software is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License (LGPL) as published by + the Free Software Foundation, either version 2.1 of the License, or + (at your option) any later version. + + This program 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 Lesser General Public License (LGPL) for more details. + + You should have received a copy of the GNU Lesser General Public License (LGPL) + along with this program. If not, see . +*/ +#define _USE_MATH_DEFINES + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "jkqtcommon_statistics_and_math/jkqtplinalgtools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatbasics.h" +#include "jkqtcommon_statistics_and_math/jkqtparraytools.h" +#include "jkqtcommon_statistics_and_math/jkqtpalgorithms.h" +#include "jkqtcommon/jkqtpmathtools.h" +#include "jkqtcommon/jkqtpstringtools.h" +#include "jkqtcommon/jkqtpdebuggingtools.h" + +#endif // jkqtcommon_statistics_and_math_precomp_H diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index 6c1afa7c23..444cb99d9c 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -237,7 +237,7 @@ if(JKQtPlotter_BUILD_SHARED_LIBS) ) JKQtPlottter_setDefaultLibOptions(${libsh_name}) set_property(TARGET ${libsh_name} PROPERTY OUTPUT_NAME "${libsh_name_decorated}") - target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib JKQTMathTextSharedLib) + target_link_libraries(${libsh_name} PUBLIC JKQTCommonSharedLib JKQTCommonStatisticsAndMathSharedLib JKQTMathTextSharedLib) target_compile_definitions(${libsh_name} PUBLIC JKQTPLOTTER_LIB_IN_DLL) target_compile_definitions(${libsh_name} PRIVATE JKQTPLOTTER_LIB_EXPORT_LIBRARY) set_target_properties(${libsh_name} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS "ON") @@ -250,7 +250,7 @@ if(JKQtPlotter_BUILD_STATIC_LIBS) add_library(${lib_name} STATIC ${SOURCES_BASE} ${SOURCES_GRAPHS} ${SOURCES_GUI} ${RESOURCES} ${HEADERS_BASE} ${HEADERS_GRAPHS} ${HEADERS_GUI}) JKQtPlottter_setDefaultLibOptions(${lib_name}) set_property(TARGET ${lib_name} PROPERTY OUTPUT_NAME "${lib_name_decorated}") - target_link_libraries(${lib_name} PUBLIC JKQTCommonLib JKQTMathTextLib) + target_link_libraries(${lib_name} PUBLIC JKQTCommonLib JKQTCommonStatisticsAndMathLib JKQTMathTextLib) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${lib_name}Version.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY AnyNewerVersion ) diff --git a/lib/jkqtplotter/graphs/jkqtpparsedfunction.h b/lib/jkqtplotter/graphs/jkqtpparsedfunction.h index f7b27d0e78..b011a508da 100644 --- a/lib/jkqtplotter/graphs/jkqtpparsedfunction.h +++ b/lib/jkqtplotter/graphs/jkqtpparsedfunction.h @@ -25,7 +25,7 @@ #include #include #include "jkqtplotter/jkqtptools.h" -#include "jkqtcommon/jkqtpmathparser.h" +#include "jkqtcommon_statistics_and_math/jkqtpmathparser.h" #include "jkqtplotter/jkqtplotter_imexport.h" #include "jkqtplotter/graphs/jkqtpevaluatedfunction.h" diff --git a/lib/jkqtplotter/graphs/jkqtpstatisticsadaptors.h b/lib/jkqtplotter/graphs/jkqtpstatisticsadaptors.h index 9db1136a4e..ceb14fce0d 100644 --- a/lib/jkqtplotter/graphs/jkqtpstatisticsadaptors.h +++ b/lib/jkqtplotter/graphs/jkqtpstatisticsadaptors.h @@ -23,7 +23,7 @@ #include "jkqtplotter/jkqtplotter_imexport.h" -#include "jkqtcommon/jkqtpstatisticstools.h" +#include "jkqtcommon_statistics_and_math/jkqtpstatisticstools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" #include "jkqtplotter/jkqtpgraphsbase.h" #include "jkqtplotter/jkqtpgraphsbaseerrors.h" diff --git a/lib/jkqtplotter/jkqtptools.h b/lib/jkqtplotter/jkqtptools.h index e52ddca302..5843da2824 100644 --- a/lib/jkqtplotter/jkqtptools.h +++ b/lib/jkqtplotter/jkqtptools.h @@ -47,7 +47,7 @@ #include "jkqtcommon/jkqtpstringtools.h" #include "jkqtcommon/jkqtpdebuggingtools.h" #include "jkqtcommon/jkqtpmathtools.h" -#include "jkqtcommon/jkqtpalgorithms.h" +#include "jkqtcommon_statistics_and_math/jkqtpalgorithms.h" #include "jkqtcommon/jkqtpcodestructuring.h" diff --git a/lib/jkqtplotter/private/jkqtplotter_precomp.h b/lib/jkqtplotter/private/jkqtplotter_precomp.h index 2bb33f49ab..9155f10210 100644 --- a/lib/jkqtplotter/private/jkqtplotter_precomp.h +++ b/lib/jkqtplotter/private/jkqtplotter_precomp.h @@ -23,7 +23,9 @@ You should have received a copy of the GNU Lesser General Public License (LGPL) along with this program. If not, see . */ -#define _USE_MATH_DEFINES +#ifndef _USE_MATH_DEFINES +# define _USE_MATH_DEFINES +#endif #include "jkqtcommon/jkqtpbasicimagetools.h" #include "jkqtcommon/jkqtpcodestructuring.h" diff --git a/qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro b/qmake/sharedlib/jkqtcommonlib/jkqtcommonlib.pro similarity index 71% rename from qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro rename to qmake/sharedlib/jkqtcommonlib/jkqtcommonlib.pro index fee6a824b1..ed747cec2f 100644 --- a/qmake/sharedlib/jkqtpcommonlib/jkqtpcommonlib.pro +++ b/qmake/sharedlib/jkqtcommonlib/jkqtcommonlib.pro @@ -1,7 +1,7 @@ # uncomment this line to prevent linking in of the XITS fonts #DEFINES += NO_XITS_FONTS -TARGET = jkqtpcommonlib -CONFIG (debug, debug|release): TARGET = jkqtplotterlib_debug +TARGET = jkqtcommonlib +CONFIG (debug, debug|release): TARGET = jkqtcommonlib_debug TEMPLATE = lib CONFIG += dll @@ -12,7 +12,5 @@ win32 { DEFINES += JKQTCOMMON_LIB_EXPORT_LIBRARY } -include(../../../lib/jkqtpcommon.pri) - win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/sharedlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro b/qmake/sharedlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro new file mode 100644 index 0000000000..5f343903db --- /dev/null +++ b/qmake/sharedlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro @@ -0,0 +1,18 @@ +# uncomment this line to prevent linking in of the XITS fonts +#DEFINES += NO_XITS_FONTS +TARGET = jkqtcommonstatisticsandmathlib +CONFIG (debug, debug|release): TARGET = jkqtcommonstatisticsandmathlib_debug + +TEMPLATE = lib +CONFIG += dll +CONFIG += create_prl + +win32 { + DEFINES += JKQTCOMMON_STATISTICS_AND_MATH_LIB_IN_DLL + DEFINES += JKQTCOMMON_STATISTICS_AND_MATH_LIB_EXPORT_LIBRARY +} + +include(../../../lib/jkqtcommon.pri) + +win32-msvc*: DEFINES += _USE_MATH_DEFINES +win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro b/qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro index 39806e569a..55737c3e62 100644 --- a/qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro +++ b/qmake/sharedlib/jkqtfastplotterlib/jkqtfastplotterlib.pro @@ -13,7 +13,7 @@ win32 { } include(../../../lib/jkqtfastplotter.pri) -include(../../../lib/jkqtpcommon.pri) +include(../../../lib/jkqtcommon.pri) win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro b/qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro index 116363c5ec..674bdfa4a8 100644 --- a/qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro +++ b/qmake/sharedlib/jkqtmathtextlib/jkqtmathtextlib.pro @@ -13,7 +13,7 @@ win32 { } include(../../../lib/jkqtmathtext.pri) -include(../../../lib/jkqtpcommon.pri) +include(../../../lib/jkqtcommon.pri) win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro b/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro index a16bce8816..47ab7e5131 100644 --- a/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro +++ b/qmake/sharedlib/jkqtplotterlib/jkqtplotterlib.pro @@ -16,10 +16,11 @@ win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX -include(../../../lib/jkqtplotter.pri) -include(../../../lib/jkqtpcommon.pri) +include(../../../lib/jkqtcommon.pri) +include(../../../lib/jkqtcommon_statistics_and_math.pri) include(../../../lib/jkqtmathtext.pri) include(../../../lib/jkqtfastplotter.pri) +include(../../../lib/jkqtplotter.pri) include(../../../lib/jkqtplotter_pch.pri) diff --git a/qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro b/qmake/staticlib/jkqtcommonlib/jkqtcommonlib.pro similarity index 63% rename from qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro rename to qmake/staticlib/jkqtcommonlib/jkqtcommonlib.pro index 4f75d56276..cd9f589c49 100644 --- a/qmake/staticlib/jkqtpcommonlib/jkqtpcommonlib.pro +++ b/qmake/staticlib/jkqtcommonlib/jkqtcommonlib.pro @@ -1,13 +1,11 @@ # uncomment this line to prevent linking in of the XITS fonts #DEFINES += NO_XITS_FONTS -TARGET = jkqtpcommonlib -CONFIG (debug, debug|release): TARGET = jkqtmathtextlib_debug +TARGET = jkqtcommonlib +CONFIG (debug, debug|release): TARGET = jkqtcommonlib_debug TEMPLATE = lib CONFIG += staticlib CONFIG += create_prl -include(../../../lib/jkqtpcommon.pri) - win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/staticlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro b/qmake/staticlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro new file mode 100644 index 0000000000..825bae44f1 --- /dev/null +++ b/qmake/staticlib/jkqtcommonstatisticsandmathlib/jkqtcommonstatisticsandmathlib.pro @@ -0,0 +1,13 @@ +# uncomment this line to prevent linking in of the XITS fonts +#DEFINES += NO_XITS_FONTS +TARGET = jkqtcommonstatisticsandmathlib +CONFIG (debug, debug|release): TARGET = jkqtcommonstatisticsandmathlib_debug + +TEMPLATE = lib +CONFIG += staticlib +CONFIG += create_prl + +include(../../../lib/jkqtcommon.pri) + +win32-msvc*: DEFINES += _USE_MATH_DEFINES +win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro b/qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro index e9b0de59d3..2b619b9825 100644 --- a/qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro +++ b/qmake/staticlib/jkqtfastplotterlib/jkqtfastplotterlib.pro @@ -8,7 +8,7 @@ CONFIG+=staticlib CONFIG += create_prl include(../../../lib/jkqtfastplotter.pri) -include(../../../lib/jkqtpcommon.pri) +include(../../../lib/jkqtcommon.pri) win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro b/qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro index e952c5c45d..051d0413c1 100644 --- a/qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro +++ b/qmake/staticlib/jkqtmathtextlib/jkqtmathtextlib.pro @@ -8,7 +8,7 @@ CONFIG += staticlib CONFIG += create_prl include(../../../lib/jkqtmathtext.pri) -include(../../../lib/jkqtpcommon.pri) +include(../../../lib/jkqtcommon.pri) win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX diff --git a/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro b/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro index 3bfd2e05ca..b2fce03e0e 100644 --- a/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro +++ b/qmake/staticlib/jkqtplotterlib/jkqtplotterlib.pro @@ -9,10 +9,11 @@ CONFIG += create_prl #DEFINES += JKQTBP_AUTOTIMER -include(../../../lib/jkqtpcommon.pri) -include(../../../lib/jkqtplotter.pri) +include(../../../lib/jkqtcommon.pri) +include(../../../lib/jkqtcommon_statistics_and_math.pri) include(../../../lib/jkqtmathtext.pri) include(../../../lib/jkqtfastplotter.pri) +include(../../../lib/jkqtplotter.pri) win32-msvc*: DEFINES += _USE_MATH_DEFINES win32-msvc*: DEFINES += NOMINMAX