[R] Speeding up small functions

2006-11-19 Thread Wee-Jin Goh
Greetings list, In my code, I have a few small functions that are called very very frequently. An example of one such function is the following : sigmoid-function(x) 1/(1+exp(-x)) Now, is there anyway to make this go faster? For example, in C++ we could make it inline. Is there a

Re: [R] Speeding up small functions

2006-11-19 Thread Gabor Grothendieck
Try a test in which you replace the function calls with inline code and compare the two speed-wise. You may very well find that the difference is inconsequential. On 11/19/06, Wee-Jin Goh [EMAIL PROTECTED] wrote: Greetings list, In my code, I have a few small functions that are called very

Re: [R] Speeding up small functions

2006-11-19 Thread Christos Hatzis
Subject: [R] Speeding up small functions Greetings list, In my code, I have a few small functions that are called very very frequently. An example of one such function is the following : sigmoid-function(x) 1/(1+exp(-x)) Now, is there anyway to make this go faster? For example, in C++ we could