#!/bin/bash
echo "Cleaning up old results..."
rm -f eigen_data_*.txt scaling_data*.txt
rm -f arma_eigenproblem_checker buckling_beam_solver off_diagonal_finder scaling_tester
rm -f ../../projects/project2/include/*.pdf

echo "Compiling the C++ code..."
g++ -larmadillo src/* arma_eigenproblem_checker.cpp -o arma_eigenproblem_checker
g++ -larmadillo src/* buckling_beam_solver.cpp -o buckling_beam_solver
g++ -larmadillo src/* off_diagonal_finder.cpp -o off_diagonal_finder
g++ -larmadillo src/* scaling_tester.cpp -o scaling_tester
echo "Compilation finished."

echo "Generating numerical results..."
./scaling_tester 250
./scaling_tester 250 dense
uv run python/scaling_plotter.py scaling_data.txt
uv run python/scaling_plotter.py scaling_data_dense.txt

./buckling_beam_solver 10
./buckling_beam_solver 100
uv run python/buckling_beam_plotter.py eigen_data_10.txt
uv run python/buckling_beam_plotter.py eigen_data_100.txt

echo "All done!"