Skip to content

Latest commit

 

History

History
115 lines (104 loc) · 2.85 KB

README.md

File metadata and controls

115 lines (104 loc) · 2.85 KB

cmathematics

Mathematics library for C and C++

Follows this tutorial playlist on YouTube.

Description

This is a mathematics library for C and C++ that implements common mathematical concepts and ideas from algebra, calculus, statistics, and linear algebra. A complete list of implemented functions and concepts can be found here.

List of implemented concepts so far:

Data

  1. Encryption
    1. AES
  2. Hashing
    1. SHA1/SHA2/SHA3
    2. HMAC-SHA, PBKDF2-HMAC-SHA

Graph

  1. Graph representation
  2. Graph algorithms - Dijkstra, Ford Fulkerson

Linear Algebra

  1. Vectors
  2. Matrices

Utility

  1. Big Integers
  2. Expression evaluation

Documentation

Full documentation can be found in the header files in the cmathematics folder.

Use

Simply drag the cmathematics folder into your C or C++ project, not the include directory, and it can be used as if it were apart of the project.

Example file structure:

PROJECT_DIR \
    ...
    cmathematics \
    	cmathematics.h
        ...
    ...
    main.c

Sample use in main.c:

#include "cmathematics/cmathematics.h"
#include "cmathematics/linalg/vec.h"

int main() {
    vec v1 = vector(2.0f, 1.0f, 3.4f);
    printVec(v1);
    
    return 0;
}

Complete list of implemented functions

Data

  1. Encryption
    1. AES
  2. Hashing
    1. SHA1/SHA2/SHA3
    2. HMAC-SHA
    3. PBKDF2-HMAC-SHA

Graph

  1. Representation
    1. Adjacency Lists/Adjacency Matrices
  2. Algorithms
    1. DFS
    2. Dijkstra Shortest Path
    3. Ford Fulkerson Max Flow

Linear Algebra

  1. Vectors
    1. Vector-Scalar operations (+, -, *, /, ^)
    2. Vector-Vector operations (+, -, .*, ./, dot, cross)
    3. Magnitude, Squared Magnitude
    4. Normalize
  2. Matrices
    1. Matrix-Scalar operations (+, -, *, /)
    2. Matrix-Vector multiplication
    3. Matrix-Matrix multiplication
    4. Matrix operations
      1. Transpose
      2. Elementary row operations
      3. Row Echelon Form/Reduced Row Echelon Form
      4. Splicing
      5. Determinant (through 3 different methods)
      6. Augmentation (vectors and matrices)
      7. Cofactors/adjugates
      8. Matrix Inverses

Utility

  1. Big Integers (Note: a good reference book for integer representations is Modern Computer Arithmetic by Richard Brent and Paul Zimmerman)
    1. Parsing from string
    2. Output to string
    3. Comparison
    4. Addition, subtraction
    5. Multiplication (Long, Karatsuba)
  2. Expression evaluation
    1. Shunting-Yard Algorithm

Todo

Utility

  1. Big Integers
    1. Division
    2. Modular Division
    3. Exponentiation
    4. Modular Exponentiation

Data

  1. Algorithms
    1. RSA

Graph Theory

Algebra/Calculus

  1. Functions
    1. Polynomials
    2. Differentiation
    3. Newton's Root Approximation