Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kthohr/gcem
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.13.1
Choose a base ref
...
head repository: kthohr/gcem
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 1,778 additions and 455 deletions.
  1. +3 −39 .appveyor.yml
  2. +158 −0 .github/workflows/main.yml
  3. +6 −3 .readthedocs.requirements.txt
  4. +10 −5 .readthedocs.yml
  5. +23 −76 CMakeLists.txt
  6. +1 −1 NOTICE.txt
  7. +9 −11 README.md
  8. +1 −1 cmake_files/gcemConfig.cmake.in
  9. +9 −3 docs/environment.yml
  10. +1 −1 docs/source/api/algorithms.rst
  11. +25 −1 docs/source/api/basic_functions.rst
  12. +1 −1 docs/source/api/hyperbolic_functions.rst
  13. +13 −1 docs/source/api/math_index.rst
  14. +1 −1 docs/source/api/special_functions.rst
  15. +1 −1 docs/source/api/trigonometric_functions.rst
  16. +2 −2 docs/source/conf.py
  17. +1 −1 docs/source/examples.rst
  18. +6 −6 docs/source/index.rst
  19. +12 −6 include/gcem.hpp
  20. +2 −2 include/gcem_incl/abs.hpp
  21. +3 −3 include/gcem_incl/acos.hpp
  22. +2 −2 include/gcem_incl/acosh.hpp
  23. +3 −3 include/gcem_incl/asin.hpp
  24. +2 −2 include/gcem_incl/asinh.hpp
  25. +75 −13 include/gcem_incl/atan.hpp
  26. +3 −3 include/gcem_incl/atan2.hpp
  27. +3 −3 include/gcem_incl/atanh.hpp
  28. +1 −1 include/gcem_incl/beta.hpp
  29. +1 −1 include/gcem_incl/binomial_coef.hpp
  30. +51 −3 include/gcem_incl/ceil.hpp
  31. +1 −1 include/gcem_incl/copysign.hpp
  32. +6 −6 include/gcem_incl/cos.hpp
  33. +2 −2 include/gcem_incl/cosh.hpp
  34. +54 −6 include/gcem_incl/erf.hpp
  35. +3 −3 include/gcem_incl/erf_inv.hpp
  36. +32 −8 include/gcem_incl/exp.hpp
  37. +1 −1 include/gcem_incl/expm1.hpp
  38. +40 −0 include/gcem_incl/fabs.hpp
  39. +40 −0 include/gcem_incl/fabsf.hpp
  40. +40 −0 include/gcem_incl/fabsl.hpp
  41. +18 −16 include/gcem_incl/factorial.hpp
  42. +14 −4 include/gcem_incl/find_exponent.hpp
  43. +1 −1 include/gcem_incl/find_fraction.hpp
  44. +1 −1 include/gcem_incl/find_whole.hpp
  45. +51 −3 include/gcem_incl/floor.hpp
  46. +1 −1 include/gcem_incl/fmod.hpp
  47. +1 −1 include/gcem_incl/gcd.hpp
  48. +31 −4 include/gcem_incl/gcem_options.hpp
  49. +90 −0 include/gcem_incl/hypot.hpp
  50. +2 −2 include/gcem_incl/incomplete_beta.hpp
  51. +6 −6 include/gcem_incl/incomplete_beta_inv.hpp
  52. +3 −3 include/gcem_incl/incomplete_gamma.hpp
  53. +4 −4 include/gcem_incl/incomplete_gamma_inv.hpp
  54. +88 −0 include/gcem_incl/inv_sqrt.hpp
  55. +1 −1 include/gcem_incl/is_even.hpp
  56. +1 −1 include/gcem_incl/is_finite.hpp
  57. +1 −1 include/gcem_incl/is_inf.hpp
  58. +1 −1 include/gcem_incl/is_nan.hpp
  59. +1 −1 include/gcem_incl/is_odd.hpp
  60. +1 −1 include/gcem_incl/lbeta.hpp
  61. +1 −1 include/gcem_incl/lcm.hpp
  62. +3 −3 include/gcem_incl/lgamma.hpp
  63. +1 −1 include/gcem_incl/lmgamma.hpp
  64. +45 −6 include/gcem_incl/log.hpp
  65. +59 −0 include/gcem_incl/log10.hpp
  66. +1 −1 include/gcem_incl/log1p.hpp
  67. +5 −19 include/gcem_incl/log2.hpp
  68. +1 −1 include/gcem_incl/log_binomial_coef.hpp
  69. +3 −3 include/gcem_incl/mantissa.hpp
  70. +1 −1 include/gcem_incl/max.hpp
  71. +1 −1 include/gcem_incl/min.hpp
  72. +1 −1 include/gcem_incl/neg_zero.hpp
  73. +1 −1 include/gcem_incl/pow.hpp
  74. +1 −1 include/gcem_incl/pow_integral.hpp
  75. +1 −1 include/gcem_incl/quadrature/gauss_legendre_30.hpp
  76. +1 −1 include/gcem_incl/quadrature/gauss_legendre_50.hpp
  77. +56 −4 include/gcem_incl/round.hpp
  78. +1 −1 include/gcem_incl/sgn.hpp
  79. +1 −1 include/gcem_incl/signbit.hpp
  80. +6 −6 include/gcem_incl/sin.hpp
  81. +2 −2 include/gcem_incl/sinh.hpp
  82. +31 −12 include/gcem_incl/sqrt.hpp
  83. +3 −3 include/gcem_incl/tan.hpp
  84. +26 −2 include/gcem_incl/tanh.hpp
  85. +4 −4 include/gcem_incl/tgamma.hpp
  86. +51 −3 include/gcem_incl/trunc.hpp
  87. +13 −53 tests/CMakeLists.txt
  88. +18 −0 tests/Makefile
  89. +1 −1 tests/abs.cpp
  90. +1 −1 tests/acos.cpp
  91. +1 −1 tests/acosh.cpp
  92. +1 −1 tests/asin.cpp
  93. +1 −1 tests/asinh.cpp
  94. +9 −1 tests/atan.cpp
  95. +1 −1 tests/atan2.cpp
  96. +1 −1 tests/atanh.cpp
  97. +1 −1 tests/binomial_coef.cpp
  98. +1 −1 tests/copysign.cpp
  99. +1 −1 tests/cos.cpp
  100. +1 −1 tests/cosh.cpp
  101. +7 −0 tests/cov_check
  102. +13 −4 tests/erf.cpp
  103. +3 −1 tests/erf_inv.cpp
  104. +2 −1 tests/exp.cpp
  105. +1 −1 tests/expm1.cpp
  106. +71 −0 tests/fabs.cpp
  107. +51 −0 tests/fabsf.cpp
  108. +64 −0 tests/fabsl.cpp
  109. +3 −1 tests/factorial.cpp
  110. +1 −1 tests/fmod.cpp
  111. +1 −1 tests/gcd.cpp
  112. +2 −1 tests/gcem_tests.hpp
  113. +75 −0 tests/hypot.cpp
  114. +1 −1 tests/incomplete_beta.cpp
  115. +1 −1 tests/incomplete_beta_inv.cpp
  116. +3 −1 tests/incomplete_gamma.cpp
  117. +1 −1 tests/incomplete_gamma_inv.cpp
  118. +57 −0 tests/inv_sqrt.cpp
  119. +1 −1 tests/is_odd.cpp
  120. +1 −1 tests/lcm.cpp
  121. +1 −1 tests/lgamma.cpp
  122. +8 −1 tests/log.cpp
  123. +50 −0 tests/log10.cpp
  124. +1 −1 tests/log1p.cpp
  125. +3 −1 tests/log2.cpp
  126. +1 −1 tests/log_binomial_coef.cpp
  127. +1 −1 tests/other.cpp
  128. +2 −1 tests/pow.cpp
  129. +13 −1 tests/rounding.cpp
  130. +1 −3 tests/signbit.cpp
  131. +1 −1 tests/sin.cpp
  132. +1 −1 tests/sinh.cpp
  133. +10 −2 tests/sqrt.cpp
  134. +1 −1 tests/tan.cpp
  135. +1 −1 tests/tanh.cpp
  136. +1 −1 tests/tgamma.cpp
