Skip to content

Commit b77e344

Browse files
committed
README: Fix typos
1 parent 5ec2bb6 commit b77e344

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $ uv run main.py 1 2 100 1 2 5
1414

1515
The repository contains multiple variants:
1616
- `simple`: An intentionally naïve and straightforward implementation (simple but slow)
17-
- `np_vectorize`: An implementation that uses numpy's fast factorized math for the Jacobi method. For the Gauß-Seidel method, this is not possible[^1], so we're only having some minor simplifications here.
17+
- `np_vectorize`: An implementation that uses numpy's fast vectorized math for the Jacobi method. For the Gauß-Seidel method, this is not possible[^1], so we're only having some minor simplifications here.
1818
- `numba`: An implementation where the main loop has been JIT-compiled with numba.
1919
- `cython`: An implementation where the `calculate()` function has been rewritten in `Cython` and is effectively used as an external C module.
2020
- `nuitka`: An implementation that uses Nuitka to compile the Python code into a single binary.
@@ -63,7 +63,7 @@ As expected, the naïve implementation (`simple`) performs very badly. Here, the
6363
The `nuitka` variant is _slightly_ faster than the `simple` variant (looking at the standard deviation, take that with a grain of salt).
6464

6565
For the Gauß-Seidel method, the `np_vectorize` variant is about as fast as the `simple` variant which is not surprising since the `calculate_gauss_seidel()` method is nearly identical to the standard `calculate` method and only contains some obvious tweaks (e.g. no matrix swapping).
66-
However, for the Jacobi method, the `np_vectorize` variant is even faster than the reference implementation (about 25% faster). This is thanks to numpy's optimized vectorized math while the reference implementation does not use vectorization. The perturbation matrix is also precomputed once inside the `calculate()` method instead of all the values being recomputed for each element (caching the matrix _does_ make sense in general, but since the reference implementation doesn't do it, we're also not doing it as long as it's not necessary).
66+
However, for the Jacobi method, the `np_vectorize` variant is even faster than the reference implementation (about 25% faster). This is thanks to numpy's vectorized math while the reference implementation does not use vectorization. The perturbation matrix is also precomputed once inside the `calculate()` method instead of all the values being recomputed for each element (caching the matrix _does_ make sense in general, but since the reference implementation doesn't do it, we're also not doing it as long as it's not necessary).
6767

6868
The `numba` variant performs a bit worse than the reference implementation, the reference implementation being about 2x faster.
6969

0 commit comments

Comments
 (0)