From 28550ca02a3e139d1b6c43be1bf85d2770e893dd Mon Sep 17 00:00:00 2001 From: Cody Michael Jones <46515483+cm-jones@users.noreply.github.com> Date: Thu, 27 Jun 2024 06:07:13 -0500 Subject: [PATCH] Update README.md --- README.md | 109 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 74 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 435a6c1..74d5f2e 100644 --- a/README.md +++ b/README.md @@ -6,27 +6,64 @@ ## Description -Cramer is an open-source, numerical linear algebra library for C++ that implements operations on vectors and matrices. It can also compute eigenvalues and eigenvectors and solve systems of linear equations. Here's an incomplete list of features: - -- Vector operations: - - norm - - inner (dot) product - - cross product - - projections - - reflections - -- Matrix operations: - - trace - - determinant - - transpose - - inverse - - LU, QR, and SVD decompositions - - eigenvalues and eigenvectors +Cramer is an open-source, numerical linear algebra library for C++ that supports common operations on vectors and matrices. For example, it can efficiently calculate the eigenvalues and eigenvectors of a matrix and solve a system of linear equations. + +## Features + +Vector operations: + +- norm (length) +- addition +- inner (dot) product +- outer product +- cross product +- projections +- reflections +- rotations + +Matrix operations: + +- trace +- determinant +- rank +- transpose +- Hermitian adjoint +- inverse (if it exists) +- LU, QR, and SVD decompositions +- eigenvalues and eigenvectors ## Requirements -- C++17 or later -- CMake 3.10 or later +- C++17 compiler (e.g., GCC, Clang) +- CMake +- Google Test for [unit testing](#unit-testing) +- Google Benchmark for [benchmarking](#benchmarking) + +## Usage + +Include the header in your C++ source files: + +```cpp +#include +``` + +Create vectors and matrices, and perform operations on them: + +```cpp +using namespace cramer; + +Matrix A(2, 2); +A(0, 0) = 1.0; +A(0, 1) = 2.0; +A(1, 0) = 3.0; +A(1, 1) = 4.0; + +Vector b(2); +b(0) = 5.0; +b(1) = 6.0; + +Vector x = solve(A, b); +``` ## Build and Install @@ -57,31 +94,33 @@ Cramer is an open-source, numerical linear algebra library for C++ that implemen sudo make install ``` -## Usage +## Unit Testing -Include the header in your C++ source files: +Thales uses [Google Test](https://github.com/google/googletest) for unit testing. To run the unit tests, first [build](#build-and-install) the project, and then execute the following command inside the `build` directory: -```cpp -#include +```sh +ctest ``` -Create vectors and matrices, and perform operations on them: +This will run all the registered unit tests and display the results. -```cpp -using namespace cramer; +## Benchmarking -Matrix A(2, 2); -A(0, 0) = 1.0; -A(0, 1) = 2.0; -A(1, 0) = 3.0; -A(1, 1) = 4.0; +Thales uses [Google Benchmark](https://github.com/google/benchmark) for benchmarking. To run the benchmarks, follow these steps: -Vector b(2); -b(0) = 5.0; -b(1) = 6.0; +1. Build the benchmarks (if not already built): + ``` + cmake --build build --target thales_benchmarks + ``` -Vector x = solve(A, b); -``` +2. Run the benchmarks: + ``` + cd build + make thales_benchmarks + ./thales_benchmarks + ``` + +This will execute all the registered benchmarks and display the results. ## Documentation