Skip to content

Commit

Permalink
deploy: 57ce409
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezyali committed Jul 29, 2024
0 parents commit da4fc23
Show file tree
Hide file tree
Showing 257 changed files with 27,686 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7d68660430f77a669483229bb780418f
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/api.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__eq__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__ge__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__getitem__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__gt__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__hash__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__init__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__le__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__lt__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__ne__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__repr__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.__setitem__.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.classes.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.implements.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.inv.doctree
Binary file not shown.
Binary file added .doctrees/api/Zmodn.mod_inv.doctree
Binary file not shown.
Binary file added .doctrees/developer-guide.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/getting-started.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
125 changes: 125 additions & 0 deletions _images/heading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions _sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. py:module:: zmodn
Modular Arithmetic
==================

.. python-apigen-group:: modular-arithmetic


39 changes: 39 additions & 0 deletions _sources/developer-guide.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
The latest released version of :obj:`Zmodn` can be installed from `PyPI <https://pypi.org/project/zmodn/>`_ with `pip`:

.. code-block:: console
pip install zmodn
To install your library locally so that it can be imported from anywhere in your system, you can use the command :obj:`pip install .` in the root directory of your project (the directory containing the :obj:`setup.py` or :obj:`pyproject.toml` file).

Here are the detailed steps:

1. Open a terminal.
2. Navigate to the root directory of your project.
3. Execute the command :obj:`pip install .`.

This command will install your library in your global Python environment (or in the active virtual environment if you are using one). Once installed, you should be able to import your library from any Python script on your system.

Note: If you are using a virtual environment and want your library to be available globally, make sure the virtual environment is not active when you run the :obj:`pip install .` command.

Additionally, if you make changes to your library and want them reflected in the installed version, you'll need to uninstall the old version and reinstall the new one. You can do this with the commands :obj:`pip uninstall your-library-name` and :obj:`pip install .`.


Updated Documentation
_____________________

To generate the documentation, you need to run the following command in the root directory of docs:

.. code-block:: console
sphinx-apidoc -o source/ ../zmodn
make html
Now, suppose you did som changes to our code and now you want to rebuild that HTML, go to your docs directory and run
the following command:

.. code-block:: console
make clean html
This will delete the old HTML files and rebuild them.
96 changes: 96 additions & 0 deletions _sources/getting-started.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
The :doc:`getting-started` guide is intended to help you get started with installing and using the library in your own
projects. See ":doc:`Basic Usage`" for more detailed information on how to use the library.

Install the package
-------------------

The last stable release is available on PyPI and can be installed with pip:

.. code-block:: console
pip install zmodn
zmodn.__version__
Create a :obj:`~.zmodn.Zmodn` instance
------------------------------

The :obj:`zmodn` class is the main interface to the library. It represents a set of integers modulo a given modulus. The
modulus must be a positive integer. The representatives of the set are given as a list of integers or a single integer.
In this example, we create a :obj:`Zmodn` instance representing the set of integers modulo 5 with representatives 1, 2,
3, 4, and 5 (which are equivalent to 1, 2, 3, 4, and 0 modulo 5, respectively):

.. code-block:: python
from zmodn import Zmodn
zmodn = Zmodn([1, 2, 3, 4, 5], 5)
The :obj:`Zmodn` class is a subclass of :obj:`numpy.ndarray`, so it can be used in the same way as a NumPy array:

.. code-block:: python
zmodn[0]
zmodn[1:3]
zmodn[0] = 6
zmodn[1:3] = [7, 8]
zmodn[0] = 1
zmodn[1:3] = [2, 3]
The :obj:`Zmodn` class also supports the :obj:`len` function, which returns the number of representatives:

.. code-block:: python
len(zmodn)
The :obj:`Zmodn` class supports the :obj:`in` operator, which checks if a given representative is in the set:

.. code-block:: python
1 in zmodn
2 in zmodn
3 in zmodn
4 in zmodn
5 in zmodn
6 in zmodn
7 in zmodn
8 in zmodn
The :obj:`Zmodn` class supports the :obj:`bool` function, which returns :obj:`True` if the set is not empty and

:obj:`False` otherwise:

.. code-block:: python
bool(zmodn)
Perform arithmetic operations
-----------------------------

Once you have two :obj:`Zmodn` instances, you can perform arithmetic can be performed using normal NumPy arithmetic.

standard element-wise array arithmetic operations -- addition, subtraction, multiplication, division and exponentiation
are easily performed on :obj:`Zmodn` instances. For example, to add two :obj:`Zmodn` instances, you can use the :obj:`+`
operator:

.. code-block:: python
zmodn1 = Zmodn([1, 2, 3, 4, 5], 5)
zmodn2 = Zmodn([1, 2, 3, 4, 5], 5)
zmodn1 + zmodn2
The :obj:`Zmodn` class also supports the :obj:`-`, :obj:`*`, :obj:`/`, and :obj:`**` operators:

.. code-block:: python
zmodn1 - zmodn2
zmodn1 * zmodn2
zmodn1 / zmodn2
zmodn1 ** zmodn2
The :obj:`Zmodn` class supports the :obj:`==` and :obj:`!=` operators, which check if two :obj:`Zmodn` instances are equal or not equal, respectively:

.. code-block:: python
zmodn1 == zmodn2
zmodn1 != zmodn2
See :doc:`/basic-usage/operations` for more information on the arithmetic operations.
Loading

0 comments on commit da4fc23

Please sign in to comment.