42 changes: 3 additions & 39 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -25,44 +25,8 @@ install:
- conda install cmake -c conda-forge
- cmake -G "NMake Makefiles" -D GCEM_BUILD_TESTS=1 -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\LIBRARY -D CMAKE_BUILD_TYPE=Release .
- nmake gcem_tests
- cd tests

build_script:
- .\abs.test
- .\acos.test
- .\acosh.test
- .\asin.test
- .\asinh.test
- .\atan.test
- .\atan2.test
- .\atanh.test
- .\binomial_coef.test
- .\copysign.test
- .\cos.test
- .\cosh.test
- .\erf.test
- .\erf_inv.test
- .\exp.test
- .\expm1.test
- .\factorial.test
- .\gcd.test
- .\incomplete_beta.test
- .\incomplete_beta_inv.test
- .\incomplete_gamma.test
- .\incomplete_gamma_inv.test
- .\is_odd.test
- .\lcm.test
- .\lgamma.test
- .\log.test
- .\log1p.test
- .\log_binomial_coef.test
- .\other.test
- .\pow.test
- .\rounding.test
- .\signbit.test
- .\sin.test
- .\sinh.test
- .\sqrt.test
- .\tan.test
- .\tanh.test
- .\tgamma.test
- cd tests
- cmd: dir
- cmd: for %%f in (*.test.exe) do ( echo %%~nf && .\%%~nf )
158 changes: 158 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@

