This project contains a C program for analyzing electrical circuits. It uses the GMP library for arbitrary-precision arithmetic. This is a solver for "Saigon Towers" https://oeis.org/A384183 and for https://oeis.org/A339548 and https://oeis.org/A339808 (resistor networks with resistances approaching 1)
Before building, you need the following tools installed:
- A C compiler (e.g., GCC or Clang)
- CMake (version 3.31 or higher)
- pkg-config
- GNU Multiple Precision Arithmetic Library (
gmp)
On Debian/Ubuntu:
sudo apt-get update
sudo apt-get install build-essential cmake pkg-config libgmp-devOn macOS (using Homebrew):
brew install cmake pkg-config gmpThis project now builds two executables:
- saigon
- saigon_util (a utility copy of saigon.c)
-
Configure the project using CMake.
For a debug build, run this from the project root:
cmake -S . -B buildFor an optimized release build:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -
Compile all targets:
cmake --build build
Or build a specific target, for example only saigon_util:
cmake --build build --target saigon_util
The executables will be created in the build directory. Examples:
./build/saigon
./build/saigon_utilrm -r build ; cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build && ./build/saigon