Linear algebra library for C++, created to accompany the corresponding series of videos on the QuantitativeBytes YouTube channel at:
www.youtube.com/c/QuantitativeBytes.
Many excellent linear algebra libraries already exist for C++ and as such this code is intended to be primarily for educational purposes, rather than as an alternative to those. It is intended to be studied alongside the corresponding series of videos on the QuantitativeBytes YouTube channel, the full playlist for which can be found here:
https://www.youtube.com/playlist?list=PL3WoIG-PLjSv9vFx2dg0BqzDZH_6qzF8-
As this code is paired with the corresponding videos on the QuantitativeBytes YouTube channel, pull requests will not be accepted.
New versions of the matrix and vector classes, qbVector2, qbVector3, qbVector4, qbMatrix33 and qbMatrix44 have been implemented for handling 2-element, 3-element and 4-element vectors and 3x3 and 4x4 matrices. These avoid the use of heap memory and are therefore faster than the generic qbVector and qbMatrix2 classes in cases where a fixed size is useful. This was implemented to support the qbRay ray tracer project and more details can be found over on the QuantitativeBytes YouTube channel here:
https://youtu.be/EQlXfCIBpdg https://youtu.be/sr1OA7NPwcI
Implementation of Principal Component Analysis (PCA).
Function to perform QR decomposition on the given matrix, returning an orthogonal matrix, Q, and an upper-triangular matrix, R. Uses the method of Householder reflections to perform the decomposition.
Functions for computing the eigenvectors and eigenvalues for a given matrix. Contains an implementation of the power iteration method for computing the dominant eigenvector, the inverse-power-iteration method and an implementation of the QR algorithm to estimate eigenvalue / eigenvector pairs for a given symmetric matrix.
Function for solving systems of linear equations. Uses an implementation of Gaussian elimination and back-substitution.
Function for computing the linear least squares solution to an over-determined system of linear equations.
Class for handling matrices. Implements a number of useful functions:
Compute the inverse of the matrix using the Gauss-Jordan elimination method.
Convert the matrix to row echelon form.
Transpose the matrix.
Compute the determinant of the matrix.
Class for handling vectors. Implements a number of useful functions:
Returns a normalized copy of the vector.
Normalizes the vector 'in-place'.
Computes the vector dot product.
Computes the vector cross product.