Skip to content

Instantly share code, notes, and snippets.

View ialexpovad's full-sized avatar
:electron:
I may be slow to respond.

nystagmus ialexpovad

:electron:
I may be slow to respond.
View GitHub Profile
@ialexpovad
ialexpovad / inverse_matrix.py
Last active June 16, 2021 11:46
Determining the inevre matrix
'''
Program for determining the inverse matrix
without using additional modules NumPy or SciPy.
######################################################
Ax=b -> A^(-1)Ax=A^(-1)b -> Ix=A^(-1)b -> x=A^(-1)b #
######################################################
'''
def printout_matrix(title_matrix, matrix):
'''
@ialexpovad
ialexpovad / solve_equation.py
Created June 16, 2021 12:58
Solving a system of linear algebraic equations using the inverse matrix without the use of modules NumPy/SciPy.
'''
Program for determining the inverse matrix and solve
system linear equation without using additional
modules NumPy or SciPy.
######################################################
Ax=b -> A^(-1)Ax=A^(-1)b -> Ix=A^(-1)b -> x=A^(-1)b #
######################################################
'''
def printout_matrix(title_matrix, matrix):
def determinant(A, output=0):
'''
The function return determinant of a square matrix using full recursion.
output=0 - etablish a output at each recursion level.
'''
# Store indices in list for row referencing
index=list(range(len(A)))
# If at 2 x 2 submatrices recursive calls end
@ialexpovad
ialexpovad / sum.py
Last active June 16, 2021 17:30
The function return result additional two value (matricies, number, string)
def sum(A,B):
'''
The function return result
additional two matrices.
parametr A: First variable m x n
parametr B: Second variable k x p
...
return C: result additional
'''
# Ensure dimensions are valid for matrix additional
@ialexpovad
ialexpovad / difference.py
Last active June 16, 2021 18:17
The function return defferentail number and matricies
def difference(A,B):
'''
The function return defferentail number and matricies.
parametr A: First variable
parametr B: Second variable
...
return C: result difference
'''
if type(A)==int and type(B)==int or \
type(A)==float and type(B)==float:
#importing the packages
import numpy as np
import matplotlib.pyplot as plt
#Defining the delta function
def delta(n):
if n == 0:
return 1
else:
return 0
@ialexpovad
ialexpovad / Docs | Use Markdown.md
Last active June 29, 2021 08:55
Markdown is a quick way to enter text with formatting, allowing you to write documents smoothly and at one stretch. For example, by typing #space, you can quickly enter a title.

Markdown you should know about:

Heading 1: # [space] or === or <h1>Heading 1</h1>

Heading 2: ## [space] or --- or <h1>Heading 2</h2> 

Heading 3: ### [space] or <h1>Heading 3</h3> 

Heading 4: #### [space] or <h1>Heading 4</h4> 
...
@ialexpovad
ialexpovad / Matrix Inversion | Code.py
Last active June 30, 2021 15:10
Matrix inversion without NumPy/SciPy
# Program for determining the inverse matrix and solve
# system linear equation without using additional modules NumPy / SciPy
import sys
def inv(A):
'''
The function returns the inverse of the passed in matrix.
– parametr A: The matrix to be inversed.
– return: The inverse of the matrix A.
'''
# Initializing the main values.
class iset(object):
# matrix = []
def __init__(self, mat = []):
# method - __init__ - constructor
self.matrix = mat
def __xor__(self, other):
value_1 = self - other
value_2 = other - self
# Толкачев мне сразу непонятно мне объяснил зачем менять эту дату, подумал о дате на текущий момент
# потому и стал выводить сегодняшнюю дату
from datetime import datetime
today = datetime.now().strftime('%m/%d/%Y %H:%M:%S')
# Как цикл написал, то и понял что это необходимо GARM
# Который по дефолту принимает файл с необходимым форматом даты (со временем понятно)
import os
# chardet - класс по определению кодировки, а UniversalDetector это уже функция, которая нам и поможет
# вернуть словарь с кодировкой, языком...
from chardet.universaldetector import UniversalDetector