Commit 81b5d24e17fc293b8cec1a36d024a68e6e6a4c26
1 parent
38581db0c3
Exists in
master
and in
3 other branches
git-svn-id: https://lxsd.femto-st.fr/svn/fvn@31 b657c933-2333-4658-acf2-d3c7c2708721
Showing 4 changed files with 592 additions and 591 deletions Side-by-side Diff
doc/fvn.pdf
No preview for this file type
doc/fvn.tex
| ... | ... | @@ -295,12 +295,12 @@ |
| 295 | 295 | |
| 296 | 296 | \subsection{Identity matrix} |
| 297 | 297 | \begin{verbatim} |
| 298 | - I=fvn_ident(n) | |
| 298 | + I=fvn_*_ident(n) (*=s,d,c,z) | |
| 299 | 299 | \end{verbatim} |
| 300 | 300 | \begin{itemize} |
| 301 | 301 | \item n (in) is an integer equal to the matrix rank |
| 302 | 302 | \end{itemize} |
| 303 | -This function return the identity matrix of rank n, in the type of the left hand side. | |
| 303 | +This function return the identity matrix of rank n, in the type of the left hand side. No generic interface for this one. | |
| 304 | 304 | |
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | |
| ... | ... | @@ -1225,22 +1225,24 @@ |
| 1225 | 1225 | \subsubsection{fac} |
| 1226 | 1226 | \begin{verbatim} |
| 1227 | 1227 | fac(n) |
| 1228 | + dfac(n) | |
| 1228 | 1229 | \end{verbatim} |
| 1229 | 1230 | \begin{itemize} |
| 1230 | 1231 | \item n is an integer |
| 1231 | 1232 | \end{itemize} |
| 1232 | -This function return $n!$ as a real. | |
| 1233 | +This function return $n!$ as a real(4) or real(8) for dfac. There's no generic interface for this one. | |
| 1233 | 1234 | |
| 1234 | 1235 | Specific interfaces : \verb'fac,dfac' |
| 1235 | 1236 | |
| 1236 | 1237 | \subsubsection{binom} |
| 1237 | 1238 | \begin{verbatim} |
| 1238 | 1239 | binom(n,m) |
| 1240 | + dbinom(n,m) | |
| 1239 | 1241 | \end{verbatim} |
| 1240 | 1242 | \begin{itemize} |
| 1241 | 1243 | \item n,m are integers |
| 1242 | 1244 | \end{itemize} |
| 1243 | -This function return the binomial coefficient defined by equation \ref{binom} with $n \geq m \geq 0$. | |
| 1245 | +This function return the binomial coefficient defined by equation \ref{binom} with $n \geq m \geq 0$. binom returns a real(4), dbinom a real(8). There's no generic interface for this one. | |
| 1244 | 1246 | \begin{equation} |
| 1245 | 1247 | \label{binom} |
| 1246 | 1248 | binom(n,m) = C_n^m = {{n!} \over {m!(n-m)!}} |
fvn_fnlib/fvn_fnlib.f90
| ... | ... | @@ -235,6 +235,7 @@ |
| 235 | 235 | complex(4) :: z |
| 236 | 236 | end function cacosh |
| 237 | 237 | complex(8) function zacosh(z) |
| 238 | + complex(8) :: z | |
| 238 | 239 | end function zacosh |
| 239 | 240 | end interface acosh |
| 240 | 241 | |
| 241 | 242 | |
| 242 | 243 | |
| 243 | 244 | |
| 244 | 245 | |
| ... | ... | @@ -367,25 +368,24 @@ |
| 367 | 368 | ! Gamma family |
| 368 | 369 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 369 | 370 | |
| 371 | +! No generic interface for fac and binom but we still | |
| 372 | +! define their prototypes | |
| 370 | 373 | ! Factorial |
| 371 | -interface fac | |
| 374 | +interface | |
| 372 | 375 | real(4) function fac(n) |
| 373 | 376 | integer(4) :: n |
| 374 | 377 | end function fac |
| 375 | 378 | real(8) function dfac(n) |
| 376 | 379 | integer(4) :: n |
| 377 | 380 | end function dfac |
| 378 | -end interface fac | |
| 379 | - | |
| 380 | 381 | ! Binomial coefficient |
| 381 | -interface binom | |
| 382 | 382 | real(4) function binom(n,m) |
| 383 | 383 | integer(4) :: n,m |
| 384 | 384 | end function binom |
| 385 | 385 | real(8) function dbinom(n,m) |
| 386 | 386 | integer(4) :: n,m |
| 387 | 387 | end function dbinom |
| 388 | -end interface binom | |
| 388 | +end interface | |
| 389 | 389 | |
| 390 | 390 | ! Gamma function |
| 391 | 391 | interface gamma |
fvnlib.f90
| ... | ... | @@ -60,10 +60,6 @@ |
| 60 | 60 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 61 | 61 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 62 | 62 | |
| 63 | -! Identity Matrix | |
| 64 | -interface fvn_ident | |
| 65 | - module procedure fvn_s_ident,fvn_d_ident,fvn_c_ident,fvn_z_ident | |
| 66 | -end interface fvn_ident | |
| 67 | 63 | |
| 68 | 64 | ! Matrix inversion |
| 69 | 65 | interface fvn_matinv |
| ... | ... | @@ -277,7 +273,7 @@ |
| 277 | 273 | ! status (ou) : =0 if something failed |
| 278 | 274 | ! |
| 279 | 275 | implicit none |
| 280 | - integer, intent(in), optional :: d | |
| 276 | + integer, intent(in) :: d | |
| 281 | 277 | double precision, intent(in) :: a(d,d) |
| 282 | 278 | double precision, intent(out) :: inva(d,d) |
| 283 | 279 | integer, intent(out),optional :: status |