blob: d42e9180a28b13721a2e9d6e479623e475b361cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
! $Header$
#include "cctk.h"
module matexp
use constants
implicit none
private
public calc_exp3
contains
subroutine calc_exp3 (h3, g3)
CCTK_REAL, intent(in) :: h3(3,3)
CCTK_REAL, intent(out) :: g3(3,3)
CCTK_REAL :: nfact
CCTK_REAL :: tmp(3,3)
integer :: n
integer :: i, j
g3 = delta3
nfact = 1
tmp = delta3
do n = 1, 18
nfact = nfact * n
tmp = matmul (h3, tmp)
! exp(x) = sum_n x^n / n!
g3 = g3 + tmp / nfact
end do
end subroutine calc_exp3
end module matexp
|