# modified version of:
# https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60

name: CI

on: [push, pull_request, release]

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

strategy:
fail-fast: false
matrix:
config:
- {
name: "ubuntu_latest_gcc_cxx11",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc",
cxx: "g++",
cxxstd: "11"
}
- {
name: "ubuntu_latest_gcc_cxx11_coverage",
os: ubuntu-latest,
build_type: "Coverage",
cc: "gcc",
cxx: "g++",
cxxstd: "11"
}
- {
name: "ubuntu_latest_gcc9_cxx14",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-9",
cxx: "g++-9",
cxxstd: "14"
}
- {
name: "ubuntu_latest_gcc10_cxx14",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-10",
cxx: "g++-10",
cxxstd: "14"
}
- {
name: "ubuntu_latest_gcc11_cxx17",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-11",
cxx: "g++-11",
cxxstd: "17"
}
- {
name: "ubuntu_latest_gcc11_cxx20",
os: ubuntu-latest,
build_type: "Release",
cc: "gcc-11",
cxx: "g++-11",
cxxstd: "20"
}
- {
name: "ubuntu_latest_clang11_cxx11",
os: ubuntu-latest,
build_type: "Release",
cc: "clang-11",
cxx: "clang++-11",
cxxstd: "11"
}
- {
name: "ubuntu_latest_clang11_cxx14",
os: ubuntu-latest,
build_type: "Release",
cc: "clang-11",
cxx: "clang++-11",
cxxstd: "14"
}
- {
name: "ubuntu_latest_clang12_cxx14",
os: ubuntu-latest,
build_type: "Release",
cc: "clang-12",
cxx: "clang++-12",
cxxstd: "14"
}
- {
name: "ubuntu22_clang13_cxx17",
os: ubuntu-22.04,
build_type: "Release",
cc: "clang-13",
cxx: "clang++-13",
cxxstd: "17"
}
- {
name: "ubuntu22_clang14_cxx20",
os: ubuntu-22.04,
build_type: "Release",
cc: "clang-14",
cxx: "clang++-14",
cxxstd: "20"
}
- {
name: "macos_latest_clang_cxx11",
os: macos-latest,
build_type: "Release",
cc: "clang",
cxx: "clang++",
cxxstd: "11"
}

steps:
- uses: actions/checkout@v2

- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install ${{ matrix.config.cc }} ${{ matrix.config.cxx }}
${{ matrix.config.cc }} --version
echo "CXXT=${{ matrix.config.cxxstd }}" >> $GITHUB_ENV
- name: Tests
shell: bash
working-directory: tests
run: |
export CC=${{ matrix.config.cc }}
export CXX=${{ matrix.config.cxx }}
export GCEM_CXX_STD="-std=c++${{ matrix.config.cxxstd }}"
echo "Testing CXXT: ${CXXT}"
echo "Testing env.CXXT: ${{ env.CXXT }}"
make
./run_tests
- name: Coverage
if: startsWith(matrix.config.build_type, 'Coverage')
shell: bash
working-directory: tests
run: |
export SHOULD_RUN_COVERAGE="y"
./cov_check
cd ..
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov
9 changes: 6 additions & 3 deletions .readthedocs.requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
sphinx == 2.4.4
breathe == 4.11.0
sphinxcontrib-katex == 0.6.0
sphinx == 5.1.1
breathe == 4.34.0
sphinx-rtd-theme == 1.0.0
sphinxcontrib-katex == 0.8.6
sphinxcontrib-contentui == 0.2.5
docutils == 0.17.1
15 changes: 10 additions & 5 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
requirements_file: .readthedocs.requirements.txt
version: 2

# conda:
# file: docs/environment.yml
build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"

python:
version: 3.6
formats:
- pdf

conda:
environment: docs/environment.yml
99 changes: 23 additions & 76 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
################################################################################
##
## Copyright (C) 2016-2020 Keith O'Hara
## Copyright (C) 2016-2024 Keith O'Hara
##
## This file is part of the GCE-Math C++ library.
##
@@ -21,7 +21,7 @@
cmake_minimum_required(VERSION 3.1)
project(gcem)

set(GCEM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
set(GCEM_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include)

#

@@ -40,92 +40,41 @@ message(STATUS "GCE-Math version ${${PROJECT_NAME}_VERSION}")

#

set(GCEM_HEADERS
${GCEM_INCLUDE_DIR}/gcem.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/abs.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/acos.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/acosh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/asin.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/asinh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/atan.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/atan2.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/atanh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/beta.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/binomial_coef.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/ceil.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/copysign.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/cos.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/cosh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/erf_inv.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/erf.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/exp.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/expm1.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/factorial.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/find_exponent.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/find_fraction.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/find_whole.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/floor.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/fmod.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/gcd.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/gcem_options.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/incomplete_beta.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/incomplete_beta_inv.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/incomplete_gamma.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/incomplete_gamma_inv.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/is_even.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/is_odd.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/is_inf.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/is_nan.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/is_finite.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/lbeta.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/lcm.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/lgamma.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/lmgamma.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/log_binomial_coef.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/log.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/log1p.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/log2.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/mantissa.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/max.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/min.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/neg_zero.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/pow_integral.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/pow.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/quadrature/gauss_legendre_30.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/quadrature/gauss_legendre_50.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/round.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/signbit.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/sgn.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/sin.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/sinh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/sqrt.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/tan.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/tanh.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/tgamma.hpp
${GCEM_INCLUDE_DIR}/gcem_incl/trunc.hpp
)
if(NOT MSVC)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)

if(COMPILER_SUPPORTS_CXX11)
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has C++11 support.")
else()
message(FATAL_ERROR "Unsupported compiler ${CMAKE_CXX_COMPILER} "
"GCEM requires a C++11-compatible compiler.")
endif()
endif()

#
# options. enable using cmake3 -DGCEM_BUILD_TESTS=ON

OPTION(GCEM_BUILD_TESTS "gcem test suite" OFF)

# install

add_library(gcem INTERFACE)
target_include_directories(gcem INTERFACE $<BUILD_INTERFACE:${GCEM_INCLUDE_DIR}>
$<INSTALL_INTERFACE:include>)

OPTION(GCEM_BUILD_TESTS "gcem test suite" OFF)

if(GCEM_BUILD_TESTS)
add_subdirectory(tests)
endif()

#

include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

install(TARGETS gcem
EXPORT ${PROJECT_NAME}-targets)

#
install(
TARGETS gcem
EXPORT ${PROJECT_NAME}-targets
)

export(EXPORT ${PROJECT_NAME}-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
@@ -141,8 +90,6 @@ configure_package_config_file(cmake_files/${PROJECT_NAME}Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${GCEM_CMAKECONFIG_INSTALL_DIR})

#

write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY SameMajorVersion)
2 changes: 1 addition & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GCE-Math: A C++ generalized constant expression-based math library
Copyright 2016-2020 Keith O'Hara
Copyright 2016-2024 Keith O'Hara

This product includes software developed by Keith O'Hara (http://www.kthohr.com)
Loading