distsumgra {orloca} | R Documentation |
The gradient function for the min-sum location problem.
distsumgra(o, x = 0, y = 0, lp = numeric(0), partial = F)
o |
An object of |
x |
The x coordinate of the point to be evaluated. |
y |
The y coordinate of the point to be evaluated. |
lp |
If given, then l_p norm will be used instead of the Euclidean norm. |
partial |
If (x,y) is a demand point |
The function zsumgra is deprecated and will be removed from new versions of the package.
distsumgra
returns the gradient vector of the function of the min-sum location problem, ∑_{a_i \in o} w_i d(a_i, (x,y)), where d(a_i, (x,y)) gives the euclidean or the l_p distances between a_i and the point (x,y).
See also orloca-package
and distsum
.
# A new unweighted loca.p object loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1)) # Evaluation of distsum at (0, 0) distsum(loca) # Evaluation of distsum at (1, 3) distsum(loca, 1, 3) # Compute the objective function at point (3, 4) using lp norm and p = 2.5 distsum(loca, 3, 4, lp=2.5) # The gradient function at (1,3) distsumgra(loca, 1, 3)