Linear Congruential Method (LCM) pseudo-random number generator
Project description
LICOME
LICOME (Linear Congruential Method) is a lightweight Python package that generates pseudo-random numbers using the Linear Congruential Method (LCM).
It returns both the raw sequence of generated numbers and their normalized versions between [0, 1) using NumPy.
🔧 Features
- Simple and clean API
- Fast LCM-based random number generation
- Normalized output with NumPy
- User-defined input parameters
📦 Installation
Install via pip:
pip install licome
🚀 Usage
from licome import LICOME
# Define parameters
a = 2 # Multiplier
c = 3 # Increment
x0 = 5 # Seed value
m = 103 # Modulus
count = 10 # Number of values
# Generate pseudo-random numbers
y, u = LICOME(a, c, x0, m, count)
print("Generated:", y)
print("Normalized:", u)
📄 Function Reference
def LICOME(a: int, c: int, x0: int, m: int, count: int):
"""
Linear Congruential Method to generate pseudo-random numbers.
Parameters:
a (int): Multiplier
c (int): Increment
x0 (int): Initial seed value
m (int): Modulus
count (int): Total numbers to generate
Returns:
tuple:
y (list): Raw generated integers
u (ndarray): Normalized values in [0, 1)
"""
🧪 Example Script
from licome import LICOME
def main():
y, u = LICOME(2, 3, 5, 103, 10)
print("Generated:", y)
print("Normalized:", u)
if __name__ == "__main__":
main()
👤 Author
Rohit Kumar Behera
Feel free to contribute, suggest improvements, or report issues.
📧 Email: [rohitmbl24@gmail.com]
(mailto:rohitmbl24@gmail.com)
🔗 PyPI: [https://pypi.org/project/licome/]
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file licome-1.0.0.tar.gz.
File metadata
- Download URL: licome-1.0.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71bb1104098337e289f102c955ad38ea7af91b3409e0c0afc7a524fce8c8ea24
|
|
| MD5 |
e863de8f3604a836856a560f1bf38e1f
|
|
| BLAKE2b-256 |
7c8a62cc937162b0e7a0c9ffdc4ee64847d7e400b4257beefa8e0099469d9d80
|
File details
Details for the file licome-1.0.0-py3-none-any.whl.
File metadata
- Download URL: licome-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77c32b09aa725b5f17259e80da4f70fbead13a54027d7a93330bfe96642c2bef
|
|
| MD5 |
3ce4ae076948cb2699fc1d2f4f963117
|
|
| BLAKE2b-256 |
8dc4fd9f6c75e2745f74050a0258fdc05dffa95031a1b282652f339482c31fa8
|