v1.3.1
This commit is contained in:
18
yoshi-seals1.3.1/Seals/__init__.py
Normal file
18
yoshi-seals1.3.1/Seals/__init__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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.
|
||||
BIN
yoshi-seals1.3.1/Seals/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
20
yoshi-seals1.3.1/Seals/eigen/__init__.py
Normal file
20
yoshi-seals1.3.1/Seals/eigen/__init__.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# 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
|
||||
BIN
yoshi-seals1.3.1/Seals/eigen/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/eigen/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
yoshi-seals1.3.1/Seals/eigen/__pycache__/eigen.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/eigen/__pycache__/eigen.cpython-37.pyc
Normal file
Binary file not shown.
51
yoshi-seals1.3.1/Seals/eigen/eigen.py
Normal file
51
yoshi-seals1.3.1/Seals/eigen/eigen.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# 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
|
||||
21
yoshi-seals1.3.1/Seals/insert/__init__.py
Normal file
21
yoshi-seals1.3.1/Seals/insert/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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.
BIN
yoshi-seals1.3.1/Seals/insert/__pycache__/insert.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/insert/__pycache__/insert.cpython-37.pyc
Normal file
Binary file not shown.
46
yoshi-seals1.3.1/Seals/insert/insert.py
Normal file
46
yoshi-seals1.3.1/Seals/insert/insert.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# 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
|
||||
25
yoshi-seals1.3.1/Seals/process/__init__.py
Normal file
25
yoshi-seals1.3.1/Seals/process/__init__.py
Normal file
@@ -0,0 +1,25 @@
|
||||
# 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.
203
yoshi-seals1.3.1/Seals/process/process.py
Normal file
203
yoshi-seals1.3.1/Seals/process/process.py
Normal file
@@ -0,0 +1,203 @@
|
||||
# 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
|
||||
21
yoshi-seals1.3.1/Seals/scan/__init__.py
Normal file
21
yoshi-seals1.3.1/Seals/scan/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
BIN
yoshi-seals1.3.1/Seals/scan/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/scan/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
yoshi-seals1.3.1/Seals/scan/__pycache__/scan.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/scan/__pycache__/scan.cpython-37.pyc
Normal file
Binary file not shown.
45
yoshi-seals1.3.1/Seals/scan/scan.py
Normal file
45
yoshi-seals1.3.1/Seals/scan/scan.py
Normal file
@@ -0,0 +1,45 @@
|
||||
# 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)
|
||||
|
||||
21
yoshi-seals1.3.1/Seals/write/__init__.py
Normal file
21
yoshi-seals1.3.1/Seals/write/__init__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# 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
|
||||
BIN
yoshi-seals1.3.1/Seals/write/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/write/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
yoshi-seals1.3.1/Seals/write/__pycache__/write.cpython-37.pyc
Normal file
BIN
yoshi-seals1.3.1/Seals/write/__pycache__/write.cpython-37.pyc
Normal file
Binary file not shown.
33
yoshi-seals1.3.1/Seals/write/write.py
Normal file
33
yoshi-seals1.3.1/Seals/write/write.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# 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)
|
||||
Reference in New Issue
Block a user