Project description
mathslib is a compilation of Mathematical Functions and Algorithms I have made or come across.
I have used most of these for Project Euler.
See my website ivl-projecteuler.com for their implementation
See the full documentation here
Breakdown
numtheory.py |
divisors_of(x, include_x)
divisors(x, n)
continued_fraction(x)
overall_fraction(x)
phi(x)
phi_sieve(x)
mobius(x)
mobius_k_sieve(limit, k)
count_k_free(n, k)
ppt(limit, non_primitive)
k_smooth_numbers(max_prime, limit)
k_powerful(k, limit, count)
legendre_factorial(x)
tonelli_shanks(a, p)
ChineseRemainderTheorem(a1, a2, n1, n2)
Generalised_CRT(a1, a2, n1, n2)
FrobeniusNumber(*integers)
|
prime.py |
prime_sieve(limit, block_size, segment, values)
is_prime(x)
prime_factors(x)
primepi(x)
sum_of_primes(x)
fermat_primality_test(x)
miller(n, millerrabin, numoftests)
|
linalg.py |
GaussJordanElimination(matrix, augmentedpart)
solve(M, b)
inverse(matrix)
determinant(matrix)
matrix_addition(A, B, subtract)
identity(l, val)
concatenate(A, B)
argmax(alist)
fillmatrix(size, val)
matrix_mul(A, B)
|
fib.py |
|
algorithms.py |
PrimsAlgorithm(matrix)
DijkstrasAlgorithm(matrix, start_node, end_node)
KnapSack(values, weights, n, W, no_values)
KnapSackValues(values, weights, n, W, no_values)
|
simple.py |
|
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution