re-matrix


Namere-matrix JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarySimple python package
upload_time2024-12-20 05:32:15
maintainerNone
docs_urlNone
authorCharlie
requires_pythonNone
licenseNone
keywords python matrices row reduction linear algebra
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # re-matrix
This library includes functions for row reducing matrices along with some basic matrix math functions.

#Installation: 
```commandline
pip install re-matrix
```
The following code gets a row reduced version of an example matrix:
```py

from re_matrix import row_reducer

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = row_reducer.get_row_reduced_matrix(example_matrix)
row_reducer.pretty_print_matrix(reduced_matrix)
```
Here is the output in the console: 
```commandline
------------------
 1.0   0.0  0.0  0.0620915032679738
 0.0   1.0  0.0  0.2908496732026147
-0.0  -0.0  1.0  0.9738562091503268
------------------
```
You can also get the solutions directly using this code:
```py
import re_matrix

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = re_matrix.get_row_reduced_matrix(example_matrix)
solution_set = re_matrix.get_matrix_solutions(reduced_matrix)
re_matrix.print_solution_set(solution_set)
```
which produces this output: 
```commandline
the solution set is: 
x_0 = 0.0620915032679738
x_1 = 0.2908496732026147
x_2 = 0.9738562091503268
```

You can also use the analyze_and_row_reduce_matrix function to see the whole process printed out
```py
import re_matrix

example_matrix = [[8, 2, 3, 4],
                  [5, 3, 7, 8],
                  [7, 9, 2, 5]]
reduced_matrix = re_matrix.analyze_and_row_reduce_matrix(example_matrix)
```
```commandline
original matrix:
------------------
8  2  3  4
5  3  7  8
7  9  2  5
------------------
row reduced matrix:
------------------
 1.0   0.0  0.0  0.0620915032679738
 0.0   1.0  0.0  0.2908496732026147
-0.0  -0.0  1.0  0.9738562091503268
------------------
the solution set is: 
x_0 = 0.0620915032679738
x_1 = 0.2908496732026147
x_2 = 0.9738562091503268
The solution set solves the original matrix
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "re-matrix",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python, matrices, row reduction, linear algebra",
    "author": "Charlie",
    "author_email": "<charlie@thatcharlie.com>",
    "download_url": "https://files.pythonhosted.org/packages/06/c0/8d8de7dc94f1769f7e8ed0364dd5262886242dba7353f9824fc7be733713/re_matrix-0.1.0.tar.gz",
    "platform": null,
    "description": "# re-matrix\nThis library includes functions for row reducing matrices along with some basic matrix math functions.\n\n#Installation: \n```commandline\npip install re-matrix\n```\nThe following code gets a row reduced version of an example matrix:\n```py\n\nfrom re_matrix import row_reducer\n\nexample_matrix = [[8, 2, 3, 4],\n                  [5, 3, 7, 8],\n                  [7, 9, 2, 5]]\nreduced_matrix = row_reducer.get_row_reduced_matrix(example_matrix)\nrow_reducer.pretty_print_matrix(reduced_matrix)\n```\nHere is the output in the console: \n```commandline\n------------------\n 1.0   0.0  0.0  0.0620915032679738\n 0.0   1.0  0.0  0.2908496732026147\n-0.0  -0.0  1.0  0.9738562091503268\n------------------\n```\nYou can also get the solutions directly using this code:\n```py\nimport re_matrix\n\nexample_matrix = [[8, 2, 3, 4],\n                  [5, 3, 7, 8],\n                  [7, 9, 2, 5]]\nreduced_matrix = re_matrix.get_row_reduced_matrix(example_matrix)\nsolution_set = re_matrix.get_matrix_solutions(reduced_matrix)\nre_matrix.print_solution_set(solution_set)\n```\nwhich produces this output: \n```commandline\nthe solution set is: \nx_0 = 0.0620915032679738\nx_1 = 0.2908496732026147\nx_2 = 0.9738562091503268\n```\n\nYou can also use the analyze_and_row_reduce_matrix function to see the whole process printed out\n```py\nimport re_matrix\n\nexample_matrix = [[8, 2, 3, 4],\n                  [5, 3, 7, 8],\n                  [7, 9, 2, 5]]\nreduced_matrix = re_matrix.analyze_and_row_reduce_matrix(example_matrix)\n```\n```commandline\noriginal matrix:\n------------------\n8  2  3  4\n5  3  7  8\n7  9  2  5\n------------------\nrow reduced matrix:\n------------------\n 1.0   0.0  0.0  0.0620915032679738\n 0.0   1.0  0.0  0.2908496732026147\n-0.0  -0.0  1.0  0.9738562091503268\n------------------\nthe solution set is: \nx_0 = 0.0620915032679738\nx_1 = 0.2908496732026147\nx_2 = 0.9738562091503268\nThe solution set solves the original matrix\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Simple python package",
    "version": "0.1.0",
    "project_urls": null,
    "split_keywords": [
        "python",
        " matrices",
        " row reduction",
        " linear algebra"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "58d15335dd8da9726a235ace96df896c0dc47d14e80dd157abff9243c0ca31e9",
                "md5": "c96a5846a89dbe6f0bad38b4161c4b12",
                "sha256": "df593743ad96d5b1d06b52590f72304385c9ce1d3febe9c5e623ef0612dee0b2"
            },
            "downloads": -1,
            "filename": "re_matrix-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c96a5846a89dbe6f0bad38b4161c4b12",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4732,
            "upload_time": "2024-12-20T05:32:13",
            "upload_time_iso_8601": "2024-12-20T05:32:13.452379Z",
            "url": "https://files.pythonhosted.org/packages/58/d1/5335dd8da9726a235ace96df896c0dc47d14e80dd157abff9243c0ca31e9/re_matrix-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "06c08d8de7dc94f1769f7e8ed0364dd5262886242dba7353f9824fc7be733713",
                "md5": "8516c766fe692f136b52ccffbb73e2cd",
                "sha256": "10759368e51ef96e930d09e0b7d21d1508be603b0cf1385816e1d8f5860cf35f"
            },
            "downloads": -1,
            "filename": "re_matrix-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8516c766fe692f136b52ccffbb73e2cd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4277,
            "upload_time": "2024-12-20T05:32:15",
            "upload_time_iso_8601": "2024-12-20T05:32:15.785100Z",
            "url": "https://files.pythonhosted.org/packages/06/c0/8d8de7dc94f1769f7e8ed0364dd5262886242dba7353f9824fc7be733713/re_matrix-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-20 05:32:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "re-matrix"
}
        
Elapsed time: 0.38532s