Skip to main content

C++

Project description

cppmath

A fast library of mathematical algorithms in C++, optimized for Olympiad problems and high-performance computing.

Installation

pip install cppmath

Usage

import cppmath

# High Precision Initialization
config = cppmath.initialize_precision(precision_bits=128, optimize_cache=True)

# Linear Algebra
matrix = [[1, 2], [3, 4]]
result = cppmath.fast_matrix_power(matrix, 10)
eigenvalues ​​= cppmath.eigenvalue_approximation(matrix)

# Optimization
objective = [1, 2, 3]
constraints = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
result = cppmath.optimization_solver(objective, constraints, method="genetic")

# Differential equations
coeffs = [1, 0.5, 0.25]
initial = [1.0, 0.0]
solution = cppmath.differential_equation_solver(coeffs, initial, step_size=0.01, num_steps=100)

# Numerical integration
function_coeffs = [1, 2, 3] # f(x) = 1 + 2x + 3x^2
integral = cppmath.numerical_integration(function_coeffs, 0, 1, intervals=1000)

# Monte Carlo simulation
points = cppmath.monte_carlo_simulation(dimensions=3, samples=1000, seed=42)

Functionality

  • High-performance linear algebras
  • Optimization methods (genetic algorithms, simplex method)
  • Solving differential equations
  • Numerical integration
  • Monte Carlo simulations
  • Fast Fourier transform
  • Distributed caching of computations

Requirements

  • Python 3.6+
  • NumPy (optional, for better performance)
  • requests (for distributed caching)

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cppmath-1.0.5.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cppmath-1.0.5-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file cppmath-1.0.5.tar.gz.

File metadata

  • Download URL: cppmath-1.0.5.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cppmath-1.0.5.tar.gz
Algorithm Hash digest
SHA256 81274b6c9e63eb2d91d9f97223861cb4db68eeeb6fae2c1947f093d81425ed99
MD5 115f1091ae81f17d53dd40bdd605d14a
BLAKE2b-256 89d58bb55d73881cf4afe38a16e1866134faa144b6438222b3da4047473d5f50

See more details on using hashes here.

File details

Details for the file cppmath-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: cppmath-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cppmath-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3408b975368a828730ccd038d65c2ae1fd8a1eb394b6215b6d5c4d3bb14aba1f
MD5 45d34d92e82567fc6d732c018902a295
BLAKE2b-256 d3f5d177810fa3b954b1e7ae5d1d8c41e9965edd1f8a9a25b457f0ab0fdcb3e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page