Displaying 1 result from an estimated 1 matches for "alpha_c".
Did you mean:
alpha_
2007 Jul 23
1
code optimization tips
Hi,
Being new to R I'm asking for some advice on how to optimize the
performance of the following piece of code:
> alpha_c <- function(lambda=600e-9,alpha_s=1e-14,N=400,spacing=1e-7){
>
> k<-2*pi/lambda
> ri<-c(0,0) # particle at the origin
> x<-c(-N:N)
> positions <- function(N) {
> reps <- 2*N+1
> matrix(c(rep(-N:N, each = reps), rep(-N:N, times = reps)),
> nr...