Hi Riccardo, Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also reverses the order of eigenvalues/-vectors.
Cheers, Tsjerk On Jan 2, 2012 4:35 PM, "riccardo24" <riccardo.giacome...@gmail.com> wrote: Hi, I need to maximize a quadratic function under constraints in R. For minimization I used solve.QP but for maximization it is not useful since the matrix D of the quadratic function should be positive definite hence I cannot simply change the sign. any suggestion ? thanks -- View this message in context: http://r.789695.n4.nabble.com/quadratic-programming-maximization-instead-of-minization-tp4253011p4253011.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.