Kraken
is a modern math library written in a way that gives accurate results, compile time checks and simplicity.
-
c++20 or later
- Tested on:
- g++10 std=c++2a
- g++11 std=c++2a
- g++13
- clang++12 std=c++2a
- clang++11 std=c++2a
- clang++10 std=c++2a
- Tested on:
-
Catch2 for testing
-
A matrix_<> class. For more info check: about_matrix
-
namespace
kraken
which has:-- namespace
constants
: contains mathematical and physical constants. - namespace
cal
: contains functions that do some calculations. - namespace
op
: contains variadic function objects. - and a bonus namespace!
num_methods
: contains implementation of some numerical methods.
- namespace
- Download
- Adding the library to the intended path so the compiler can recognize it
- A simple way is to download this library from
github
aszip
thenunzip
it maybe using your os built-in unzip tool but the preferred way is to use PeaZip for windows and linux, for mac you can use keka.
-
If you downloaded it as
zip
and unzipped it, then in the unzipped library the root of the header folder hierarchy isKraken-master/source/library
. -
copy the
library
folder from the unzipped archive to your working directory asKraken
and include it this way. -
#include "Kraken/all.hpp" #include <iostream> using namespace kraken; auto main() -> int { std::cout << constants::pi << '\n'; }
-
If you downloaded it as
zip
and unzipped it, then in the unzipped library the root of the header folder hierarchy isKraken-master/source/library
. -
I.e. there is a
Kraken-master/source/library/all.hpp
header, which is the one that you want the compiler to find as <Kraken/all.hpp>. -
copy the
library
folder from the unzipped archive, to a folder that your compiler searches for headers.
And that folder is :-
/usr/include
-
Ui version
- if you're using
nautilus
file manager- open terminal then do
sudo apt install nautilus-admin
then when it's done donautilus -q
.
- open terminal then do
- if your're using
nemo
no need to install anythingrun as-administer
is built-in.
- if you're using
-
open
usr/include
folder asadministrator
. -
paste
library
folder intousr/include
, then renamelibrary
intoKraken
. you're done!. -
Terminal version
- if you have any file manger installed you can open a folder as administer as follows:
sudo
(your-file-manager)/usr/include
- paste
library
folder intousr/include
, then renamelibrary
intoKraken
. you're done!.
- if you have any file manger installed you can open a folder as administer as follows:
-
If you downloaded it as
zip
and unzipped it, then in the unzipped library the root of the header folder hierarchy isKraken-master/source/library
. -
I.e. there is a
Kraken-master/source/library/all.hpp
header, which is the one that you want the compiler to find as <Kraken/all.hpp>. -
copy the
library
folder from the unzipped archive, to a folder that your compiler searches for headers. -
for the MinGW g++ compiler you might have a folder such as
C:\installed\mingw\nuwen\MinGW (version)\include
-
just paste the
library
folder inside, then renamelibrary
intoKraken
. you're done! -
for the Visual C++ compiler you might have a folder such as
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\ (version) \include
-
just paste the
library
folder inside, then renamelibrary
intoKraken
. you're done!
-
#include <Kraken/all.hpp> #include <iostream> using namespace kraken; auto main() -> int { std::cout << constants::pi << '\n'; }