Why is ".QP_qpgen2" not found in quadprog?

I recently cleaned up a script that calls solve.QP from the quadprog package (I currently have version 1.5-5). Now it generates an error "object" .QP_qpgen2 "not found". I do not understand why.

This object was not created by me, but by the solve.QP function in quadprog. On Github, Quadprog.R has the code (line 117):

 res1 <- .Fortran(.QP_qpgen2,
               as.double(Dmat), dvec=as.double(dvec),
               as.integer(n), as.integer(n),
               sol=as.double(sol), lagr=as.double(lagr),
               crval=as.double(crval),
               as.double(Amat), as.double(bvec), as.integer(n),
               as.integer(q), as.integer(meq),
               iact=as.integer(iact), nact=as.integer(nact),
               iter=as.integer(iter), work=as.double(work),
               ierr=as.integer(factorized))

An error can be generated from code taken from the documentation for the solution. QP:

##
## Assume we want to minimize: -(0 5 0) %*% b + 1/2 b^T b
## under the constraints:      A^T b >= b0
## with b0 = (-8,2,0)^T
## and      (-4  2  0) 
##      A = (-3  1 -2)
##          ( 0  0  1)
## we can use solve.QP as follows:
##
Dmat       <- matrix(0,3,3)
diag(Dmat) <- 1
dvec       <- c(0,5,0)
Amat       <- matrix(c(-4,-3,0,2,1,0,0,-2,1),3,3)
bvec       <- c(-8,2,0)
solve.QP(Dmat,dvec,Amat,bvec=bvec)

I use R v3.4.1 if this helps.

+4
source share
2 answers

, R 3.4 . Quadprog Fortran. , R 3.4 Rtools. Rtools ( Google Rtools ,). CRAN quadprog quadprog.tar.gz. ,

install.packages("PATH_TO_FILE/quadprog_1.5-5.tar.gz", repos = NULL, type="source", INSTALL_opts = "--merge-multiarch")

. , CRAN .

+5

:

packageDescription("quadprog"), , R .

R 3.3.x ( ), update.packages(checkBuilt=TRUE), , R 3.4.x.

+1

Source: https://habr.com/ru/post/1681201/


All Articles