CML - The Configurable Math Library

Overview

Configurable Math Library

For CML version 1, please see https://github.com/demianmnave/CML1.

License

The Configurable Math Library (CML) is released under the Boost Software License, Version 1.0..

Status

Build status Build Status

Using the CML

As it is header-only, it is simple enough to copy the cml header directory into your project and setup your build to reference it. Users of CMake 3.15+ can also leverage cmake --install ... and find_package(CML CONFIG) to integrate CML into a CMake project.

Compiler requirements

At the moment, the CML requires the following compiler features (listed as CMake target_compile_features(...) flags here):

Running Tests

To run the test suite from a command prompt using a Makefile-like generator, start in your build directory and execute:

cmake . -G<generator name> -DCML_BUILD_TESTING=On -DCML_BUILD_TYPE=RELEASE

Then, to build the tests (again from your build directory):

cmake --build . --config Release

You can run the full test suite from your build directory by executing:

ctest -C Release

If you have multiple CPUs (e.g. 4 in this case), you can speed things up a bit using, for example:

cmake --build . --config Release -- -j4

ctest -C Release -j4

See .travis.yml for supported XCode, Clang, and GCC versions, and .appveyor.yml for supported Visual Studio versions.

Comments
  • Tidy up CMakeLists.txt

    Tidy up CMakeLists.txt

    CMakeLists.txt should be cleaned up using more modern CMake functionality, including adding installation support for easier vcpkg integration (#22) and adding relevant target_compile_features(...) (#29).

    enhancement 
    opened by demianmnave 1
  • Tidy up .appveyor.yml

    Tidy up .appveyor.yml

    The AppVeyor configuration should be modified to use the Ninja generator for CMake going forward, as this will greatly simplify the YAML, and Ninja is more efficient than using Visual Studio directly.

    It's possible that vcvars64.bat may need to be called to ensure Visual Studio 2017 builds use the x64 toolset.

    enhancement 
    opened by demianmnave 1
  • Use __cpp* directives to require features in compiler.h

    Use __cpp* directives to require features in compiler.h

    Rather than rely on macros in compiler.h for feature requirements, use __cpp_* preprocessor directives to detect requirements, and error when not met.

    Support for these directives requires a recent compiler. See .appveyor.yml for the current list.

    Replaces issue #28.

    enhancement 
    opened by demianmnave 1
  • Clarify that compiler.h macros are not in the public interface

    Clarify that compiler.h macros are not in the public interface

    compiler.h has no annotations or comments to make it clear that the macros in the file are for internal use only. This is confusing, and can lead to unexpected broken builds (e.g. due to removing CML_CONSTEXPR in a previous commit).

    bug enhancement wontfix 
    opened by demianmnave 1
  • Use __has_feature(...) when building with Clang

    Use __has_feature(...) when building with Clang

    compiler.h should be updated to use __has_feature() when building with Clang. This should help work around AppleClang/normal Clang version ambiguities.

    enhancement 
    opened by demianmnave 1
  • Support structured binding of fixed-size vectors

    Support structured binding of fixed-size vectors

    It would be useful to support C++17 structured binding to the elements of a fixed-size cml::vector<>. For example:

    auto [x,y,z] = cml::vector3d(1.,2.,3.);
    

    should yield

    x = 1.
    y = 2.
    z = 3.
    
    enhancement 
    opened by demianmnave 1
  • Work around VS2015 parameter pack weirdness

    Work around VS2015 parameter pack weirdness

    VS2015 doesn't like passing parameter packs to non-packed arguments, which affects rebind_alloc in particular. The quick fix is to cater to the common case of a single rebind argument.

    bug 
    opened by demianmnave 0
  • Unnecessary requirement of rvalue-from-this for fixed-length external vectors

    Unnecessary requirement of rvalue-from-this for fixed-length external vectors

    The default constructor for fixed<..., external> is disabled if the compiler does not support rvalue-ref-from-this. This is too strict, however, and prevents creating arrays of external<> vectors when compiling with e.g. VS2013.

    bug 
    opened by demianmnave 0
  • Catch epsilon() values are too large after switch from Boost.UTF

    Catch epsilon() values are too large after switch from Boost.UTF

    Approx().epsilon(e) from Catch interprets e differently from the tolerance T in BOOST_CHECK_CLOSE(...). In particular, e is interpreted as maximum relative difference, whereas T is interpreted as relative error. e effectively tolerances the number of significant digits, and therefore tests must be updated to use a smaller value, in general.

    bug enhancement 
    opened by demianmnave 0
  • Eliminate Boost.UTF dependency

    Eliminate Boost.UTF dependency

    From CML1 created by demianmnave : demianmnave/CML1#8

    Use CATCH instead of the Boost.UTF for the test rig. This will simplify user requirements, as well as reduce the complexity of the AppVeyor and Travis CI configurations.

    enhancement 
    opened by demianmnave 0
  • Update CML2 to build against clang 3.6 and 3.7, as well as XCode 7.0

    Update CML2 to build against clang 3.6 and 3.7, as well as XCode 7.0

    From CML1 created by demianmnave : demianmnave/CML1#6

    CML2 is not tested for XCode, but should at least be made to recognize clang 3.6 and 3.7, as well as XCode versions that match particular clang versions, starting with XCode 7.0. The XCode CI support offered by Travis CI may be a big help for this task.

    • [x] Build against clang 3.6 (also use Travis CI?)
    • [x] Build against clang 3.7 (also use Travis CI?)
    • [x] Setup Travis CI to build CML2 against XCode 7.3

    Requested by: @Segmented See also: #5

    bug enhancement 
    opened by demianmnave 0
  • Remove extraneous #ifdef's

    Remove extraneous #ifdef's

    New compiler support requirements obviate the need for most feature macros (see README.md and target_compile_features(...) in CML.cmake):

    CML_HAS_DEFAULTED_MOVE_CONSTRUCTOR
    CML_HAS_MSVC_BRAIN_DEAD_ASSIGNMENT_OVERLOADS
    CML_HAS_MSVC_WONKY_PARAMETER_PACK
    CML_HAS_RVALUE_REFERENCE_FROM_THIS
    

    Removing the #ifdef blocks associated with these macros will greatly simplify the code.

    enhancement 
    opened by demianmnave 0
  • CML matrix multiplication is terribly inefficient

    CML matrix multiplication is terribly inefficient

    CML matrix multiplication is based on naive algorithm which does not take into account any cache memory optimizations. As the result matrix multiplications becomes bottleneck in any real-world applications using CML. It would be nice to implement at least some memory optimizations (https://gist.github.com/nadavrot/5b35d44e8ba3dd718e595e40184d03f0). Also it would be great to use SIMD intrinsics (https://codereview.stackexchange.com/questions/101144/simd-matrix-multiplication) if not too hard to implement in template code.

    enhancement 
    opened by egorodet 3
  • Add return value versions of mathlib functions

    Add return value versions of mathlib functions

    From CML1 created by demianmnave : demianmnave/CML1#11

    In addition to this:

    matrix44f_r m; 
    matrix_rotation_world_x(m, angle); 
    

    support this:

    auto m = matrix_rotation_world_x(angle);
    

    This should be fast (enough) with current compilers.

    enhancement 
    opened by demianmnave 0
  • Implement matrix construction from an initializer list of initializer lists, if possible

    Implement matrix construction from an initializer list of initializer lists, if possible

    From CML1 created by demianmnave : demianmnave/CML1#4

    Constructing a matrix using initializer_list syntax would be natural and pretty convenient, e.g.:

    matrix33d M({ { 1., 2., 3. }, { 4., 5., 6. }, { 7., 8., 9. } });

    or

    matrixd M = { { 1., 2., 3. }, { 4., 5., 6. }, { 7., 8., 9. } };

    enhancement 
    opened by demianmnave 0
Releases(v2.2.1)
  • v2.2.1(May 15, 2021)

  • v2.2.0(May 15, 2021)

    bug

    • [bug] source_group() settings are wrong for non-IDE builds #27

    closed

    • [closed] Update to Catch2 2.13.4 #26

    enhancement

    • [enhancement] Tidy up CMakeLists.txt #31
    • [enhancement] Tidy up .appveyor.yml #30
    • [enhancement] Use __cpp* directives to require features in compiler.h #29
    • [enhancement] Consider using CMake compiler features instead of hand-rolled "compiler.h" #23
    • [enhancement] Add support for CML as a CMake interface library #21
    Source code(tar.gz)
    Source code(zip)
  • v2.1.2(Jul 12, 2018)

    bug

    • [bug] Unnecessary requirement of rvalue-from-this for fixed-length external vectors #15

    enhancement

    • [enhancement] Implement vector and matrix fill() functions #16
    • [enhancement] Implement equality and difference operators for matrices #14
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Apr 17, 2018)

    • [enhancement] Use __has_feature(...) when building with Clang #13
    • [bug] Implement matrix_hadamard_product1 test suite #12
    • [enhancement] Support structured binding of fixed-size vectors #11
    • [bug] Missing close brace? #10
    Source code(tar.gz)
    Source code(zip)
Randomized configurable bodies for Skyrim: Anniversary Edition

autoBody AE A SKSE Plugin for distributing CBBE and HIMBO presets throughout the gameworld Configurable through morphs.ini files (optionally created b

null 10 Sep 3, 2022
A configurable in-memory binary patcher.

?? Lyptus ?? A configurable in-memory binary patcher. ?? Usage Set up the Lyptus config with a list of patches to apply, and inject the Lyptus DLL int

null 15 Sep 30, 2022
Fast glsl deNoise spatial filter, with circular gaussian kernel, full configurable

glslSmartDeNoise Fast glsl spatial deNoise filter, with circular gaussian kernel and smart/flexible/adaptable -> full configurable: Standard Deviation

Michele Morrone 200 Sep 15, 2022
Defold Math eXtention Library that avoids allocations

A re-imagining of vmath functions that avoid allocations by taking the output as the first argument instead of returning a new Vector3, Vector4, or Quat requiring an allocation.

Justin Walsh 8 Sep 1, 2022
official repository of the muparser fast math parser library

muparser - Fast Math Parser 2.3.3 (Prerelease) To read the full documentation please go to: http://beltoforion.de/en/muparser. See Install.txt for ins

Ingo Berg 288 Oct 2, 2022
Generic Math Template Library

Generic Math Template Library

IMVU, Inc 19 Jul 29, 2022
Highly efficent, caching, copy-on-write lua vector math library

lua-vec Table constructions in Lua are expensive, creating and destroying thousands of "vector" tables frame to frame in an engine can cause serious p

Dale Weiler 4 Jul 23, 2022
Solve 20 simple math questions and see how accurate/fast you are!

Math-Quiz Solve 20 simple math questions and see how accurate/fast you are! Want to try? Clone this repository $ git clone https://github.com/Mini-War

Mini Ware 8 Sep 11, 2022
SSD1306 library and simple graphics core library based on Adafruit GFX Library.

Raspberry Pico SSD1306 + GFX Library Based on Adafruit GFX Library https://github.com/adafruit/Adafruit-GFX-Library Usage Hardware Connect your SSD130

Marcin Bober 31 Sep 1, 2022
Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Libft is an individual project at 42 that requires us to re-create some standard C library functions including some additional ones that can be used later to build a library of useful functions for the rest of the program.

Paulo Rafael Ramalho 0 Apr 5, 2022
Samir Teymurov 1 Oct 6, 2021
F Graphics Library (FGL) is a small graphics C++ portable library for LCD displays on embedded systems

F Graphics Library (FGL) Full documentation: fgl.docsforge.com (By Filipe Chagas) F Graphics Library is a C++ library that I created for use in embedd

Filipe Chagas 8 Dec 14, 2021
Itpp - IT++ library mirror/fork. C++ library of mathematical, signal processing and communication classes and functions.

Introduction ************ IT++ is a C++ library of mathematical, signal processing and communication classes and functions. Its main use is in simula

null 18 Apr 9, 2022
2D physics header-only library for videogames developed in C using raylib library.

Physac Physac is a small 2D physics engine written in pure C. The engine uses a fixed time-step thread loop to simluate physics. A physics step contai

VĂ­ctor Fisac 229 Sep 22, 2022
This is a helper library to abstract away interfacing with floppy disk drives in a cross-platform and open source library.

Adafruit Floppy This is a helper library to abstract away interfacing with floppy disk drives in a cross-platform and open source library. Adafruit Fl

Adafruit Industries 130 Sep 28, 2022
`lv_lib_100ask` is a reference for various out of the box schemes based on lvgl library or an enhanced interface for various components of lvgl library.

Introduction lv_lib_100ask is a reference for various out of the box schemes based on lvgl library or an enhanced interface for various components of

100askTeam 23 Sep 22, 2022
QtVerbalExpressions - This Qt lib is based off of the C++ VerbalExpressions library. [MIT]

QtVerbalExpressions Qt Regular Expressions made easy This Qt lib is based off of the C++ VerbalExpressions library by whackashoe. Testing if we have a

null 56 Sep 7, 2022
A header-only library for C++(0x) that allows automagic pretty-printing of any container.

cxx-prettyprint =============== A pretty printing library for C++ containers. Synopsis: Simply by including this header-only library in your sourc

Louis Delacroix 532 Sep 15, 2022
A standalone and lightweight C library

Klib: a Generic Library in C Overview Klib is a standalone and lightweight C library distributed under MIT/X11 license. Most components are independen

Attractive Chaos 3.6k Oct 2, 2022