Skip to content
Prev 333265 / 398506 Next

The smallest enclosing ball problem

On 16-11-2013, at 13:11, Hans W.Borchers <hwborchers at googlemail.com> wrote:

            
After  having a closer look at this problem, I believe you did not include the constraint x_i >= 0 in the call to solve.QP.
So with this modification of your code

A <- matrix(rep(1,3),nrow=4,ncol=3,byrow=TRUE)
A[2:4,] <- diag(3)   
b <- c(1,0,0,0)

sol3 <- solve.QP(D, d, t(A), b, meq = 1) # first row of A is an equality
sol3
p0 <- c(C %*% sol3$solution)
r0 <- sqrt(-sol3$value)
p0
r0
sqrt(colSums((C - p0)^2))

one gets the correct answer.
BTW LowRankQP seems to postulate x_i >=0 if I read its manual correctly.

Berend