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
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run. Advanced users may wish to specify all system modules
# in this array. For instance:
# MODULES=(piix ide_disk reiserfs)
MODULES=()
# BINARIES
# This setting includes any additional binaries a given user may
Welcome to the Emacs shell
~ λ nvidia-smi -a
==============NVSMI LOG==============
Timestamp : Mon Apr 16 12:12:35 2018
Driver Version : 390.48
Attached GPUs : 1
Welcome to the Emacs shell
/etc λ cd
~ λ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)