Skip to content

Latest commit

 

History

History
181 lines (123 loc) · 8.71 KB

README.MD

File metadata and controls

181 lines (123 loc) · 8.71 KB

PracCodes

Repository for mathematical codes ( 2 variants - optimized, non-optimized )


Last Update

UPDATE 01.09.2024 INFO:

  • run_api.py updated.
    • Argparser added.

Tip

usage: optimized_api [-h] [-r]

optimized_api FLASK app

options:

-h, --help show this help message and exit
-r, --rebuild, -re Rebuild optimized_api


UPDATE #2 23.08.2024 INFO:

  • GUI updated.
    • Add dark mode.
    • Add new accordion fields.
    • Add new input fields.
    • Add result copy button.
    • Add global_info and global_info.GlobalRet return fields.
    • Add new styles to statics.
    • Add new .js files to statics.

Note

api_key in config.ini does not work.

  • Enjoy 😸

UPDATE 23.08.2024 INFO:

  • Started creating GUI for API. Now you can use only lineq.generator GUI.

  • GUI LOCAL link -> localhost:8000/main (localhost:8000/ works too (without GUI)) after running run_api.py.

  • Examples -> images.api_gui

    [] [] []

    [] [] []


Update 22.08.2024 INFO:


Update 19.08.2024 INFO:

  • Continued working on API after a break. API for generator, checker will be finished soon. Then I will continue optimizing the rest of the modules, namely lineq.lineq, ( lineq.Utils.Prettier, lineq.Utils.S_R may not be changed, but will be moved to a new module without optimization, or will be completely removed ). lineq.Utils.timer will be definitely removed.

  • optimized.lineq.matrix_methods.python_interface API is ready for 100% use.


Update 10.08.2024 INFO:

  • Fixed a bug in the rand function of the optimized/lineq/matrix_methods/lowlevel/mm.c file (file). The function was returning extremely large numbers instead of a random number within the specified range.

  • Updated the docstrings in the optimized.lineq.generator.python_interface module. optimized.lineq.generator.python_interface

  • Added new information to the API data.json file. API-DATA.

  • Added new API functions. Check the Current Api Support for all functions.

  • New API return system -> Added in each return global_info -> request.headers, host, url, etc...

    • some screenshots


Update #2 04.08.2024 INFO:

Add new API functions Current Api Support Check usage instructions in API-DATA or just run run_api.py and check home page. All info in:

Update 04.08.2024 INFO:

Started developing the API for the optimized codes. Already ready for use determinant function API. Info in data. To run the API, run run_api. Local API is available at http://127.0.0.1:8000/.

  • Use examples:

    • browser list mode (img1): http://127.0.0.1:5000/det/?type=list&matrix=[[1,2,3],[4,5,6],[7,1.2,7]]

    • browser str mode (img2): http://127.0.0.1:5000/det/?matrix=1%202%203\n4%205%206\n7%208%209

    • curl list mode (img3):

    curl `http://127.0.0.1:5000/det/?type=list&matrix=%5B%5B1%2C2%2C3%5D%2C%5B4%2C5%2C6%5D%2C%5B7%2C1.2%2C7%5D%5D`


Update 02.08.2024 INFO:

Rewritted build.py script.

New Build System

  • Build Management: Manages cleaning up previous builds, compiling modules, and organizing build artifacts.
  • Dependency Check: Automatically checks for and installs necessary dependencies such as Cython.
  • Configuration Loading: Loads build settings and module configurations from the file cfg. If the file does not exist, a default configuration is created.
  • Build Result Visualization: Displays a tree structure with icons indicating the success or failure of each module.
  • Automated Testing: Runs tests on successfully built libraries to ensure their correctness.

Update 29.07.2024 INFO:

I have rewritten the Checker module and updated matrix filling in matrix_methods module.

  • Introduced the Checker class for matrix validation

    • Methods included:
      • diagonal_domination(matrix) -> bool: Checks matrix diagonal domination
      • symmetric_check(matrix) -> bool: Checks matrix symmetry
      • sylvesters_criterion(matrix) -> bool: Checks matrix against Sylvester's criterion
  • I also updated the matrix filling in both the matrix_methods and Checker modules. I replaced the cycle with a for loop and used memset(*, 0, sizeof(*)) to set the matrix elements to zero.


Update 26.07.2024 INFO:

The updated Python interface for optimized.lineq.matrix_methods is now ready for use. It is optimized for 100% efficiency.

The new code is significantly faster, with an average improvement of more than 50 times.

The Generator has also been rewritten.


Update 26.07.2024 INFO:

In the lineq/LinEq/Utils/Matrix_methods.py file, the determinant function has been fixed.

I have started rewriting the code. In the Optimized-Experimental directory, you will find experimental versions of the codes with optimizations. These versions are about 50 times faster. However, you need the Cython library for this!

I have rewritten the lineq.matrix_methods module in the optimized/lineq/matrix_methods/ directory.

Here are the links to the source code:

  • The C code can be found in the code file.
  • The Python code is available in the code file. This file is ready for 50% use. All functions work if imported from the build.matrix_methods file. However, in the Python file, only 50% of the code is implemented.

The source codes are located in the optimized/{module_name}/{util_name}/lowlevel directory, where {module_name} represents the module name and {util_name} represents the utility name.

To build the optimized version, run the build.bat [DELETED, use python script]UPD 02.08.2024 build.py file from the optimized directory. Please note that this feature does not work with older versions of the project. Wait for a new version to be ready with all optimizations implemented.