Diagonal Matrix Exponential in Python -


i'm writing numerical algorithm speed in mind. i've come across 2 matrix exponential functions in scipy/numpy (scipy.linalg.expm2, scipy.linalg.expm). have matrix know diagonal beforehand. these scipy functions check if matrix diagonal before run? exponentiation algorithm can faster diagonal matrix, , want make sure these doing smart - if aren't, there easy way it?

if matrix diagonal, exponential can obtained exponentiating every entry on main diagonal, can calculate by:

np.diag(np.exp(np.diag(a))) 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -