Skip to content

Instantly share code, notes, and snippets.

View nyameko's full-sized avatar

Nyameko Lisa nyameko

  • CSIR: National Laser Center
  • Pretoria, South Africa
View GitHub Profile
@nyameko
nyameko / TDMAsolver.py
Created June 15, 2018 13:58 — forked from TheoChristiaanse/TDMAsolver.py
Tridiagonal Matrix Algorithm solver in Python. I've modified the code from cbellei so, it works with python 3.0+ and implemented the use of jit to increase the speed.
import numpy as np
from numba import jit, f8
## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver
@jit(f8[:] (f8[:],f8[:],f8[:],f8[:] ))
def TDMAsolver(a, b, c, d):
'''
TDMA solver, a b c d can be NumPy array type or Python list type.
refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
and to http://www.cfd-online.com/Wiki/Tridiagonal_matrix_algorithm_-_TDMA_(Thomas_algorithm)
@nyameko
nyameko / TDMAsolver.py
Created June 15, 2018 13:58 — forked from cbellei/TDMAsolver.py
Tridiagonal Matrix Algorithm solver in Python
import numpy as np
## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver
def TDMAsolver(a, b, c, d):
'''
TDMA solver, a b c d can be NumPy array type or Python list type.
refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
and to http://www.cfd-online.com/Wiki/Tridiagonal_matrix_algorithm_-_TDMA_(Thomas_algorithm)
'''
nf = len(d) # number of equations
@nyameko
nyameko / TDMAsolver.py
Created June 15, 2018 13:57 — forked from ofan666/TDMAsolver.py
Tridiagonal Matrix Algorithm solver in Python, using Numpy array - http://ofan666.blogspot.com/2012/02/tridiagonal-matrix-algorithm-solver-in.html
try:
import numpypy as np # for compatibility with numpy in pypy
except:
import numpy as np # if using numpy in cpython
## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver
def TDMAsolver(a, b, c, d):
'''
TDMA solver, a b c d can be NumPy array type or Python list type.
refer to http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
(Spacemacs) Warning: An error occurred while applying the theme "reverse", fallback on theme "spacemacs-dark".
Error was: (error Package ‘reverse-theme-’ is unavailable)
(Spacemacs) Warning: Please check the value of "dotspacemacs-themes" in your dotfile or open an issue
so we can add support for the theme "reverse".
# GDM configuration storage
[daemon]
# Uncoment the line below to force the login screen to use Xorg
WaylandEnable=false
[security]
[xdmcp]
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer