Dr. Ranjan Maitra and
Dr. Volodymyr Melnykov developed
a lot of C functions handling high dimensional data set, using
EM Algorithm to find the classifications by Model-Based Clustering,
and other related interesting studies requiring high performance computing.
They also accomplish their achievements with R packages.
Pointer arrays are heavily used in the researches, but skipped cleverly
by some macros in C ...
Dr. Maitra is a professor in
Department of Statisitcs,
Iowa State University,
Ames,
Iowa,
USA,
and his student, Dr. Melnykov, is
a professor in
Department of Statisitcs,
North Dakota State University,
Fargo,
North Dakota,
USA.
This is an example for demonstrate C pointer arrays by an R package,
and all the functions can be wrappers for other C functions.
There are three main C functions to receive data (pointer) from R,
and assign data into an array, a double pointer array, and a 3D pointer array
by different ways including:
directly making a copy, and
assigning pointer arrays to the addresses of R's objects.
R and C use different arrange methods to assign "array", so
it should be manipulated carefully when they are communicating
with each other.
These techniques are useful when we are analyzing high dimensional
data set.
test_1d()
, test_2d()
,
and test_3d()
in
src/
. test.1d()
, test.2d()
, and
test.3d()
in "R/". .C()
is used in R, but the issues are all the same for
.Call()
or .External()
.