cmf_coef_xyz_sv_ex_ind: Computes coefficient at point (x,y,z) using support vectors...

Description Usage Arguments Examples

Description

Computes coefficient at point (x,y,z) using support vectors for continuous indicator field

Usage

1
cmf_coef_xyz_sv_ex_ind(mdb, a, ai, alpha, x, y, z, field, atomlists)

Arguments

mdb
a
ai
alpha
x
y
z
field
atomlists

Examples

 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
cmf_coef_xyz_sv_ex_ind <- function(mdb, a, ai, alpha, x, y, z, field, atomlists) {
  coef <- 0.0
  nsv <- length(ai)
  for (isv in 1:nsv) {
    imol <- ai[isv]
	mol <- mdb[[imol]]
    natoms <- length(mol$atoms)
    for (iatom in atomlists[[imol]]) {
      atom <- mol$atoms[[iatom]]
      dist2 <- (x - atom$x)^2 + (y - atom$y)^2 + (z - atom$z)^2
      coef <- coef + a[isv] * exp(- alpha * dist2 / 2.0)
    }
  }
  coef
}

conmolfields documentation built on May 2, 2019, 4:18 p.m.