Merge branch 'future'
This commit is contained in:
BIN
Source Code - Seals/process/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
Source Code - Seals/process/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
Source Code - Seals/process/__pycache__/process.cpython-38.pyc
Normal file
BIN
Source Code - Seals/process/__pycache__/process.cpython-38.pyc
Normal file
Binary file not shown.
@@ -44,8 +44,48 @@ def identity(matrix):
|
|||||||
|
|
||||||
return matrix
|
return matrix
|
||||||
|
|
||||||
def gauss(matrix):
|
def gauss(a):
|
||||||
|
|
||||||
|
for i in range(a.shape[0]):
|
||||||
|
|
||||||
|
k = i + 1
|
||||||
|
|
||||||
|
while (k<a.shape[0]):
|
||||||
|
|
||||||
|
l = 1
|
||||||
|
while (a[i][i] == 0 and l < a.shape[0]):
|
||||||
|
|
||||||
|
temp = a[i].copy()
|
||||||
|
a[i] = a[i+l]
|
||||||
|
a[i+l] = temp
|
||||||
|
|
||||||
|
l += 1
|
||||||
|
|
||||||
|
if (a[k][i] == 0):
|
||||||
|
while (k < a.shape[0]):
|
||||||
|
k += 1
|
||||||
|
|
||||||
|
else:
|
||||||
|
|
||||||
|
a[k] = a[k] - (a[k][i]/a[i][i])*a[i]
|
||||||
|
k += 1
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
x = np.zeros(a.shape[0])
|
||||||
|
|
||||||
|
for j in reversed(range(x.shape[0])):
|
||||||
|
|
||||||
|
suma = 0
|
||||||
|
for k in range (j,a.shape[0]):
|
||||||
|
suma += a[j][k]*x[k]
|
||||||
|
x[j] = (a[j][a.shape[0]] - suma)/a[j][j]
|
||||||
|
|
||||||
|
return x
|
||||||
|
|
||||||
|
def inverse(matrix):
|
||||||
|
|
||||||
|
matrix = np.hstack(matrix,np.identity(matrix.shape[0]))
|
||||||
i = 0
|
i = 0
|
||||||
k = 0
|
k = 0
|
||||||
|
|
||||||
@@ -65,7 +105,7 @@ def gauss(matrix):
|
|||||||
|
|
||||||
while (k < matrix.shape[0]):
|
while (k < matrix.shape[0]):
|
||||||
|
|
||||||
if (k == i) or (matrix[i][i] == 0):
|
if (k == i) or (matrix[k][i] == 0) or (matrix[i][i] == 0):
|
||||||
|
|
||||||
k += 1
|
k += 1
|
||||||
|
|
||||||
@@ -87,10 +127,6 @@ def gauss(matrix):
|
|||||||
|
|
||||||
return matrix[:,(matrix.shape[0]):]
|
return matrix[:,(matrix.shape[0]):]
|
||||||
|
|
||||||
def inverse(matrix):
|
|
||||||
|
|
||||||
return gauss(np.hstack((matrix, identity(np.zeros(matrix.shape)))))
|
|
||||||
|
|
||||||
def cholesky(A, b):
|
def cholesky(A, b):
|
||||||
|
|
||||||
g = np.zeros((A.shape))
|
g = np.zeros((A.shape))
|
||||||
|
|||||||
BIN
yoshi-seals1.3.3/Seals/scan/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
yoshi-seals1.3.3/Seals/scan/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
yoshi-seals1.3.3/Seals/scan/__pycache__/scan.cpython-38.pyc
Normal file
BIN
yoshi-seals1.3.3/Seals/scan/__pycache__/scan.cpython-38.pyc
Normal file
Binary file not shown.
@@ -20,18 +20,12 @@
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
def numpy(path, sep=None, decimal=None):
|
def numpy(path, sep=None):
|
||||||
|
|
||||||
if sep is None:
|
if sep is None:
|
||||||
sep = ","
|
sep = ","
|
||||||
|
|
||||||
if decimal is None:
|
return np.genfromtxt(path, delimiter=sep)
|
||||||
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):
|
def pandas(path, sep=None, decimal=None):
|
||||||
|
|
||||||
|
|||||||
@@ -17,5 +17,8 @@
|
|||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
from .write import numpy as np
|
from .write import numpy
|
||||||
from .write import pandas as pd
|
from .write import pandas
|
||||||
|
|
||||||
|
np = numpy()
|
||||||
|
pd = pandas()
|
||||||
|
|||||||
BIN
yoshi-seals1.3.3/Seals/write/__pycache__/__init__.cpython-38.pyc
Normal file
BIN
yoshi-seals1.3.3/Seals/write/__pycache__/__init__.cpython-38.pyc
Normal file
Binary file not shown.
BIN
yoshi-seals1.3.3/Seals/write/__pycache__/write.cpython-38.pyc
Normal file
BIN
yoshi-seals1.3.3/Seals/write/__pycache__/write.cpython-38.pyc
Normal file
Binary file not shown.
@@ -18,16 +18,34 @@
|
|||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
import csv
|
import csv
|
||||||
|
import numpy as np
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
def numpy(array, path):
|
class numpy:
|
||||||
|
|
||||||
with open(path, mode='w') as sistema_linear:
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
def csv(self, array, path):
|
||||||
|
|
||||||
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
with open(path, mode='w') as sistema_linear:
|
||||||
solution_writer.writerows(array)
|
|
||||||
|
|
||||||
return array
|
solution_writer = csv.writer(sistema_linear, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
|
||||||
|
solution_writer.writerows(array)
|
||||||
|
|
||||||
def pandas(df, path):
|
def txt(self, array, path):
|
||||||
|
|
||||||
df.to_csv(path)
|
np.savetxt(path, array, fmt='%8f', delimiter=' ', \
|
||||||
|
newline='\n', header='', footer='', comments='# ', encoding=None)
|
||||||
|
|
||||||
|
class pandas:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
def csv(self, df, path):
|
||||||
|
|
||||||
|
df.to_csv(path)
|
||||||
|
|
||||||
|
def txt(self, df, path):
|
||||||
|
|
||||||
|
np.savetxt(path, df.values, fmt='%8f', delimiter=' ', \
|
||||||
|
newline='\n', header='', footer='', comments='# ', encoding=None)
|
||||||
|
|||||||
Reference in New Issue
Block a user