├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md └── include └── xsci └── xsci.hpp /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Compiled Static libraries 20 | *.lai 21 | *.la 22 | *.a 23 | *.lib 24 | 25 | # Executables 26 | *.exe 27 | *.out 28 | *.app 29 | 30 | # Vim tmp files 31 | *.swp 32 | 33 | # Build directory 34 | build/ 35 | 36 | # Test build artefacts 37 | test/test_xtl 38 | test/CMakeCache.txt 39 | test/Makefile 40 | test/CMakeFiles/ 41 | test/cmake_install.cmake 42 | 43 | # Documentation build artefacts 44 | docs/CMakeCache.txt 45 | docs/xml/ 46 | docs/build/ 47 | 48 | # Jupyter artefacts 49 | .ipynb_checkpoints/ 50 | 51 | # Generated files 52 | *.pc 53 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ############################################################################ 2 | # Copyright (c) 2017, Sylvain Corlay and Johan Mabille # 3 | # # 4 | # Distributed under the terms of the BSD 3-Clause License. # 5 | # # 6 | # The full license is in the file LICENSE, distributed with this software. # 7 | ############################################################################ 8 | 9 | cmake_minimum_required(VERSION 3.1) 10 | project(xtl) 11 | 12 | enable_testing() 13 | 14 | set(XTL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) 15 | 16 | # Versionning 17 | # =========== 18 | 19 | file(STRINGS "${XTL_INCLUDE_DIR}/xtl/xtl_config.hpp" xtl_version_defines 20 | REGEX "#define XTL_VERSION_(MAJOR|MINOR|PATCH)") 21 | foreach(ver ${xtl_version_defines}) 22 | if(ver MATCHES "#define XTL_VERSION_(MAJOR|MINOR|PATCH) +([^ ]+)$") 23 | set(XTL_VERSION_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" CACHE INTERNAL "") 24 | endif() 25 | endforeach() 26 | set(${PROJECT_NAME}_VERSION 27 | ${XTL_VERSION_MAJOR}.${XTL_VERSION_MINOR}.${XTL_VERSION_PATCH}) 28 | message(STATUS "xtl v${${PROJECT_NAME}_VERSION}") 29 | 30 | # Dependencies 31 | # ============ 32 | 33 | find_package(nlohmann_json QUIET) 34 | 35 | # Build 36 | # ===== 37 | 38 | set(XTL_HEADERS 39 | ${XTL_INCLUDE_DIR}/xtl/xany.hpp 40 | ${XTL_INCLUDE_DIR}/xtl/xbasic_fixed_string.hpp 41 | ${XTL_INCLUDE_DIR}/xtl/xbase64.hpp 42 | ${XTL_INCLUDE_DIR}/xtl/xclosure.hpp 43 | ${XTL_INCLUDE_DIR}/xtl/xcomplex.hpp 44 | ${XTL_INCLUDE_DIR}/xtl/xcomplex_sequence.hpp 45 | ${XTL_INCLUDE_DIR}/xtl/xspan.hpp 46 | ${XTL_INCLUDE_DIR}/xtl/xspan_impl.hpp 47 | ${XTL_INCLUDE_DIR}/xtl/xdynamic_bitset.hpp 48 | ${XTL_INCLUDE_DIR}/xtl/xfunctional.hpp 49 | ${XTL_INCLUDE_DIR}/xtl/xhash.hpp 50 | ${XTL_INCLUDE_DIR}/xtl/xhierarchy_generator.hpp 51 | ${XTL_INCLUDE_DIR}/xtl/xiterator_base.hpp 52 | ${XTL_INCLUDE_DIR}/xtl/xjson.hpp 53 | ${XTL_INCLUDE_DIR}/xtl/xmeta_utils.hpp 54 | ${XTL_INCLUDE_DIR}/xtl/xoptional.hpp 55 | ${XTL_INCLUDE_DIR}/xtl/xoptional_sequence.hpp 56 | ${XTL_INCLUDE_DIR}/xtl/xproxy_wrapper.hpp 57 | ${XTL_INCLUDE_DIR}/xtl/xsequence.hpp 58 | ${XTL_INCLUDE_DIR}/xtl/xtl_config.hpp 59 | ${XTL_INCLUDE_DIR}/xtl/xtype_traits.hpp 60 | ${XTL_INCLUDE_DIR}/xtl/xvariant.hpp 61 | ${XTL_INCLUDE_DIR}/xtl/xvariant_impl.hpp 62 | ) 63 | 64 | add_library(xtl INTERFACE) 65 | target_include_directories(xtl INTERFACE $ 66 | $) 67 | 68 | # xtl requires C++14 support! 69 | target_compile_features(xtl INTERFACE cxx_std_14) 70 | 71 | 72 | OPTION(BUILD_TESTS "xtl test suite" OFF) 73 | OPTION(DOWNLOAD_GTEST "build gtest from downloaded sources" OFF) 74 | 75 | if(DOWNLOAD_GTEST OR GTEST_SRC_DIR) 76 | set(BUILD_TESTS ON) 77 | endif() 78 | 79 | if(BUILD_TESTS) 80 | add_subdirectory(test) 81 | endif() 82 | 83 | # Installation 84 | # ============ 85 | 86 | include(GNUInstallDirs) 87 | include(CMakePackageConfigHelpers) 88 | 89 | install(TARGETS xtl 90 | EXPORT ${PROJECT_NAME}-targets) 91 | 92 | # Makes the project importable from the build directory 93 | export(EXPORT ${PROJECT_NAME}-targets 94 | FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") 95 | 96 | install(FILES ${XTL_HEADERS} 97 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xtl) 98 | 99 | set(XTL_CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE 100 | STRING "install path for xtlConfig.cmake") 101 | 102 | configure_package_config_file(${PROJECT_NAME}Config.cmake.in 103 | "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" 104 | INSTALL_DESTINATION ${XTL_CMAKECONFIG_INSTALL_DIR}) 105 | 106 | # xtl is header-only and does not depend on the architecture. 107 | # Remove CMAKE_SIZEOF_VOID_P from xtlConfigVersion.cmake so that an xtlConfig.cmake 108 | # generated for a 64 bit target can be used for 32 bit targets and vice versa. 109 | set(_XTL_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P}) 110 | unset(CMAKE_SIZEOF_VOID_P) 111 | write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake 112 | VERSION ${${PROJECT_NAME}_VERSION} 113 | COMPATIBILITY AnyNewerVersion) 114 | set(CMAKE_SIZEOF_VOID_P ${_XTL_CMAKE_SIZEOF_VOID_P}) 115 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake 116 | ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake 117 | DESTINATION ${XTL_CMAKECONFIG_INSTALL_DIR}) 118 | install(EXPORT ${PROJECT_NAME}-targets 119 | FILE ${PROJECT_NAME}Targets.cmake 120 | DESTINATION ${XTL_CMAKECONFIG_INSTALL_DIR}) 121 | 122 | configure_file(${PROJECT_NAME}.pc.in 123 | "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" 124 | @ONLY) 125 | install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" 126 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/") 127 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, QuantStack 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # xsci 2 | 3 | This is a barebones repository, intended to contain ported functions from the scientific python ecosystem. 4 | We are looking at scipy, scikit-image, scikit-learn and others. 5 | 6 | ## License 7 | 8 | We use a shared copyright model that enables all contributors to maintain the 9 | copyright on their contributions. 10 | 11 | This software is licensed under the BSD-3-Clause license. See the [LICENSE](LICENSE) file for details. 12 | -------------------------------------------------------------------------------- /include/xsci/xsci.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QuantStack/xsci/69a303282e4480a72039b470e95002e5c3955494/include/xsci/xsci.hpp --------------------------------------------------------------------------------