Description Usage Arguments Examples
calc_af
1 | calc_af(xyz1, xyz2, wij, alpha=0.29)
|
xyz1 |
|
xyz2 |
|
wij |
|
alpha |
0.29 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
calc_af <- function(xyz1, xyz2, wij, alpha=0.29) {
size1 <- dim(xyz1)[2]
size2 <- dim(xyz2)[2]
af <- 0
for (i in 1:size1) {
for (j in 1:size2) {
rij2 <- 0
for (k in 1:3) {
rij2 <- rij2 + (xyz1[k,i]-xyz2[k,j])^2
}
af <- af - wij[i,j] * exp(-alpha * rij2)
}
}
af
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.