Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc74a18
commit 78a3954
Showing
16 changed files
with
709 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
Package: fastclime | ||
Type: Package | ||
Title: A fast solver for constrained l1 minimization approach to sparse | ||
precision matrix estimation | ||
Version: 1.1 | ||
Date: 2013-06-18 | ||
Title: A fast solver for parameterized lp problems and constrained l1 | ||
minimization approach to sparse precision matrix estimation | ||
Version: 1.2 | ||
Date: 2013-07-11 | ||
Author: Haotian Pang, Han Liu and Robert Vanderbei | ||
Maintainer: Haotian Pang <hpang@princeton.edu> | ||
Depends: R (>= 2.15.0), lattice, igraph, MASS, Matrix | ||
Description: The package "fastclime" provides a method of recover the | ||
precision matrix efficiently by applying parametric simplex | ||
method. The computation is based on a linear optimization | ||
solver. It also contains a generic LP solver using parametric | ||
simplex method. | ||
solver. It also contains a generic LP solver and a parameterized LP solver using parametric simplex method. | ||
License: GPL-2 | ||
Repository: CRAN | ||
Packaged: 2013-06-18 23:15:32 UTC; haotian | ||
Packaged: 2013-07-11 18:46:54 UTC; haotian | ||
NeedsCompilation: yes | ||
Date/Publication: 2013-06-19 08:49:27 | ||
Date/Publication: 2013-07-12 07:28:25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#-------------------------------------------------------------------------------# | ||
# Package: fastclime # | ||
# fastclp(): A parametric simplex LP solver for parameterized LP problems # | ||
# Authors: Haotian Pang, Han Liu and Robert Vanderbei # | ||
# Emails: <hpang@princeton.edu>, <hanliu@princeton.edu> and <rvdb@princetonedu> # | ||
# Date: Jul 11th 2013 # | ||
# Version: 1.2 # | ||
#-------------------------------------------------------------------------------# | ||
|
||
paralp <- function(obj, mat, rhs, obj_bar, rhs_bar, lambda=0){ | ||
|
||
m<-length(rhs) | ||
n<-length(obj) | ||
m1<-length(rhs_bar) | ||
n1<-length(obj_bar) | ||
m0<-dim(mat)[1] | ||
n0<-dim(mat)[2] | ||
|
||
opt<-rep(0,n) | ||
status<-0 | ||
error<-0 | ||
|
||
if (m!=m0 || n!=n0 || m!=m1 || n!=n1){ | ||
cat("Dimensions do not match! \n") | ||
error<-1 | ||
} | ||
|
||
if (any(obj_bar<0) || any(rhs_bar<0)){ | ||
|
||
cat("The pertubation vector obj_bar and rhs_bar must be nonnegative! \n") | ||
error<-2 | ||
|
||
} | ||
|
||
if (error==0){ | ||
str=.C("paralp", as.double(obj), as.double(t(mat)), as.double(rhs), as.integer(m0), as.integer(n0), as.double(opt), as.integer(status), as.double(lambda), as.double(rhs_bar), as.double(obj_bar), PACKAGE="fastclime") | ||
|
||
|
||
opt<-unlist(str[6]) | ||
status<-unlist(str[7]) | ||
|
||
if (status==0){ | ||
cat("optimal solution found! \n") | ||
return(opt) | ||
} | ||
|
||
else if(status ==1){ | ||
cat("The problem is infeasible! \n") | ||
} | ||
|
||
else if(status ==2){ | ||
cat("The problem is unbounded! \n") | ||
} | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
\name{paralp} | ||
\alias{paralp} | ||
|
||
\title{ | ||
A solver for parameterized LP problems | ||
} | ||
|
||
\description{ | ||
A parameterized linear programming solver using parametric simplex method | ||
} | ||
|
||
\usage{ | ||
paralp(obj,mat,rhs,obj_bar,rhs_bar,lambda=0) | ||
} | ||
|
||
\arguments{ | ||
\item{obj}{ | ||
The objective vector of the coefficient with length n. | ||
} | ||
\item{mat}{ | ||
The constraint matrix of the linear programming with dimension m*n. Note this argument must be in matrix form even it is a vector. | ||
} | ||
\item{rhs}{ | ||
The right hand side vector of the constraint with length m. | ||
} | ||
|
||
\item{obj_bar}{ | ||
The vector used to time the parameter and added to the objective vector, with length n. This pertubation vector must be nonnegative. | ||
} | ||
|
||
\item{rhs_bar}{ | ||
The vector used to time the parameter and added to the right hand side vector, with length m. This pertubation vector must be nonnegative. | ||
} | ||
|
||
\item{lambda}{ | ||
The parametric simplex method will stop when the calculated paramter is smaller than lambda. The default value is zero and it corresponds to the optimal value. | ||
} | ||
} | ||
|
||
\details{ | ||
This function is used to solve a general linear programming in standard inequality form: "maximize obj*x+obj_bar*lambda, subject to: mat*x<=rhs+rhs_bar*lambda, x>=0" | ||
} | ||
|
||
|
||
\value{ | ||
The optimal value will be returned if it exists with a proper value of chosen lambda. Otherwise the function will indicate the problem is infeasible or unbounded. | ||
} | ||
|
||
\author{ | ||
Haotian Pang, Han Liu and Robert Vanderbei \cr | ||
Maintainer: Haotan Pang<hpang@princeton.edu> | ||
} | ||
|
||
\seealso{ | ||
\code{\link{fastclime}} and \code{\link{fastclime-package}} | ||
} | ||
|
||
\examples{ | ||
#generate an LP problem and solve it | ||
A=matrix(c(-1,-1,0,1,-2,1),nrow=3) | ||
b=c(-1,-2,1) | ||
c=c(-2,3) | ||
b_bar=c(1,1,1) | ||
c_bar=c(1,1) | ||
paralp(c,A,b,c_bar,b_bar) | ||
} |
Oops, something went wrong.