| 1 | /************************************************************************* |
| 2 | * * |
| 3 | * Vega FEM Simulation Library Version 3.1 * |
| 4 | * * |
| 5 | * "matrix" library , Copyright (C) 2007 CMU, 2009 MIT * |
| 6 | * All rights reserved. * |
| 7 | * * |
| 8 | * Code author: Jernej Barbic * |
| 9 | * http://www.jernejbarbic.com/code * |
| 10 | * Research: Jernej Barbic, Doug L. James, Jovan Popovic * |
| 11 | * Funding: NSF, Link Foundation, Singapore-MIT GAMBIT Game Lab * |
| 12 | * * |
| 13 | * This library is free software; you can redistribute it and/or * |
| 14 | * modify it under the terms of the BSD-style license that is * |
| 15 | * included with this library in the file LICENSE.txt * |
| 16 | * * |
| 17 | * This library is distributed in the hope that it will be useful, * |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the file * |
| 20 | * LICENSE.TXT for more details. * |
| 21 | * * |
| 22 | *************************************************************************/ |
| 23 | |
| 24 | /* |
| 25 | Matrix wrappers to expokit routines. |
| 26 | Note: although the wrappers are templated, only the value real=double works. |
| 27 | This is because expokit supports double precision matrix exponentials |
| 28 | (DGPADM), but does not currently include a single-precision routine SGPADM. |
| 29 | See also matrix.h and expokit_xgpadm.h. |
| 30 | */ |
| 31 | |
| 32 | #ifndef _MATRIXEXP_H_ |
| 33 | #define _MATRIXEXP_H_ |
| 34 | |
| 35 | // computes exp(mtx*t) |
| 36 | template<class real> |
| 37 | int MatrixExp(int m, real * mtx, real t, real * output, int ideg=6); |
| 38 | |
| 39 | // computes w = exp(mtx*t)*v |
| 40 | template<class real> |
| 41 | int MatrixExpv(int m, real * mtx, real t, real * v, real * w, int ideg=6); |
| 42 | |
| 43 | #endif |