3 #include <Rinternals.h>
10 int L
= INTEGER(getAttrib(cwt_
, R_DimSymbol
))[0],
11 D
= INTEGER(getAttrib(cwt_
, R_DimSymbol
))[1];
12 double *cwt
= REAL(cwt_
);
14 PROTECT(R_fcwt
= allocMatrix(REALSXP
, L
, D
));
15 double* fcwt
= REAL(R_fcwt
);
17 //TODO: coding style is terrible... no time for now.
18 for (int col
=0; col
<D
; col
++)
21 double ma
= v1
+ cwt
[1] + cwt
[2];
22 for (int i
=1; i
<L
-2; i
++)
25 ma
= ma
- v1
+ cwt
[i
+2];