From alireza.s.mahani at gmail.com  Thu Jul 14 18:18:22 2011
From: alireza.s.mahani at gmail.com (Alireza Mahani)
Date: Thu, 14 Jul 2011 09:18:22 -0700 (PDT)
Subject: [Rd] Performance of .C and .Call functions vs. native R code
In-Reply-To: <CADwqtCP=WhYN5fwWiV=_n2ytxb1RL755QbU+wSs3oRgokOfmVA@mail.gmail.com>
References: <1310563735586-3665017.post@n4.nabble.com>
	<05EF8F1E-DC69-4A25-9021-47D9BF841316@gmail.com>
	<1310656867725-3667896.post@n4.nabble.com>
	<CADwqtCP=WhYN5fwWiV=_n2ytxb1RL755QbU+wSs3oRgokOfmVA@mail.gmail.com>
Message-ID: <1310660302985-3668047.post@n4.nabble.com>

You are absolutely right Gabe! I removed the line 'dim(A) <- dim(A)[1] *
dim(A)[2]' and my code still executes properly. As you said, matrices are
internally stored as one-dimensional arrays (column-major by default), it's
just that R exposes them differently by assigning different attributes to
them, but as far as C/C++ code is concerned there is no distinction.

Many thanks,
Alireza


--
View this message in context: http://r.789695.n4.nabble.com/Performance-of-C-and-Call-functions-vs-native-R-code-tp3665017p3668047.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] Performance of .C and .Call functions vs. native R code
Alireza Mahani