Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7ac112420 | |||
| af6f9eb3a5 | |||
| 38e0d8d718 | |||
| 44a64b29e2 | |||
| 003aff48c7 | |||
| 1365f97b9e | |||
| 478e9cb8ff | |||
| 18d144e0b2 | |||
| ac65feaac1 | |||
| 22c9a3b9de | |||
| f92ae99e2f | |||
| 510d2a1f8d | |||
| 49fa223901 | |||
| 7e4f3f22bd | |||
| abd65fabae | |||
| c8f3925675 | |||
| 1d62ac70df | |||
| 4b863c0ad8 | |||
| be8f3fba42 | |||
| a829649014 | |||
| c0cf7e27f8 | |||
| d806c30ee6 | |||
| 13623595ac | |||
| 61831be594 | |||
| 5f5add0710 | |||
| d155562145 | |||
| 4b1eee68e7 | |||
| b7520c61a5 | |||
| c28ff891a9 | |||
| 50a505fbeb | |||
| 5c2c551c27 | |||
| adf52e857b | |||
| 64f53bf81d | |||
| 84b4b80083 | |||
| fc688b7798 | |||
| d079168ca5 | |||
| 3e7494c3bc | |||
| 98f1306591 | |||
| 9dd8fc6249 | |||
| 1d028851b3 |
42
.github/workflows/python-pypi-upload.yml
vendored
Normal file
42
.github/workflows/python-pypi-upload.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Python application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
|
||||
pypi-upload:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip pipenv
|
||||
if [ -f Pipfile ]; then pipenv install; fi
|
||||
- name: Build Cython Code
|
||||
run: |
|
||||
pipenv run make
|
||||
- name: Test with unittest
|
||||
run: |
|
||||
pipenv run python -m unittest
|
||||
- name: Build Pip Packge
|
||||
run: |
|
||||
pipenv run VERSION_SUFIX=${GITHUB_RUN_ID} python setup.py sdist bdist_wheel
|
||||
- name: Upload Pip Packge
|
||||
run: |
|
||||
pipenv run TWINE_USERNAME=${{secrets.PYPI_USER}} TWINE_PASSWORD=${{secrets.PYPI_TOKEN}} python -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
|
||||
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
build/
|
||||
.vscode
|
||||
.idea/
|
||||
|
||||
*.pyc
|
||||
*.so
|
||||
*.c
|
||||
|
||||
yoshi_seals.egg-info/
|
||||
|
||||
.secret
|
||||
.env
|
||||
Binary file not shown.
@@ -1,278 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@@ -1,53 +0,0 @@
|
||||
# Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The function *scan* has the following syntax `scan(path)`, where `path` is the path to your directory.
|
||||
|
||||
The function *solution* has the following syntax `write(array,path)`, where `array` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The python class *Insert* has a method for *matrix* and another for *vector*, and it has the following syntax `Insert.method(array)`, where `Insert` is the *Python Class* and `method` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
### Processes
|
||||
|
||||
The python class *process* has all the methods described in the first session.
|
||||
|
||||
To call the method use a syntax like `sl = Seals.process()`, where `sl` is an instance and to use a method you have to append the method in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The method *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The method *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The method *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The method *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
@@ -1,268 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import csv
|
||||
import pandas as pd
|
||||
import math
|
||||
|
||||
class scan:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def np(self, path):
|
||||
|
||||
df=pd.read_csv(path, sep=';',decimal=",",header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def pd(self, path):
|
||||
return pd.read_csv(path, sep=';',decimal=",")
|
||||
|
||||
def write(array, path):
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
return array
|
||||
|
||||
class insert:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def matrix(self, matrix):
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(self, vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
|
||||
class process:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def identity(self, matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(self, matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(self, matrix):
|
||||
|
||||
return self.gauss(np.hstack((matrix, self.identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(self, A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (self.inverse(g)).dot(b)
|
||||
|
||||
x = (self.inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(self, U, b):
|
||||
|
||||
L = self.identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (self.inverse(L)).dot(b)
|
||||
|
||||
x = (self.inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(self, A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,23 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .Seals import process
|
||||
from .Seals import insert
|
||||
from .Seals import scan
|
||||
from .Seals import write
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,268 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import csv
|
||||
import pandas as pd
|
||||
import math
|
||||
|
||||
class scan:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def np(self, path):
|
||||
|
||||
df=pd.read_csv(path, sep=';',decimal=",",header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def pd(self, path):
|
||||
return pd.read_csv(path, sep=';',decimal=",")
|
||||
|
||||
def write(array, path):
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
return array
|
||||
|
||||
class insert:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def matrix(self, matrix):
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(self, vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
|
||||
class process:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def identity(self, matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(self, matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(self, matrix):
|
||||
|
||||
return self.gauss(np.hstack((matrix, self.identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(self, A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (self.inverse(g)).dot(b)
|
||||
|
||||
x = (self.inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(self, U, b):
|
||||
|
||||
L = self.identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (self.inverse(L)).dot(b)
|
||||
|
||||
x = (self.inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(self, A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,23 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .Seals import process
|
||||
from .Seals import insert
|
||||
from .Seals import scan
|
||||
from .Seals import write
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
import setuptools
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setuptools.setup(
|
||||
name="yoshi-seals",
|
||||
version="1.2.1",
|
||||
author="Vitor Hideyoshi",
|
||||
author_email="vitor.h.n.batista@gmail.com",
|
||||
description="Numeric Calculus python module in the topic of Linear Algebra",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git",
|
||||
packages=setuptools.find_packages(),
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
||||
"Operating System :: OS Independent",
|
||||
"Development Status :: 2 - Pre-Alpha",
|
||||
],
|
||||
python_requires='>=3.6',
|
||||
install_requires=[
|
||||
'numpy',
|
||||
'pandas',
|
||||
],
|
||||
)
|
||||
@@ -1,69 +0,0 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: yoshi-seals
|
||||
Version: 1.2.1
|
||||
Summary: Numeric Calculus python module in the topic of Linear Algebra
|
||||
Home-page: https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git
|
||||
Author: Vitor Hideyoshi
|
||||
Author-email: vitor.h.n.batista@gmail.com
|
||||
License: UNKNOWN
|
||||
Description: # Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The function *scan* has the following syntax `scan(path)`, where `path` is the path to your directory.
|
||||
|
||||
The function *solution* has the following syntax `write(array,path)`, where `array` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The python class *Insert* has a method for *matrix* and another for *vector*, and it has the following syntax `Insert.method(array)`, where `Insert` is the *Python Class* and `method` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
### Processes
|
||||
|
||||
The python class *process* has all the methods described in the first session.
|
||||
|
||||
To call the method use a syntax like `sl = Seals.process()`, where `sl` is an instance and to use a method you have to append the method in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The method *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The method *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The method *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The method *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Development Status :: 2 - Pre-Alpha
|
||||
Requires-Python: >=3.6
|
||||
Description-Content-Type: text/markdown
|
||||
@@ -1,9 +0,0 @@
|
||||
README.md
|
||||
setup.py
|
||||
Seals/Seals.py
|
||||
Seals/__init__.py
|
||||
yoshi_seals.egg-info/PKG-INFO
|
||||
yoshi_seals.egg-info/SOURCES.txt
|
||||
yoshi_seals.egg-info/dependency_links.txt
|
||||
yoshi_seals.egg-info/requires.txt
|
||||
yoshi_seals.egg-info/top_level.txt
|
||||
@@ -1,2 +0,0 @@
|
||||
numpy
|
||||
pandas
|
||||
@@ -1 +0,0 @@
|
||||
Seals
|
||||
Binary file not shown.
@@ -1,278 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@@ -1,53 +0,0 @@
|
||||
# Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The function *scan* has the following syntax `scan(path)`, where `path` is the path to your directory.
|
||||
|
||||
The function *solution* has the following syntax `write(array,path)`, where `array` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The python class *Insert* has a method for *matrix* and another for *vector*, and it has the following syntax `Insert.method(array)`, where `Insert` is the *Python Class* and `method` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
### Processes
|
||||
|
||||
The python class *process* has all the methods described in the first session.
|
||||
|
||||
To call the method use a syntax like `sl = Seals.process()`, where `sl` is an instance and to use a method you have to append the method in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The method *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The method *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The method *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The method *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
@@ -1,260 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import csv
|
||||
import pandas as pd
|
||||
import math
|
||||
|
||||
def scan(path):
|
||||
|
||||
df=pd.read_csv(path, sep=';',decimal=",",header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def write(array, path):
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
return array
|
||||
|
||||
class Insert:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def matrix(self, matrix):
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(self, vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
|
||||
class process:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def identity(self, matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(self, matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(self, matrix):
|
||||
|
||||
return self.gauss(np.hstack((matrix, self.identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(self, A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (self.inverse(g)).dot(b)
|
||||
|
||||
x = (self.inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(self, U, b):
|
||||
|
||||
L = self.identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (self.inverse(L)).dot(b)
|
||||
|
||||
x = (self.inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(self, A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,23 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .Seals import process
|
||||
from .Seals import Insert
|
||||
from .Seals import scan
|
||||
from .Seals import write
|
||||
@@ -1,260 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import csv
|
||||
import pandas as pd
|
||||
import math
|
||||
|
||||
def scan(path):
|
||||
|
||||
df=pd.read_csv(path, sep=';',decimal=",",header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def write(array, path):
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
return array
|
||||
|
||||
class Insert:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def matrix(self, matrix):
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(self, vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
|
||||
class process:
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def identity(self, matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(self, matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(self, matrix):
|
||||
|
||||
return self.gauss(np.hstack((matrix, self.identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(self, A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (self.inverse(g)).dot(b)
|
||||
|
||||
x = (self.inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(self, U, b):
|
||||
|
||||
L = self.identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (self.inverse(L)).dot(b)
|
||||
|
||||
x = (self.inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(self, A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,23 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .Seals import process
|
||||
from .Seals import Insert
|
||||
from .Seals import scan
|
||||
from .Seals import write
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,69 +0,0 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: yoshi-seals
|
||||
Version: 1.2
|
||||
Summary: Numeric Calculus python module in the topic of Linear Algebra
|
||||
Home-page: https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git
|
||||
Author: Vitor Hideyoshi
|
||||
Author-email: vitor.h.n.batista@gmail.com
|
||||
License: UNKNOWN
|
||||
Description: # Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The function *scan* has the following syntax `scan(path)`, where `path` is the path to your directory.
|
||||
|
||||
The function *solution* has the following syntax `write(array,path)`, where `array` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The python class *Insert* has a method for *matrix* and another for *vector*, and it has the following syntax `Insert.method(array)`, where `Insert` is the *Python Class* and `method` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
### Processes
|
||||
|
||||
The python class *process* has all the methods described in the first session.
|
||||
|
||||
To call the method use a syntax like `sl = Seals.process()`, where `sl` is an instance and to use a method you have to append the method in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The method *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The method *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The method *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The method *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The method *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Development Status :: 2 - Pre-Alpha
|
||||
Requires-Python: >=3.6
|
||||
Description-Content-Type: text/markdown
|
||||
@@ -1,9 +0,0 @@
|
||||
README.md
|
||||
setup.py
|
||||
Seals/Seals.py
|
||||
Seals/__init__.py
|
||||
yoshi_seals.egg-info/PKG-INFO
|
||||
yoshi_seals.egg-info/SOURCES.txt
|
||||
yoshi_seals.egg-info/dependency_links.txt
|
||||
yoshi_seals.egg-info/requires.txt
|
||||
yoshi_seals.egg-info/top_level.txt
|
||||
@@ -1,2 +0,0 @@
|
||||
numpy
|
||||
pandas
|
||||
@@ -1 +0,0 @@
|
||||
Seals
|
||||
Binary file not shown.
@@ -1,278 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@@ -1,55 +0,0 @@
|
||||
# Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Calculate Eigen Values
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The module *scan* has a function for *Numpy* arrays and *Pandas* dataframes, and used the following syntax `Seals.scan.np(path)` for *Numpy* and `Seals.scan.pd(path)` for *Pandas*, where `path` is the path to your directory.
|
||||
|
||||
The module *write* has a function for *Numpy* arrays and *Pandas* dataframes, and uses the following syntax `Seals.write.np(array,path)` for *Numpy*, where `array` is the matrix that you desire to output and `path` is the path to your directory, and `Seals.write.pd(df,path)` for *Pandas*, where `df` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The module *insert* has a function for *matrix* and another for *vector*, and it has the following syntax `Seals.insert.function(array)`, where `insert` is the *Python Module* and `function` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
There is also a function that given a matrix it return all real eigen values
|
||||
|
||||
### Processes
|
||||
|
||||
To call the module `process` use the syntax: `sl = Seals.process`, where `sl` is an instance and to use a function you have to append the desired function in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The function *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The function *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The function *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The function *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,46 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
def matrix(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
@@ -1,25 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .process import identity
|
||||
from .process import gauss
|
||||
from .process import inverse
|
||||
from .process import cholesky
|
||||
from .process import decomposition
|
||||
from .process import cramer
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,203 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import math
|
||||
|
||||
def identity(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(matrix):
|
||||
|
||||
return gauss(np.hstack((matrix, identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (inverse(g)).dot(b)
|
||||
|
||||
x = (inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(U, b):
|
||||
|
||||
L = identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (inverse(L)).dot(b)
|
||||
|
||||
x = (inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,18 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
@@ -1,20 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .eigen import eigen
|
||||
@@ -1,51 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
|
||||
def eigen(a):
|
||||
|
||||
k = 0
|
||||
l = np.ones((a.shape[0]))
|
||||
|
||||
while (k < a.shape[0]):
|
||||
|
||||
u = np.random.rand(a.shape[0],1)
|
||||
u = u/max(u.min(), u.max(), key=abs)
|
||||
|
||||
ctrl = 0
|
||||
|
||||
while (ctrl != l[k]):
|
||||
|
||||
ctrl = l[k]
|
||||
u = a.dot(u)
|
||||
l[k] = max(u.min(), u.max(), key=abs)
|
||||
u = u/l[k]
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (u[i] == 0):
|
||||
i += 1
|
||||
|
||||
a = a - (1/u[i])*u*a[i]
|
||||
|
||||
k += 1
|
||||
|
||||
return l
|
||||
@@ -1,21 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .insert import matrix
|
||||
from .insert import vector
|
||||
@@ -1,46 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
def matrix(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
@@ -1,25 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .process import identity
|
||||
from .process import gauss
|
||||
from .process import inverse
|
||||
from .process import cholesky
|
||||
from .process import decomposition
|
||||
from .process import cramer
|
||||
@@ -1,203 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import math
|
||||
|
||||
def identity(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(matrix):
|
||||
|
||||
return gauss(np.hstack((matrix, identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (inverse(g)).dot(b)
|
||||
|
||||
x = (inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(U, b):
|
||||
|
||||
L = identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (inverse(L)).dot(b)
|
||||
|
||||
x = (inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,21 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .scan import numpy as np
|
||||
from .scan import pandas as pd
|
||||
@@ -1,45 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
def numpy(path, sep=None, decimal=None):
|
||||
|
||||
if sep is None:
|
||||
sep = ","
|
||||
|
||||
if decimal is None:
|
||||
decimal = "."
|
||||
|
||||
df=pd.read_csv(path, sep=sep, decimal=decimal, header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def pandas(path, sep=None, decimal=None):
|
||||
|
||||
if sep is None:
|
||||
sep = ","
|
||||
|
||||
if decimal is None:
|
||||
decimal = "."
|
||||
|
||||
return pd.read_csv(path, sep=sep, decimal=decimal)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .write import numpy as np
|
||||
from .write import pandas as pd
|
||||
@@ -1,33 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import csv
|
||||
|
||||
def numpy(array, path):
|
||||
|
||||
with open(path, mode='w') as sistema_linear:
|
||||
|
||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||
solution_writer.writerows(array)
|
||||
|
||||
return array
|
||||
|
||||
def pandas(df, path):
|
||||
|
||||
df.to_csv(path)
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
import setuptools
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setuptools.setup(
|
||||
name="yoshi-seals",
|
||||
version="1.3",
|
||||
author="Vitor Hideyoshi",
|
||||
author_email="vitor.h.n.batista@gmail.com",
|
||||
description="Numeric Calculus python module in the topic of Linear Algebra",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git",
|
||||
packages=setuptools.find_packages(),
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
||||
"Operating System :: OS Independent",
|
||||
"Development Status :: 2 - Pre-Alpha",
|
||||
],
|
||||
python_requires='>=3.6',
|
||||
install_requires=[
|
||||
'numpy',
|
||||
'pandas',
|
||||
],
|
||||
)
|
||||
@@ -1,71 +0,0 @@
|
||||
Metadata-Version: 2.1
|
||||
Name: yoshi-seals
|
||||
Version: 1.3
|
||||
Summary: Numeric Calculus python module in the topic of Linear Algebra
|
||||
Home-page: https://github.com/HideyoshiNakazone/Seals-NumericCalculus.git
|
||||
Author: Vitor Hideyoshi
|
||||
Author-email: vitor.h.n.batista@gmail.com
|
||||
License: UNKNOWN
|
||||
Description: # Seals - Numeric Calculus
|
||||
|
||||
This python package is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Calculate Eigen Values
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
The module *scan* has a function for *Numpy* arrays and *Pandas* dataframes, and used the following syntax `Seals.scan.np(path)` for *Numpy* and `Seals.scan.pd(path)` for *Pandas*, where `path` is the path to your directory.
|
||||
|
||||
The module *write* has a function for *Numpy* arrays and *Pandas* dataframes, and uses the following syntax `Seals.write.np(array,path)` for *Numpy*, where `array` is the matrix that you desire to output and `path` is the path to your directory, and `Seals.write.pd(df,path)` for *Pandas*, where `df` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
The module *insert* has a function for *matrix* and another for *vector*, and it has the following syntax `Seals.insert.function(array)`, where `insert` is the *Python Module* and `function` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
There is also a function that given a matrix it return all real eigen values
|
||||
|
||||
### Processes
|
||||
|
||||
To call the module `process` use the syntax: `sl = Seals.process`, where `sl` is an instance and to use a function you have to append the desired function in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The function *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The function *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The function *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The function *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Development Status :: 2 - Pre-Alpha
|
||||
Requires-Python: >=3.6
|
||||
Description-Content-Type: text/markdown
|
||||
@@ -1,18 +0,0 @@
|
||||
README.md
|
||||
setup.py
|
||||
Seals/__init__.py
|
||||
Seals/eigen/__init__.py
|
||||
Seals/eigen/eigen.py
|
||||
Seals/insert/__init__.py
|
||||
Seals/insert/insert.py
|
||||
Seals/process/__init__.py
|
||||
Seals/process/process.py
|
||||
Seals/scan/__init__.py
|
||||
Seals/scan/scan.py
|
||||
Seals/write/__init__.py
|
||||
Seals/write/write.py
|
||||
yoshi_seals.egg-info/PKG-INFO
|
||||
yoshi_seals.egg-info/SOURCES.txt
|
||||
yoshi_seals.egg-info/dependency_links.txt
|
||||
yoshi_seals.egg-info/requires.txt
|
||||
yoshi_seals.egg-info/top_level.txt
|
||||
@@ -1,2 +0,0 @@
|
||||
numpy
|
||||
pandas
|
||||
@@ -1 +0,0 @@
|
||||
Seals
|
||||
16
Pipfile
Normal file
16
Pipfile
Normal file
@@ -0,0 +1,16 @@
|
||||
[[source]]
|
||||
url = "https://pypi.org/simple"
|
||||
verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
numpy = "*"
|
||||
pandas = "*"
|
||||
cython = "*"
|
||||
twine = "*"
|
||||
|
||||
[dev-packages]
|
||||
coverage = "*"
|
||||
|
||||
[requires]
|
||||
python_version = "3.10"
|
||||
504
Pipfile.lock
generated
Normal file
504
Pipfile.lock
generated
Normal file
@@ -0,0 +1,504 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "fc308261dbd2ed96009268de9d5157a44ce179a63137a99a3f76f7980b065eb5"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
"python_version": "3.10"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"name": "pypi",
|
||||
"url": "https://pypi.org/simple",
|
||||
"verify_ssl": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"default": {
|
||||
"bleach": {
|
||||
"hashes": [
|
||||
"sha256:085f7f33c15bd408dd9b17a4ad77c577db66d76203e5984b1bd59baeee948b2a",
|
||||
"sha256:0d03255c47eb9bd2f26aa9bb7f2107732e7e8fe195ca2f64709fcf3b0a4a085c"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==5.0.1"
|
||||
},
|
||||
"certifi": {
|
||||
"hashes": [
|
||||
"sha256:0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14",
|
||||
"sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==2022.9.24"
|
||||
},
|
||||
"cffi": {
|
||||
"hashes": [
|
||||
"sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5",
|
||||
"sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef",
|
||||
"sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104",
|
||||
"sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426",
|
||||
"sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405",
|
||||
"sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375",
|
||||
"sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a",
|
||||
"sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e",
|
||||
"sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc",
|
||||
"sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf",
|
||||
"sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185",
|
||||
"sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497",
|
||||
"sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3",
|
||||
"sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35",
|
||||
"sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c",
|
||||
"sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83",
|
||||
"sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21",
|
||||
"sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca",
|
||||
"sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984",
|
||||
"sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac",
|
||||
"sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd",
|
||||
"sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee",
|
||||
"sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a",
|
||||
"sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2",
|
||||
"sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192",
|
||||
"sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7",
|
||||
"sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585",
|
||||
"sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f",
|
||||
"sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e",
|
||||
"sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27",
|
||||
"sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b",
|
||||
"sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e",
|
||||
"sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e",
|
||||
"sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d",
|
||||
"sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c",
|
||||
"sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415",
|
||||
"sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82",
|
||||
"sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02",
|
||||
"sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314",
|
||||
"sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325",
|
||||
"sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c",
|
||||
"sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3",
|
||||
"sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914",
|
||||
"sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045",
|
||||
"sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d",
|
||||
"sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9",
|
||||
"sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5",
|
||||
"sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2",
|
||||
"sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c",
|
||||
"sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3",
|
||||
"sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2",
|
||||
"sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8",
|
||||
"sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d",
|
||||
"sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d",
|
||||
"sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9",
|
||||
"sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162",
|
||||
"sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76",
|
||||
"sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4",
|
||||
"sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e",
|
||||
"sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9",
|
||||
"sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6",
|
||||
"sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b",
|
||||
"sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01",
|
||||
"sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0"
|
||||
],
|
||||
"version": "==1.15.1"
|
||||
},
|
||||
"charset-normalizer": {
|
||||
"hashes": [
|
||||
"sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845",
|
||||
"sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"
|
||||
],
|
||||
"markers": "python_full_version >= '3.6.0'",
|
||||
"version": "==2.1.1"
|
||||
},
|
||||
"commonmark": {
|
||||
"hashes": [
|
||||
"sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60",
|
||||
"sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"
|
||||
],
|
||||
"version": "==0.9.1"
|
||||
},
|
||||
"cryptography": {
|
||||
"hashes": [
|
||||
"sha256:0e70da4bdff7601b0ef48e6348339e490ebfb0cbe638e083c9c41fb49f00c8bd",
|
||||
"sha256:10652dd7282de17990b88679cb82f832752c4e8237f0c714be518044269415db",
|
||||
"sha256:175c1a818b87c9ac80bb7377f5520b7f31b3ef2a0004e2420319beadedb67290",
|
||||
"sha256:1d7e632804a248103b60b16fb145e8df0bc60eed790ece0d12efe8cd3f3e7744",
|
||||
"sha256:1f13ddda26a04c06eb57119caf27a524ccae20533729f4b1e4a69b54e07035eb",
|
||||
"sha256:2ec2a8714dd005949d4019195d72abed84198d877112abb5a27740e217e0ea8d",
|
||||
"sha256:2fa36a7b2cc0998a3a4d5af26ccb6273f3df133d61da2ba13b3286261e7efb70",
|
||||
"sha256:2fb481682873035600b5502f0015b664abc26466153fab5c6bc92c1ea69d478b",
|
||||
"sha256:3178d46f363d4549b9a76264f41c6948752183b3f587666aff0555ac50fd7876",
|
||||
"sha256:4367da5705922cf7070462e964f66e4ac24162e22ab0a2e9d31f1b270dd78083",
|
||||
"sha256:4eb85075437f0b1fd8cd66c688469a0c4119e0ba855e3fef86691971b887caf6",
|
||||
"sha256:50a1494ed0c3f5b4d07650a68cd6ca62efe8b596ce743a5c94403e6f11bf06c1",
|
||||
"sha256:53049f3379ef05182864d13bb9686657659407148f901f3f1eee57a733fb4b00",
|
||||
"sha256:6391e59ebe7c62d9902c24a4d8bcbc79a68e7c4ab65863536127c8a9cd94043b",
|
||||
"sha256:67461b5ebca2e4c2ab991733f8ab637a7265bb582f07c7c88914b5afb88cb95b",
|
||||
"sha256:78e47e28ddc4ace41dd38c42e6feecfdadf9c3be2af389abbfeef1ff06822285",
|
||||
"sha256:80ca53981ceeb3241998443c4964a387771588c4e4a5d92735a493af868294f9",
|
||||
"sha256:8a4b2bdb68a447fadebfd7d24855758fe2d6fecc7fed0b78d190b1af39a8e3b0",
|
||||
"sha256:8e45653fb97eb2f20b8c96f9cd2b3a0654d742b47d638cf2897afbd97f80fa6d",
|
||||
"sha256:998cd19189d8a747b226d24c0207fdaa1e6658a1d3f2494541cb9dfbf7dcb6d2",
|
||||
"sha256:a10498349d4c8eab7357a8f9aa3463791292845b79597ad1b98a543686fb1ec8",
|
||||
"sha256:b4cad0cea995af760f82820ab4ca54e5471fc782f70a007f31531957f43e9dee",
|
||||
"sha256:bfe6472507986613dc6cc00b3d492b2f7564b02b3b3682d25ca7f40fa3fd321b",
|
||||
"sha256:c9e0d79ee4c56d841bd4ac6e7697c8ff3c8d6da67379057f29e66acffcd1e9a7",
|
||||
"sha256:ca57eb3ddaccd1112c18fc80abe41db443cc2e9dcb1917078e02dfa010a4f353",
|
||||
"sha256:ce127dd0a6a0811c251a6cddd014d292728484e530d80e872ad9806cfb1c5b3c"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==38.0.4"
|
||||
},
|
||||
"cython": {
|
||||
"hashes": [
|
||||
"sha256:061e25151c38f2361bc790d3bcf7f9d9828a0b6a4d5afa56fbed3bd33fb2373a",
|
||||
"sha256:06be83490c906b6429b4389e13487a26254ccaad2eef6f3d4ee21d8d3a4aaa2b",
|
||||
"sha256:07d173d3289415bb496e72cb0ddd609961be08fe2968c39094d5712ffb78672b",
|
||||
"sha256:0bbc27abdf6aebfa1bce34cd92bd403070356f28b0ecb3198ff8a182791d58b9",
|
||||
"sha256:0ea8267fc373a2c5064ad77d8ff7bf0ea8b88f7407098ff51829381f8ec1d5d9",
|
||||
"sha256:3875c2b2ea752816a4d7ae59d45bb546e7c4c79093c83e3ba7f4d9051dd02928",
|
||||
"sha256:39afb4679b8c6bf7ccb15b24025568f4f9b4d7f9bf3cbd981021f542acecd75b",
|
||||
"sha256:3f85eb2343d20d91a4ea9cf14e5748092b376a64b7e07fc224e85b2753e9070b",
|
||||
"sha256:40eff7aa26e91cf108fd740ffd4daf49f39b2fdffadabc7292b4b7dc5df879f0",
|
||||
"sha256:479690d2892ca56d34812fe6ab8f58e4b2e0129140f3d94518f15993c40553da",
|
||||
"sha256:4a4b03ab483271f69221c3210f7cde0dcc456749ecf8243b95bc7a701e5677e0",
|
||||
"sha256:513e9707407608ac0d306c8b09d55a28be23ea4152cbd356ceaec0f32ef08d65",
|
||||
"sha256:5514f3b4122cb22317122a48e175a7194e18e1803ca555c4c959d7dfe68eaf98",
|
||||
"sha256:5ba622326f2862f9c1f99ca8d47ade49871241920a352c917e16861e25b0e5c3",
|
||||
"sha256:63b79d9e1f7c4d1f498ab1322156a0d7dc1b6004bf981a8abda3f66800e140cd",
|
||||
"sha256:656dc5ff1d269de4d11ee8542f2ffd15ab466c447c1f10e5b8aba6f561967276",
|
||||
"sha256:67fdd2f652f8d4840042e2d2d91e15636ba2bcdcd92e7e5ffbc68e6ef633a754",
|
||||
"sha256:79e3bab19cf1b021b613567c22eb18b76c0c547b9bc3903881a07bfd9e7e64cf",
|
||||
"sha256:856d2fec682b3f31583719cb6925c6cdbb9aa30f03122bcc45c65c8b6f515754",
|
||||
"sha256:8669cadeb26d9a58a5e6b8ce34d2c8986cc3b5c0bfa77eda6ceb471596cb2ec3",
|
||||
"sha256:8733cf4758b79304f2a4e39ebfac5e92341bce47bcceb26c1254398b2f8c1af7",
|
||||
"sha256:97335b2cd4acebf30d14e2855d882de83ad838491a09be2011745579ac975833",
|
||||
"sha256:afbce249133a830f121b917f8c9404a44f2950e0e4f5d1e68f043da4c2e9f457",
|
||||
"sha256:b0595aee62809ba353cebc5c7978e0e443760c3e882e2c7672c73ffe46383673",
|
||||
"sha256:b6da3063c5c476f5311fd76854abae6c315f1513ef7d7904deed2e774623bbb9",
|
||||
"sha256:c8e8025f496b5acb6ba95da2fb3e9dacffc97d9a92711aacfdd42f9c5927e094",
|
||||
"sha256:cddc47ec746a08603037731f5d10aebf770ced08666100bd2cdcaf06a85d4d1b",
|
||||
"sha256:cdf10af3e2e3279dc09fdc5f95deaa624850a53913f30350ceee824dc14fc1a6",
|
||||
"sha256:d968ffc403d92addf20b68924d95428d523436adfd25cf505d427ed7ba3bee8b",
|
||||
"sha256:dbee03b8d42dca924e6aa057b836a064c769ddfd2a4c2919e65da2c8a362d528",
|
||||
"sha256:e1958e0227a4a6a2c06fd6e35b7469de50adf174102454db397cec6e1403cce3",
|
||||
"sha256:e6ffa08aa1c111a1ebcbd1cf4afaaec120bc0bbdec3f2545f8bb7d3e8e77a1cd",
|
||||
"sha256:e83228e0994497900af954adcac27f64c9a57cd70a9ec768ab0cb2c01fd15cf1",
|
||||
"sha256:ea1dcc07bfb37367b639415333cfbfe4a93c3be340edf1db10964bc27d42ed64",
|
||||
"sha256:eca3065a1279456e81c615211d025ea11bfe4e19f0c5650b859868ca04b3fcbd",
|
||||
"sha256:ed087eeb88a8cf96c60fb76c5c3b5fb87188adee5e179f89ec9ad9a43c0c54b3",
|
||||
"sha256:eeb475eb6f0ccf6c039035eb4f0f928eb53ead88777e0a760eccb140ad90930b",
|
||||
"sha256:eefd2b9a5f38ded8d859fe96cc28d7d06e098dc3f677e7adbafda4dcdd4a461c",
|
||||
"sha256:f3fd44cc362eee8ae569025f070d56208908916794b6ab21e139cea56470a2b3",
|
||||
"sha256:f9944013588a3543fca795fffb0a070a31a243aa4f2d212f118aa95e69485831"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==0.29.32"
|
||||
},
|
||||
"docutils": {
|
||||
"hashes": [
|
||||
"sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6",
|
||||
"sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==0.19"
|
||||
},
|
||||
"idna": {
|
||||
"hashes": [
|
||||
"sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4",
|
||||
"sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"
|
||||
],
|
||||
"markers": "python_version >= '3.5'",
|
||||
"version": "==3.4"
|
||||
},
|
||||
"importlib-metadata": {
|
||||
"hashes": [
|
||||
"sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b",
|
||||
"sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==5.1.0"
|
||||
},
|
||||
"jaraco.classes": {
|
||||
"hashes": [
|
||||
"sha256:2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158",
|
||||
"sha256:89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==3.2.3"
|
||||
},
|
||||
"jeepney": {
|
||||
"hashes": [
|
||||
"sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806",
|
||||
"sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755"
|
||||
],
|
||||
"markers": "sys_platform == 'linux'",
|
||||
"version": "==0.8.0"
|
||||
},
|
||||
"keyring": {
|
||||
"hashes": [
|
||||
"sha256:3dd30011d555f1345dec2c262f0153f2f0ca6bca041fb1dc4588349bb4c0ac1e",
|
||||
"sha256:ad192263e2cdd5f12875dedc2da13534359a7e760e77f8d04b50968a821c2361"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==23.11.0"
|
||||
},
|
||||
"more-itertools": {
|
||||
"hashes": [
|
||||
"sha256:250e83d7e81d0c87ca6bd942e6aeab8cc9daa6096d12c5308f3f92fa5e5c1f41",
|
||||
"sha256:5a6257e40878ef0520b1803990e3e22303a41b5714006c32a3fd8304b26ea1ab"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==9.0.0"
|
||||
},
|
||||
"numpy": {
|
||||
"hashes": [
|
||||
"sha256:01dd17cbb340bf0fc23981e52e1d18a9d4050792e8fb8363cecbf066a84b827d",
|
||||
"sha256:06005a2ef6014e9956c09ba07654f9837d9e26696a0470e42beedadb78c11b07",
|
||||
"sha256:09b7847f7e83ca37c6e627682f145856de331049013853f344f37b0c9690e3df",
|
||||
"sha256:0aaee12d8883552fadfc41e96b4c82ee7d794949e2a7c3b3a7201e968c7ecab9",
|
||||
"sha256:0cbe9848fad08baf71de1a39e12d1b6310f1d5b2d0ea4de051058e6e1076852d",
|
||||
"sha256:1b1766d6f397c18153d40015ddfc79ddb715cabadc04d2d228d4e5a8bc4ded1a",
|
||||
"sha256:33161613d2269025873025b33e879825ec7b1d831317e68f4f2f0f84ed14c719",
|
||||
"sha256:5039f55555e1eab31124a5768898c9e22c25a65c1e0037f4d7c495a45778c9f2",
|
||||
"sha256:522e26bbf6377e4d76403826ed689c295b0b238f46c28a7251ab94716da0b280",
|
||||
"sha256:56e454c7833e94ec9769fa0f86e6ff8e42ee38ce0ce1fa4cbb747ea7e06d56aa",
|
||||
"sha256:58f545efd1108e647604a1b5aa809591ccd2540f468a880bedb97247e72db387",
|
||||
"sha256:5e05b1c973a9f858c74367553e236f287e749465f773328c8ef31abe18f691e1",
|
||||
"sha256:7903ba8ab592b82014713c491f6c5d3a1cde5b4a3bf116404e08f5b52f6daf43",
|
||||
"sha256:8969bfd28e85c81f3f94eb4a66bc2cf1dbdc5c18efc320af34bffc54d6b1e38f",
|
||||
"sha256:92c8c1e89a1f5028a4c6d9e3ccbe311b6ba53694811269b992c0b224269e2398",
|
||||
"sha256:9c88793f78fca17da0145455f0d7826bcb9f37da4764af27ac945488116efe63",
|
||||
"sha256:a7ac231a08bb37f852849bbb387a20a57574a97cfc7b6cabb488a4fc8be176de",
|
||||
"sha256:abdde9f795cf292fb9651ed48185503a2ff29be87770c3b8e2a14b0cd7aa16f8",
|
||||
"sha256:af1da88f6bc3d2338ebbf0e22fe487821ea4d8e89053e25fa59d1d79786e7481",
|
||||
"sha256:b2a9ab7c279c91974f756c84c365a669a887efa287365a8e2c418f8b3ba73fb0",
|
||||
"sha256:bf837dc63ba5c06dc8797c398db1e223a466c7ece27a1f7b5232ba3466aafe3d",
|
||||
"sha256:ca51fcfcc5f9354c45f400059e88bc09215fb71a48d3768fb80e357f3b457e1e",
|
||||
"sha256:ce571367b6dfe60af04e04a1834ca2dc5f46004ac1cc756fb95319f64c095a96",
|
||||
"sha256:d208a0f8729f3fb790ed18a003f3a57895b989b40ea4dce4717e9cf4af62c6bb",
|
||||
"sha256:dbee87b469018961d1ad79b1a5d50c0ae850000b639bcb1b694e9981083243b6",
|
||||
"sha256:e9f4c4e51567b616be64e05d517c79a8a22f3606499941d97bb76f2ca59f982d",
|
||||
"sha256:f063b69b090c9d918f9df0a12116029e274daf0181df392839661c4c7ec9018a",
|
||||
"sha256:f9a909a8bae284d46bbfdefbdd4a262ba19d3bc9921b1e76126b1d21c3c34135"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.23.5"
|
||||
},
|
||||
"pandas": {
|
||||
"hashes": [
|
||||
"sha256:0183cb04a057cc38fde5244909fca9826d5d57c4a5b7390c0cc3fa7acd9fa883",
|
||||
"sha256:1fc87eac0541a7d24648a001d553406f4256e744d92df1df8ebe41829a915028",
|
||||
"sha256:220b98d15cee0b2cd839a6358bd1f273d0356bf964c1a1aeb32d47db0215488b",
|
||||
"sha256:2552bffc808641c6eb471e55aa6899fa002ac94e4eebfa9ec058649122db5824",
|
||||
"sha256:315e19a3e5c2ab47a67467fc0362cb36c7c60a93b6457f675d7d9615edad2ebe",
|
||||
"sha256:344021ed3e639e017b452aa8f5f6bf38a8806f5852e217a7594417fb9bbfa00e",
|
||||
"sha256:375262829c8c700c3e7cbb336810b94367b9c4889818bbd910d0ecb4e45dc261",
|
||||
"sha256:457d8c3d42314ff47cc2d6c54f8fc0d23954b47977b2caed09cd9635cb75388b",
|
||||
"sha256:4aed257c7484d01c9a194d9a94758b37d3d751849c05a0050c087a358c41ad1f",
|
||||
"sha256:530948945e7b6c95e6fa7aa4be2be25764af53fba93fe76d912e35d1c9ee46f5",
|
||||
"sha256:5ae7e989f12628f41e804847a8cc2943d362440132919a69429d4dea1f164da0",
|
||||
"sha256:71f510b0efe1629bf2f7c0eadb1ff0b9cf611e87b73cd017e6b7d6adb40e2b3a",
|
||||
"sha256:73f219fdc1777cf3c45fde7f0708732ec6950dfc598afc50588d0d285fddaefc",
|
||||
"sha256:8092a368d3eb7116e270525329a3e5c15ae796ccdf7ccb17839a73b4f5084a39",
|
||||
"sha256:82ae615826da838a8e5d4d630eb70c993ab8636f0eff13cb28aafc4291b632b5",
|
||||
"sha256:9608000a5a45f663be6af5c70c3cbe634fa19243e720eb380c0d378666bc7702",
|
||||
"sha256:a40dd1e9f22e01e66ed534d6a965eb99546b41d4d52dbdb66565608fde48203f",
|
||||
"sha256:b4f5a82afa4f1ff482ab8ded2ae8a453a2cdfde2001567b3ca24a4c5c5ca0db3",
|
||||
"sha256:c009a92e81ce836212ce7aa98b219db7961a8b95999b97af566b8dc8c33e9519",
|
||||
"sha256:c218796d59d5abd8780170c937b812c9637e84c32f8271bbf9845970f8c1351f",
|
||||
"sha256:cc3cd122bea268998b79adebbb8343b735a5511ec14efb70a39e7acbc11ccbdc",
|
||||
"sha256:d0d8fd58df5d17ddb8c72a5075d87cd80d71b542571b5f78178fb067fa4e9c72",
|
||||
"sha256:e18bc3764cbb5e118be139b3b611bc3fbc5d3be42a7e827d1096f46087b395eb",
|
||||
"sha256:e2b83abd292194f350bb04e188f9379d36b8dfac24dd445d5c87575f3beaf789",
|
||||
"sha256:e7469271497960b6a781eaa930cba8af400dd59b62ec9ca2f4d31a19f2f91090",
|
||||
"sha256:e9dbacd22555c2d47f262ef96bb4e30880e5956169741400af8b306bbb24a273",
|
||||
"sha256:f6257b314fc14958f8122779e5a1557517b0f8e500cfb2bd53fa1f75a8ad0af2"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.5.2"
|
||||
},
|
||||
"pkginfo": {
|
||||
"hashes": [
|
||||
"sha256:ac03e37e4d601aaee40f8087f63fc4a2a6c9814dda2c8fa6aab1b1829653bdfa",
|
||||
"sha256:d580059503f2f4549ad6e4c106d7437356dbd430e2c7df99ee1efe03d75f691e"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==1.9.2"
|
||||
},
|
||||
"pycparser": {
|
||||
"hashes": [
|
||||
"sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9",
|
||||
"sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
|
||||
],
|
||||
"version": "==2.21"
|
||||
},
|
||||
"pygments": {
|
||||
"hashes": [
|
||||
"sha256:56a8508ae95f98e2b9bdf93a6be5ae3f7d8af858b43e02c5a2ff083726be40c1",
|
||||
"sha256:f643f331ab57ba3c9d89212ee4a2dabc6e94f117cf4eefde99a0574720d14c42"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"version": "==2.13.0"
|
||||
},
|
||||
"python-dateutil": {
|
||||
"hashes": [
|
||||
"sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86",
|
||||
"sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==2.8.2"
|
||||
},
|
||||
"pytz": {
|
||||
"hashes": [
|
||||
"sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427",
|
||||
"sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"
|
||||
],
|
||||
"version": "==2022.6"
|
||||
},
|
||||
"readme-renderer": {
|
||||
"hashes": [
|
||||
"sha256:cd653186dfc73055656f090f227f5cb22a046d7f71a841dfa305f55c9a513273",
|
||||
"sha256:f67a16caedfa71eef48a31b39708637a6f4664c4394801a7b0d6432d13907343"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==37.3"
|
||||
},
|
||||
"requests": {
|
||||
"hashes": [
|
||||
"sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983",
|
||||
"sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"
|
||||
],
|
||||
"markers": "python_version >= '3.7' and python_version < '4'",
|
||||
"version": "==2.28.1"
|
||||
},
|
||||
"requests-toolbelt": {
|
||||
"hashes": [
|
||||
"sha256:18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7",
|
||||
"sha256:62e09f7ff5ccbda92772a29f394a49c3ad6cb181d568b1337626b2abb628a63d"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==0.10.1"
|
||||
},
|
||||
"rfc3986": {
|
||||
"hashes": [
|
||||
"sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd",
|
||||
"sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==2.0.0"
|
||||
},
|
||||
"rich": {
|
||||
"hashes": [
|
||||
"sha256:a4eb26484f2c82589bd9a17c73d32a010b1e29d89f1604cd9bf3a2097b81bb5e",
|
||||
"sha256:ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0"
|
||||
],
|
||||
"markers": "python_full_version >= '3.6.3' and python_full_version < '4.0.0'",
|
||||
"version": "==12.6.0"
|
||||
},
|
||||
"secretstorage": {
|
||||
"hashes": [
|
||||
"sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77",
|
||||
"sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99"
|
||||
],
|
||||
"markers": "sys_platform == 'linux'",
|
||||
"version": "==3.3.3"
|
||||
},
|
||||
"six": {
|
||||
"hashes": [
|
||||
"sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926",
|
||||
"sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'",
|
||||
"version": "==1.16.0"
|
||||
},
|
||||
"twine": {
|
||||
"hashes": [
|
||||
"sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8",
|
||||
"sha256:9e102ef5fdd5a20661eb88fad46338806c3bd32cf1db729603fe3697b1bc83c8"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==4.0.2"
|
||||
},
|
||||
"urllib3": {
|
||||
"hashes": [
|
||||
"sha256:47cc05d99aaa09c9e72ed5809b60e7ba354e64b59c9c173ac3018642d8bb41fc",
|
||||
"sha256:c083dd0dce68dbfbe1129d5271cb90f9447dea7d52097c6e0126120c521ddea8"
|
||||
],
|
||||
"markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'",
|
||||
"version": "==1.26.13"
|
||||
},
|
||||
"webencodings": {
|
||||
"hashes": [
|
||||
"sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
|
||||
"sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
|
||||
],
|
||||
"version": "==0.5.1"
|
||||
},
|
||||
"zipp": {
|
||||
"hashes": [
|
||||
"sha256:83a28fcb75844b5c0cdaf5aa4003c2d728c77e05f5aeabe8e95e56727005fbaa",
|
||||
"sha256:a7a22e05929290a67401440b39690ae6563279bced5f314609d9d03798f56766"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"version": "==3.11.0"
|
||||
}
|
||||
},
|
||||
"develop": {
|
||||
"coverage": {
|
||||
"hashes": [
|
||||
"sha256:027018943386e7b942fa832372ebc120155fd970837489896099f5cfa2890f79",
|
||||
"sha256:11b990d520ea75e7ee8dcab5bc908072aaada194a794db9f6d7d5cfd19661e5a",
|
||||
"sha256:12adf310e4aafddc58afdb04d686795f33f4d7a6fa67a7a9d4ce7d6ae24d949f",
|
||||
"sha256:1431986dac3923c5945271f169f59c45b8802a114c8f548d611f2015133df77a",
|
||||
"sha256:1ef221513e6f68b69ee9e159506d583d31aa3567e0ae84eaad9d6ec1107dddaa",
|
||||
"sha256:20c8ac5386253717e5ccc827caad43ed66fea0efe255727b1053a8154d952398",
|
||||
"sha256:2198ea6fc548de52adc826f62cb18554caedfb1d26548c1b7c88d8f7faa8f6ba",
|
||||
"sha256:255758a1e3b61db372ec2736c8e2a1fdfaf563977eedbdf131de003ca5779b7d",
|
||||
"sha256:265de0fa6778d07de30bcf4d9dc471c3dc4314a23a3c6603d356a3c9abc2dfcf",
|
||||
"sha256:33a7da4376d5977fbf0a8ed91c4dffaaa8dbf0ddbf4c8eea500a2486d8bc4d7b",
|
||||
"sha256:42eafe6778551cf006a7c43153af1211c3aaab658d4d66fa5fcc021613d02518",
|
||||
"sha256:4433b90fae13f86fafff0b326453dd42fc9a639a0d9e4eec4d366436d1a41b6d",
|
||||
"sha256:4a5375e28c5191ac38cca59b38edd33ef4cc914732c916f2929029b4bfb50795",
|
||||
"sha256:4a8dbc1f0fbb2ae3de73eb0bdbb914180c7abfbf258e90b311dcd4f585d44bd2",
|
||||
"sha256:59f53f1dc5b656cafb1badd0feb428c1e7bc19b867479ff72f7a9dd9b479f10e",
|
||||
"sha256:5dbec3b9095749390c09ab7c89d314727f18800060d8d24e87f01fb9cfb40b32",
|
||||
"sha256:633713d70ad6bfc49b34ead4060531658dc6dfc9b3eb7d8a716d5873377ab745",
|
||||
"sha256:6b07130585d54fe8dff3d97b93b0e20290de974dc8177c320aeaf23459219c0b",
|
||||
"sha256:6c4459b3de97b75e3bd6b7d4b7f0db13f17f504f3d13e2a7c623786289dd670e",
|
||||
"sha256:6d4817234349a80dbf03640cec6109cd90cba068330703fa65ddf56b60223a6d",
|
||||
"sha256:723e8130d4ecc8f56e9a611e73b31219595baa3bb252d539206f7bbbab6ffc1f",
|
||||
"sha256:784f53ebc9f3fd0e2a3f6a78b2be1bd1f5575d7863e10c6e12504f240fd06660",
|
||||
"sha256:7b6be138d61e458e18d8e6ddcddd36dd96215edfe5f1168de0b1b32635839b62",
|
||||
"sha256:7ccf362abd726b0410bf8911c31fbf97f09f8f1061f8c1cf03dfc4b6372848f6",
|
||||
"sha256:83516205e254a0cb77d2d7bb3632ee019d93d9f4005de31dca0a8c3667d5bc04",
|
||||
"sha256:851cf4ff24062c6aec510a454b2584f6e998cada52d4cb58c5e233d07172e50c",
|
||||
"sha256:8f830ed581b45b82451a40faabb89c84e1a998124ee4212d440e9c6cf70083e5",
|
||||
"sha256:94e2565443291bd778421856bc975d351738963071e9b8839ca1fc08b42d4bef",
|
||||
"sha256:95203854f974e07af96358c0b261f1048d8e1083f2de9b1c565e1be4a3a48cfc",
|
||||
"sha256:97117225cdd992a9c2a5515db1f66b59db634f59d0679ca1fa3fe8da32749cae",
|
||||
"sha256:98e8a10b7a314f454d9eff4216a9a94d143a7ee65018dd12442e898ee2310578",
|
||||
"sha256:a1170fa54185845505fbfa672f1c1ab175446c887cce8212c44149581cf2d466",
|
||||
"sha256:a6b7d95969b8845250586f269e81e5dfdd8ff828ddeb8567a4a2eaa7313460c4",
|
||||
"sha256:a8fb6cf131ac4070c9c5a3e21de0f7dc5a0fbe8bc77c9456ced896c12fcdad91",
|
||||
"sha256:af4fffaffc4067232253715065e30c5a7ec6faac36f8fc8d6f64263b15f74db0",
|
||||
"sha256:b4a5be1748d538a710f87542f22c2cad22f80545a847ad91ce45e77417293eb4",
|
||||
"sha256:b5604380f3415ba69de87a289a2b56687faa4fe04dbee0754bfcae433489316b",
|
||||
"sha256:b9023e237f4c02ff739581ef35969c3739445fb059b060ca51771e69101efffe",
|
||||
"sha256:bc8ef5e043a2af066fa8cbfc6e708d58017024dc4345a1f9757b329a249f041b",
|
||||
"sha256:c4ed2820d919351f4167e52425e096af41bfabacb1857186c1ea32ff9983ed75",
|
||||
"sha256:cca4435eebea7962a52bdb216dec27215d0df64cf27fc1dd538415f5d2b9da6b",
|
||||
"sha256:d900bb429fdfd7f511f868cedd03a6bbb142f3f9118c09b99ef8dc9bf9643c3c",
|
||||
"sha256:d9ecf0829c6a62b9b573c7bb6d4dcd6ba8b6f80be9ba4fc7ed50bf4ac9aecd72",
|
||||
"sha256:dbdb91cd8c048c2b09eb17713b0c12a54fbd587d79adcebad543bc0cd9a3410b",
|
||||
"sha256:de3001a203182842a4630e7b8d1a2c7c07ec1b45d3084a83d5d227a3806f530f",
|
||||
"sha256:e07f4a4a9b41583d6eabec04f8b68076ab3cd44c20bd29332c6572dda36f372e",
|
||||
"sha256:ef8674b0ee8cc11e2d574e3e2998aea5df5ab242e012286824ea3c6970580e53",
|
||||
"sha256:f4f05d88d9a80ad3cac6244d36dd89a3c00abc16371769f1340101d3cb899fc3",
|
||||
"sha256:f642e90754ee3e06b0e7e51bce3379590e76b7f76b708e1a71ff043f87025c84",
|
||||
"sha256:fc2af30ed0d5ae0b1abdb4ebdce598eafd5b35397d4d75deb341a614d333d987"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==6.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
22
README.md
22
README.md
@@ -4,11 +4,11 @@ This python namespace is made for applied Numeric Calculus of Linear Algebra. It
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
* Write a matrix into a *csv* file.
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Calculate Eigen Values
|
||||
* Calculate Eigenvalues and his Eigenvectors.
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
@@ -20,29 +20,27 @@ This python namespace is made for applied Numeric Calculus of Linear Algebra. It
|
||||
|
||||
## Syntax
|
||||
|
||||
To call the package *scan* use the syntax: `from Seals import scan`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and used the following syntax `scan.np(path)` for *Numpy* and `scan.pd(path)` for *Pandas*, where `path` is the path to your directory.
|
||||
To call the package *scan* use the syntax: `from yoshi_seals import scan`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and used the following syntax `scan.np(path)` for *Numpy* and `scan.pd(path)` for *Pandas*, where `path` is the path to your directory.
|
||||
|
||||
To call the package *write* use the syntax: `from Seals import write`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and uses the following syntax `write.np(array,path)` for *Numpy*, where `array` is the matrix that you desire to output and `path` is the path to your directory, and `write.pd(df,path)` for *Pandas*, where `df` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
To call the package *write* use the syntax: `from yoshi_seals import write`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and uses the following syntax `write.np(array,path)` for *Numpy*, where `array` is the matrix that you desire to output and `path` is the path to your directory, and `write.pd(df,path)` for *Pandas*, where `df` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
To call the package *insert* use the syntax: `from Seals import insert`. The package also has a function for *matrix* and another for *vector*, and it has the following syntax `insert.function(array)`, where `insert` is the *Python Module* and `function` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
To call the package *insert* use the syntax: `from yoshi_seals import insert`. The package also has a function for *matrix* and another for *vector*, and it has the following syntax `insert.function(array)`, where `insert` is the *Python Module* and `function` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
There is also a function that given a matrix it return all real eigen values
|
||||
There is also a function that given a matrix it return all real eigenvalues and all real eigenvectors, this function uses the power method to find the eigenvalues and inverse power method for the eigenvector.
|
||||
|
||||
### Processes
|
||||
|
||||
To call the module `process` use the syntax: `from Seals import process as sl`, where `sl` is an instance and to use a function you have to append the desired function in front of the instance like: `sl.identity(array)`.
|
||||
To call the module `process` use the syntax: `from yoshi_seals import process as sl`, where `sl` is an alias and will be used to call functions: `sl.inverse(array)`.
|
||||
|
||||
* The function *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The function *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
* The function *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The function *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
* The function *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.decomposition(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
* The function *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cramer(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
20
makefile
Normal file
20
makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
WORK=./yoshi_seals
|
||||
PROCESS=$(WORK)/process
|
||||
SHARED=$(WORK)/shared
|
||||
|
||||
SETUP_CYTHON=setup_cython.py
|
||||
|
||||
OBJS= $(PROCESS)/process.pyx $(SHARED)/array.pyx $(SETUP_CYTHON)
|
||||
|
||||
PYTHON?=python
|
||||
PARALLEL?=$(shell ${PYTHON} -c 'import sys; print("-j5" if sys.version_info >= (3,5) else "")' || true)
|
||||
|
||||
all: $(OBJS)
|
||||
python3 $(SETUP_CYTHON) build_ext --inplace $(PARALLEL) && \
|
||||
rm -r build
|
||||
|
||||
clean:
|
||||
|
||||
rm $(WORK)/**/*.cpython-310-x86_64-linux-gnu.so
|
||||
rm $(WORK)/**/*.c
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
import setuptools
|
||||
import os
|
||||
|
||||
__name = "yoshi-seals"
|
||||
|
||||
__version_sufix = os.environ.get('VERSION_SUFIX')
|
||||
if not __version_sufix:
|
||||
__version_sufix = "dev"
|
||||
|
||||
__version = f"2.0.{__version_sufix}"
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
setuptools.setup(
|
||||
name="yoshi-seals",
|
||||
version="1.2",
|
||||
name=__name,
|
||||
version=__version,
|
||||
author="Vitor Hideyoshi",
|
||||
author_email="vitor.h.n.batista@gmail.com",
|
||||
description="Numeric Calculus python module in the topic of Linear Algebra",
|
||||
@@ -16,12 +25,11 @@ setuptools.setup(
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
||||
"Operating System :: OS Independent",
|
||||
"Development Status :: 2 - Pre-Alpha",
|
||||
"Operating System :: OS Independent"
|
||||
],
|
||||
python_requires='>=3.6',
|
||||
install_requires=[
|
||||
'numpy',
|
||||
'pandas',
|
||||
],
|
||||
)
|
||||
'numpy',
|
||||
'pandas',
|
||||
],
|
||||
)
|
||||
29
setup_cython.py
Normal file
29
setup_cython.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import numpy
|
||||
from Cython.Build import cythonize
|
||||
from setuptools import Extension, setup
|
||||
|
||||
ext_modules = [
|
||||
Extension(
|
||||
"yoshi_seals.shared.array",
|
||||
[
|
||||
"yoshi_seals/shared/array.pyx",
|
||||
],
|
||||
extra_compile_args=["-O3", "-fopenmp"],
|
||||
extra_link_args=['-fopenmp'],
|
||||
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
|
||||
),
|
||||
Extension(
|
||||
"yoshi_seals.process.process",
|
||||
[
|
||||
"yoshi_seals/process/process.pyx",
|
||||
],
|
||||
extra_compile_args=["-O3", "-fopenmp"],
|
||||
extra_link_args=['-fopenmp'],
|
||||
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
|
||||
),
|
||||
]
|
||||
|
||||
setup(
|
||||
ext_modules=cythonize(ext_modules),
|
||||
include_dirs=[numpy.get_include()]
|
||||
)
|
||||
0
test/__init__.py
Normal file
0
test/__init__.py
Normal file
90
test/test_process.py
Normal file
90
test/test_process.py
Normal file
@@ -0,0 +1,90 @@
|
||||
from yoshi_seals import process as ps
|
||||
|
||||
import numpy as np
|
||||
|
||||
from numpy import testing as npt
|
||||
import unittest
|
||||
|
||||
|
||||
class TestProcess(unittest.TestCase):
|
||||
|
||||
def test_det(self):
|
||||
a = np.array(([1., 0.], [0., 1.]))
|
||||
|
||||
a_det = ps.det(a)
|
||||
|
||||
self.assertEqual(a_det, 1)
|
||||
|
||||
def test_inverse(self):
|
||||
a = np.array(([1., 0.], [0., 1.]))
|
||||
a_inv = ps.inverse(a)
|
||||
|
||||
npt.assert_array_equal(a, a_inv)
|
||||
|
||||
def test_hstack_returns_stacked_array(self):
|
||||
a = np.array(([1., ], [1., ]))
|
||||
b = np.array(([1., ], [1., ]))
|
||||
|
||||
stacked = ps.hstack(a, b)
|
||||
expected_stacked_array = np.array(([1., 1.], [1., 1.]))
|
||||
|
||||
npt.assert_array_equal(stacked, expected_stacked_array)
|
||||
|
||||
def test_hstack_throws_exception(self):
|
||||
a = np.array(([1., ], [1., ]))
|
||||
b = np.array(([1., ]))
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
ps.hstack(a, b)
|
||||
|
||||
def test_vstack_returns_stacked_array(self):
|
||||
a = np.array(([[1., 1.]]))
|
||||
b = np.array(([[1., 1.]]))
|
||||
|
||||
stacked = ps.vstack(a, b)
|
||||
expected_stacked_array = np.array(([1., 1.], [1., 1.]))
|
||||
|
||||
npt.assert_array_equal(stacked, expected_stacked_array)
|
||||
|
||||
def test_vstack_throws_exception(self):
|
||||
a = np.array(([[1., 1.]]))
|
||||
b = np.array(([[1.]]))
|
||||
|
||||
with self.assertRaises(ValueError):
|
||||
ps.vstack(a, b)
|
||||
|
||||
def test_gauss(self):
|
||||
a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.]))
|
||||
b = np.array(([44.], [128.], [214.]))
|
||||
|
||||
matrix = ps.gauss(a, b)
|
||||
expected_matrix = np.array([[-8.], [6.], [2.]])
|
||||
|
||||
npt.assert_almost_equal(matrix, expected_matrix)
|
||||
|
||||
def test_cholesky(self):
|
||||
a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.]))
|
||||
b = np.array(([44.], [128.], [214.]))
|
||||
|
||||
matrix = ps.cholesky(a, b)
|
||||
expected_matrix = np.array([[-8.], [6.], [2.]])
|
||||
|
||||
npt.assert_almost_equal(matrix, expected_matrix)
|
||||
|
||||
def test_decomposition(self):
|
||||
a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.]))
|
||||
b = np.array(([44.], [128.], [214.]))
|
||||
|
||||
matrix = ps.decomposition(a, b)
|
||||
expected_matrix = np.array([[-8.], [6.], [2.]])
|
||||
|
||||
npt.assert_almost_equal(matrix, expected_matrix)
|
||||
|
||||
def test_cramer(self):
|
||||
a = np.array(([4., 10., 8.], [10., 26., 26], [8., 26., 61.]))
|
||||
b = np.array(([44.], [128.], [214.]))
|
||||
|
||||
matrix = ps.cramer(a, b)
|
||||
expected_matrix = np.array([[-8.], [6.], [2.]])
|
||||
|
||||
npt.assert_almost_equal(matrix, expected_matrix)
|
||||
Binary file not shown.
@@ -1,278 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
@@ -1,55 +0,0 @@
|
||||
# Seals - Numeric Calculus
|
||||
|
||||
This python namespace is made for applied Numeric Calculus of Linear Algebra. It is made with the following objectives in mind:
|
||||
|
||||
* Scan *csv* files to make a numpy matrix.
|
||||
|
||||
* Write a matrix into a *csv* file
|
||||
|
||||
* Insert user input into a matrix or a vector.
|
||||
|
||||
* Calculate Eigen Values
|
||||
|
||||
* Use methods to proccess the matrices.
|
||||
* Identity Matrix
|
||||
* Gauss Elimination
|
||||
* Inverse Matrix
|
||||
* Cholesky Decomposition
|
||||
* LU Decomposition
|
||||
* Cramer
|
||||
|
||||
## Syntax
|
||||
|
||||
To call the package *scan* use the syntax: `from Seals import scan`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and used the following syntax `scan.np(path)` for *Numpy* and `scan.pd(path)` for *Pandas*, where `path` is the path to your directory.
|
||||
|
||||
To call the package *write* use the syntax: `from Seals import write`. The package also has a function for *Numpy* arrays and *Pandas* dataframes, and uses the following syntax `write.np(array,path)` for *Numpy*, where `array` is the matrix that you desire to output and `path` is the path to your directory, and `write.pd(df,path)` for *Pandas*, where `df` is the matrix that you desire to output and `path` is the path to your directory.
|
||||
|
||||
To call the package *insert* use the syntax: `from Seals import insert`. The package also has a function for *matrix* and another for *vector*, and it has the following syntax `insert.function(array)`, where `insert` is the *Python Module* and `function` is either a `matrix` or a `vector` and `array` is either a *matrix* or a *vector*.
|
||||
|
||||
There is also a function that given a matrix it return all real eigen values
|
||||
|
||||
### Processes
|
||||
|
||||
To call the module `process` use the syntax: `from Seals import process as sl`, where `sl` is an instance and to use a function you have to append the desired function in front of the instance like: `sl.identity(array)`.
|
||||
|
||||
* The function *identity* returns a *numpy* identity matrix of the order of the matrix passed into to it, and it has the following syntax `sl.identity(array)`, which `array` is a square matrix.
|
||||
|
||||
* The function *gauss* returns a *numpy* vector containing the vector of variables from the augmented matrix. `sl.gauss(matrix)`, which `matrix` is the augmented matrix.
|
||||
|
||||
* The function *inverse* returns a *numpy* inverse matrix of the matrix passed into to it, and it has the following syntax `sl.inverse(matrix)`, which `matrix` is a square matrix.
|
||||
|
||||
* The function *cholesky* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *decomposition* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
* The function *cramer* returns a *numpy* vector containing the vector of variables from the coefficient matrix and the constants vector, and it has the following syntax `sl.cholesky(A,b)`, which `A` is the coefficient matrix and `b` is the constants vector.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the package from source `cd` into the directory and run:
|
||||
|
||||
`pip install .`
|
||||
|
||||
or run
|
||||
|
||||
`pip install yoshi-seals`
|
||||
@@ -1,18 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .eigen import eigen
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,51 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
|
||||
def eigen(a):
|
||||
|
||||
k = 0
|
||||
l = np.ones((a.shape[0]))
|
||||
|
||||
while (k < a.shape[0]):
|
||||
|
||||
u = np.random.rand(a.shape[0],1)
|
||||
u = u/max(u.min(), u.max(), key=abs)
|
||||
|
||||
ctrl = 0
|
||||
|
||||
while (ctrl != l[k]):
|
||||
|
||||
ctrl = l[k]
|
||||
u = a.dot(u)
|
||||
l[k] = max(u.min(), u.max(), key=abs)
|
||||
u = u/l[k]
|
||||
|
||||
|
||||
i = 0
|
||||
|
||||
while (u[i] == 0):
|
||||
i += 1
|
||||
|
||||
a = a - (1/u[i])*u*a[i]
|
||||
|
||||
k += 1
|
||||
|
||||
return l
|
||||
@@ -1,21 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .insert import matrix
|
||||
from .insert import vector
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,46 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
def matrix(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[1]):
|
||||
|
||||
matrix[i][j] = float(input('Insira o elemento {}x{}: '.format((i+1),(j+1))))
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def vector(vector):
|
||||
|
||||
j=0
|
||||
|
||||
while (j < vector.shape[0]):
|
||||
|
||||
vector[j] = float(input('Insira o elemento b{}: '.format((j+1))))
|
||||
j += 1
|
||||
|
||||
return vector
|
||||
@@ -1,25 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .process import identity
|
||||
from .process import gauss
|
||||
from .process import inverse
|
||||
from .process import cholesky
|
||||
from .process import decomposition
|
||||
from .process import cramer
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,203 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import math
|
||||
|
||||
def identity(matrix):
|
||||
|
||||
i = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
j = 0
|
||||
|
||||
while (j < matrix.shape[0]):
|
||||
|
||||
if (i == j):
|
||||
|
||||
matrix[i][j] = 1
|
||||
|
||||
elif (i != j):
|
||||
|
||||
matrix[i][j] = 0
|
||||
|
||||
j += 1
|
||||
|
||||
i += 1
|
||||
|
||||
return matrix
|
||||
|
||||
def gauss(matrix):
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < matrix.shape[0]):
|
||||
|
||||
if (matrix[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (matrix[i][i] == 0) and (n < matrix.shape[0]):
|
||||
|
||||
temp = matrix[i].copy()
|
||||
matrix[i] = matrix[n]
|
||||
matrix[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < matrix.shape[0]):
|
||||
|
||||
if (k == i) or (matrix[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
|
||||
mult = matrix[k][i]/matrix[i][i]
|
||||
matrix[k] = matrix[k] - mult*matrix[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
k = 0
|
||||
|
||||
i = 0
|
||||
|
||||
while ((i) < matrix.shape[0]) and (matrix[i][i] != 0):
|
||||
|
||||
matrix[i] = matrix[i]/matrix[i][i]
|
||||
i += 1
|
||||
|
||||
return matrix[:,(matrix.shape[0]):]
|
||||
|
||||
def inverse(matrix):
|
||||
|
||||
return gauss(np.hstack((matrix, identity(np.zeros(matrix.shape)))))
|
||||
|
||||
def cholesky(A, b):
|
||||
|
||||
g = np.zeros((A.shape))
|
||||
|
||||
i = 0
|
||||
j = 0
|
||||
|
||||
while j < A.shape[1]:
|
||||
while i < A.shape[0]:
|
||||
|
||||
if i == 0 and j == 0:
|
||||
|
||||
g[i][j] = math.sqrt(A[0][0])
|
||||
|
||||
elif j == 0:
|
||||
|
||||
g[i][j] = A[i][0]/g[0][0]
|
||||
|
||||
elif i == j:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < i:
|
||||
|
||||
theta += g[i][k]**2
|
||||
k += 1
|
||||
|
||||
g[i][j] = math.sqrt(A[i][i] - theta)
|
||||
|
||||
else:
|
||||
|
||||
k = 0
|
||||
theta = 0
|
||||
|
||||
while k < j:
|
||||
|
||||
theta += g[i][k]*g[j][k]
|
||||
k += 1
|
||||
|
||||
g[i][j] = (A[i][j] - theta)/g[j][j]
|
||||
|
||||
i += 1
|
||||
|
||||
j += 1
|
||||
i = j
|
||||
|
||||
y = (inverse(g)).dot(b)
|
||||
|
||||
x = (inverse(g.T)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def decomposition(U, b):
|
||||
|
||||
L = identity(np.zeros(U.shape))
|
||||
|
||||
i = 0
|
||||
k = 0
|
||||
|
||||
while (i < U.shape[0]):
|
||||
|
||||
k = 0
|
||||
|
||||
if (U[i][i] == 0):
|
||||
|
||||
n = i
|
||||
|
||||
while (U[i][i] == 0) and (n < U.shape[0]):
|
||||
|
||||
temp = U[i].copy()
|
||||
U[i] = U[n]
|
||||
U[n] = temp
|
||||
|
||||
n += 1
|
||||
|
||||
while (k < U.shape[0]):
|
||||
|
||||
if (k <= i) or (U[i][i] == 0):
|
||||
|
||||
k += 1
|
||||
|
||||
else:
|
||||
L[k][i] = U[k][i]/U[i][i]
|
||||
U[k] = U[k] - L[k][i]*U[i]
|
||||
k += 1
|
||||
|
||||
i += 1
|
||||
|
||||
y = (inverse(L)).dot(b)
|
||||
|
||||
x = (inverse(U)).dot(y)
|
||||
|
||||
return x
|
||||
|
||||
def cramer(A, b):
|
||||
|
||||
x = np.vstack(np.zeros(b.shape))
|
||||
k = 0
|
||||
|
||||
while (k < A.shape[0]):
|
||||
|
||||
temp = A.copy()
|
||||
temp[:,k] = b
|
||||
|
||||
x[k] = np.linalg.det(temp)/np.linalg.det(A)
|
||||
|
||||
k += 1
|
||||
|
||||
return x
|
||||
@@ -1,21 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
from .scan import numpy as np
|
||||
from .scan import pandas as pd
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,45 +0,0 @@
|
||||
# Seals - Program made for educational intent, can be freely distributed
|
||||
# and can be used for economical intent. I will not take legal actions
|
||||
# unless my intelectual propperty, the code, is stolen or change without permission.
|
||||
|
||||
# Copyright (C) 2020 VItor Hideyoshi Nakazone Batista
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License version 2 as published by
|
||||
# the Free Software Foundation.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU General Public License along
|
||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
def numpy(path, sep=None, decimal=None):
|
||||
|
||||
if sep is None:
|
||||
sep = ","
|
||||
|
||||
if decimal is None:
|
||||
decimal = "."
|
||||
|
||||
df=pd.read_csv(path, sep=sep, decimal=decimal, header=None)
|
||||
array = df.to_numpy()
|
||||
|
||||
return array
|
||||
|
||||
def pandas(path, sep=None, decimal=None):
|
||||
|
||||
if sep is None:
|
||||
sep = ","
|
||||
|
||||
if decimal is None:
|
||||
decimal = "."
|
||||
|
||||
return pd.read_csv(path, sep=sep, decimal=decimal)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user