zetaml.documentation [index]


Welcome to the Official Zeta Maths Library Documentation

Summary

Zetaml is suitable for any C/C++ project that requires more complex mathematical functions and objects such as matrices, vectors, etc. Keep in mind that I am developing this project mainly for my own use, so the features here are really just the features I need for my other project(s). This is a personal project, not a professional one. But I still try to put effort into its documentation.

All code related to zetaml is open-source; see the source repository here.

Usage

Zetaml is built with CMake.

When compiling, use the -DZML_USE_FLOATS flag to use floats (32-bit floating values) instead of doubles (64-bit floating values). You can also use the -DZML_BUILD_TESTS flag to build test executable(s); this can be useful if you intend to help develop zetaml. Furthermore, you can use the i386-linux-gnu.cmake toolchain file to build for 32-bit with GCC - as zetaml aims to be as compatible as possible with early architectures, I recommend testing the project on both x86 and x86_64 architectures if you contribute at all. As a sidenote: if you do decide to contribute, please remember to test your contributions for memory leaks with Valgrind.

To use the library, include <zetaml.h>.

Naming scheme of operator functions

Zetaml operators are named systematically, and all work in order of left-to-right (i.e. 'zmlDivideVecs_r(v1, v2)' is 'v1 / v2').

For example, zmlAddVecs_r adds two vectors and returns the result, allocating heap space for the resulting vector. The '_r' comes from the fact that the function returns its result. Therefore, _r operators are equivalent to '+', '-', '*', etc.
However, zmlAddVecs adds v2 (its second argument) to v1 (its first argument), modifying v1. There is no '_r' because nothing is returned. Therefore, non-_r operators are equivalent to '+=', '-=', '*=', etc.

When different types are operated on, they are all included in the function name, e.g. zmlMultiplyVecMat().

Finally, logical operators are named based on the initials of each syllable, e.g. zmlVecLT is a Less Than operator and zmlMatGTE is a Greater Than or Equal to operator.

The _r operator functions allocate memory for their return values which must be freed to avoid memory leaks.

Using this documentation

Information you should take note of is highlighted as such: This is an example of a note.
More important information is highlighted as a warning, like so: This is an example of a warning.
This documentation refers to both floats and doubles as 'floating-point values', or in the context of parameters, floating. This is to avoid confusion when using floats (instead of doubles) via the -ZML_USE_FLOATS=ON compilation option.

License

The Zeta Maths Library is licensed under the MIT License:

MIT License

Copyright (c) 2022 Jack Bennett

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.