-
Notifications
You must be signed in to change notification settings - Fork 0
Linear Algebra
This code is for linear algebra functions on astrophysical systems (but can also be used generally).
The code is original but based off of multiple pseudo-algorithms and mathematical formulae.
Copyright © 2025 RandomKiddo
LU Decomposition (Doolittle's Method):
Decomposition of the square matrix
The upper matrix is calculated such that,
and the lower matrix,
Both matrices are initially set to be zero matrices. For more information, see GeeksForGeeks.
Importing the subpackage can be done (if installed through PyPI or equiv.):
from astrocore import linalgor
from astrocore.linalg import *This subpackage can only be used in Python directly (due to the difficulties of representing matrices in the command line). You can define whatever matrices and variables you need and solve:
from astrocore.linalg import lu_decomposition
# Driver code from GeeksForGeeks.
mat = [[2, -1, -2],
[-4, 6, 3],
[-4, -2, 8]]
lu_decomposition(mat, n=3)This page was last edited on 11.14.2025