cppFit is a C++ project designed to generate and analyze running times of your array algorithm. The project includes a C++ executable and a Python script for analysis.
- A Linux system. (Windows users see jFit)
- CMake 3.22.1 or higher
- A C++14 compatible compiler
- Python 3
-
Clone the repository:
git clone https://github.com/fringewidth/cppFit.git cd cppFit -
Make the
run.shscript executable:chmod +x run.sh
- Replace the body of
function(long* arr, int size)atinclude/algs.hwith your own function. - Execute
run.sh.
- Analysis of your algorithm in a single command.
- Fits to linear, logarithmic, linearithmic and polynomial time complexities.
- Measured data is preprocessed, which includes window based smoothing and outlier removal via IQR.
- Memory safe and storage safe.
main.cpp: The main entry point of the project. It generates running times and calls the Python script for analysis.include/cppFit/Gen.h: Contains theGenclass, which is responsible for generating arrays, measuring running times, and writing results to a CSV file.include/cppFit/CSV_Writer.h: A helper class for writing CSV files.include/algs.h: Your function here.
build/analyse.py: A Python script that analyzes the generated CSV file.
-
Run the
run.shscript:./run.sh
-
The script will:
- Build the C++ project using CMake and Make.
- Execute the
cppFitexecutable, which generates running times and writes them to a CSV file. - Call the
analyse.pyPython script to analyze the CSV file.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.
For any questions or suggestions, please open an issue.