implement ground functions(?), formatting
This commit is contained in:
1 parent
fe24efff50
commit
34eab5446c
4 files changed
+25
-4
No files matched your search
@@ -0,0 +1,3 @@
|
||||
# this
|
||||
|
||||
is a lot of custom matrices
|
||||
@@ -0,0 +1,18 @@
|
||||
"""give me a 3x3 matrix and a 3 dim vector
|
||||
|
||||
i give you the roots back using either gauss-seidel or jacobi"""
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
def stupid(A: np.typing.NDArray, b: np.typing.NDArray) -> np.typing.NDArray:
|
||||
"they say that in the slides the second method because operator\\ doesnt exist in python"
|
||||
return np.linalg.matmul(np.linalg.inv(A), b) # unbelievable
|
||||
# how tf did matlab implement operator\
|
||||
|
||||
|
||||
def real(A: np.typing.NDArray, b: np.typing.NDArray) -> np.typing.NDArray:
|
||||
return np.linalg.solve(A, b) # this uses the lu
|
||||
|
||||
|
||||
# im actually forgetting yall linear algebra is ass
|
||||
@@ -22,7 +22,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -51,9 +51,6 @@
|
||||
"# how do i import file\n",
|
||||
"# shit i shot myself in the foot here, gotta consult github.com/ldlda/unipy\n",
|
||||
"from importutil import why_so_ass\n",
|
||||
" ## this line right here\n",
|
||||
" ## why do i need it to exec EVER WHY no i dont WHYYYYY\n",
|
||||
" # if i do from tutorial import bungee_jumper in tutorial2.ipynb it dont do that # oh it does\n",
|
||||
"from pathlib import Path\n",
|
||||
"\n",
|
||||
"tutofile = Path(\"../../0/tutorial.py\")\n",
|
||||
|
||||
@@ -22,3 +22,6 @@ def why_so_ass(file: Path | str, name: str, namesys: str = None):
|
||||
mod = importlib.util.module_from_spec(spec)
|
||||
modules[namesys] = mod # !!
|
||||
spec.loader.exec_module(mod)
|
||||
## this line right here
|
||||
## why do i need it to exec EVER WHY no i dont WHYYYYY
|
||||
# if i do from tutorial import bungee_jumper in tutorial2.ipynb it dont do that # oh it does
|
||||
Reference in new issue
Block a user