pomp
Inference for partially observed Markov processes
Toggle main menu visibility
Main Page
Data Structures
Data Structures
Data Structure Index
Data Fields
All
Variables
Files
File List
Globals
All
_
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Functions
_
a
b
d
e
f
g
i
l
m
n
o
p
r
s
t
w
Variables
_
a
c
f
m
n
o
p
r
s
Typedefs
a
b
g
l
m
n
p
s
t
u
Enumerations
Enumerator
Macros
a
c
e
f
k
m
n
r
s
t
u
v
w
x
y
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
Loading...
Searching...
No Matches
pomp_mat.h
Go to the documentation of this file.
1
#ifndef _POMP_MAT_H_
2
#define _POMP_MAT_H_
3
4
#include <Rconfig.h>
5
#include <R_ext/Lapack.h>
6
#ifndef FCONE
7
#define FCONE
8
#endif
9
#include "
internal.h
"
10
11
static
R_INLINE
void
pomp_backsolve
12
(
13
double
*a,
int
lda,
int
n,
double
*x,
int
incx,
14
char
*uplo,
char
*transpose,
char
*unit
15
) {
16
// Level 2 BLAS triangular-matrix solver DTRSV(UPLO,TRANS,DIAG,N,A,LDA,X,INCX)
17
// DTRSV: x <- A ^{-1} x -or- x <- A ^{-T} x, A triangular
18
// N is the order of A
19
// LDA is A's leading dimension
20
// INCX is the increment between successive X locations
21
// UPLO is "U" or "L" depending on whether A is upper or lower triangular
22
// TRANSPOSE is "T" or "N" depending on whether the transpose is desired
23
// DIAG is "U" or "N" depending on whether A is unit triangular or not
24
F77_CALL(dtrsv)(uplo,transpose,unit,&n,a,&lda,x,&incx
FCONE
FCONE
FCONE
);
25
}
11
static
R_INLINE
void
pomp_backsolve
{
…
}
26
27
static
R_INLINE
void
pomp_qr
28
(
29
double
*a,
int
m,
int
n,
int
*pivot,
double
*
tau
30
) {
31
int
info, j, lwork = -1;
32
double
work1;
33
// zero out the pivots (assumed by DGEQP3)
34
for
(j = 0; j < n; j++) pivot[j] = 0;
35
// LAPACK QR decomposition routine
36
// DGEQP3(M,N,A,LDA,JPVT,TAU,WORK,LWORK,INFO)
37
F77_CALL(dgeqp3)(&m,&n,a,&m,pivot,
tau
,&work1,&lwork,&info);
// workspace query
38
lwork = (int) ceil(work1);
39
{
40
double
work[lwork];
41
F77_CALL(dgeqp3)(&m,&n,a,&m,pivot,
tau
,work,&lwork,&info);
// actual call
42
}
43
for
(j = 0; j < n; j++) pivot[j]--;
44
}
27
static
R_INLINE
void
pomp_qr
{
…
}
45
46
static
R_INLINE
void
pomp_qrqy
47
(
48
double
*c,
double
*a,
int
lda,
double
*
tau
,
49
int
m,
int
n,
int
k,
char
*side,
char
*transpose
50
) {
51
int
info, lwork = -1;
52
double
work1;
53
// workspace query
54
// DORMQR(SIDE,TRANS,M,N,K,A,LDA,TAU,C,LDC,WORK,LWORK,INFO)
55
F77_CALL(dormqr)(side,transpose,&m,&n,&k,a,&lda,
tau
,c,&m,&work1,&lwork,&info
FCONE
FCONE
);
56
lwork = (int) ceil(work1);
57
{
// actual call
58
double
work[lwork];
59
F77_CALL(dormqr)(side,transpose,&m,&n,&k,a,&lda,
tau
,c,&m,work,&lwork,&info
FCONE
FCONE
);
60
}
61
}
46
static
R_INLINE
void
pomp_qrqy
{
…
}
62
63
#endif
tau
#define tau
Definition
gompertz.c:94
internal.h
FCONE
#define FCONE
Definition
pomp_mat.h:7
pomp_qr
static R_INLINE void pomp_qr(double *a, int m, int n, int *pivot, double *tau)
Definition
pomp_mat.h:28
pomp_qrqy
static R_INLINE void pomp_qrqy(double *c, double *a, int lda, double *tau, int m, int n, int k, char *side, char *transpose)
Definition
pomp_mat.h:47
pomp_backsolve
static R_INLINE void pomp_backsolve(double *a, int lda, int n, double *x, int incx, char *uplo, char *transpose, char *unit)
Definition
pomp_mat.h:12
src
pomp_mat.h
Generated by
1.9.8