diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..32358936d0b933fa577bc062610396a386202048 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +# ignore pdf files +*.pdf + +# ignore build r package: +sybil_*.tar.gz diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000000000000000000000000000000000000..6fc429cd293234bcd912ee9544a2831ec79efe53 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,19 @@ +Package: clpAPI +Type: Package +Title: R Interface to C API of COIN-OR Clp +Version: 1.2.6 +Date: 2013-10-26 +Authors@R: c(person("Gabriel", "Gelius-Dietrich", role = c("aut", "cre"), email = "geliudie@uni-duesseldorf.de")) +Depends: R (>= 2.6.0) +Imports: methods +Description: R Interface to C API of COIN-OR Clp, depends on COIN-OR Clp Version >= 1.12.0 +SystemRequirements: COIN-OR Clp (>= 1.12.0) +License: GPL-3 +LazyLoad: yes +Collate: generics.R clp_ptrClass.R clp.R clpAPI.R zzz.R +Packaged: 2013-10-26 16:15:58 UTC; gabriel +Author: Gabriel Gelius-Dietrich [aut, cre] +Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +NeedsCompilation: yes +Repository: CRAN +Date/Publication: 2013-10-26 19:08:53 diff --git a/MD5 b/MD5 new file mode 100644 index 0000000000000000000000000000000000000000..c35ad3dac8dada0ed39d4598e746bf2ac240586e --- /dev/null +++ b/MD5 @@ -0,0 +1,85 @@ +aed7f2b6574917b3d0ca688429b99065 *DESCRIPTION +5daa14e3ff7a2270d741a3e781a8f987 *NAMESPACE +00cd81844a47cfe6b42a5b2139d64c78 *R/clp.R +3ce8923439c8c1b6b9d5a5b73eedc8c1 *R/clpAPI.R +9732448f604c10e494f1786df44f0a62 *R/clp_ptrClass.R +c28b18176d42d49363a806c626389214 *R/generics.R +b92329cf50a482f5a473bcce316e5669 *R/zzz.R +f7372a571a1b0690bfaf3bdb7b88c829 *build/vignette.rds +661848692617a4273bc42814dec96764 *cleanup +011ce44bdb6c566923d3f8473620a42a *configure +c2209e4bff9ea976398c3587f4e13c38 *configure.ac +d41d8cd98f00b204e9800998ecf8427e *configure.win +ee6ae0f4273773b869f135cdc41a6ef1 *inst/INSTALL +eb15b4cad6eef59a4ae92d53a44c24d0 *inst/NEWS.Rd +e236783da143c26d795f14dd8021f981 *inst/README +3952b2754f409d0fe85d390817441d03 *inst/c2r.map +1e514bbcc73c999233af23fb78ae0f9a *inst/doc/clpAPI.R +f932b68cee56631e482786a0e888fe45 *inst/doc/clpAPI.Rnw +e9350415f9796cedd430ddbae49d06e8 *inst/doc/clpAPI.pdf +6bb5e918e9243fc4d2404ae81576bf20 *man/addColsCLP.Rd +3d7fc83d95f88caacb91ba6a894db11a *man/addRowsCLP.Rd +ae29b572c5b913e0cee58e41f9c1a77b *man/chgColLowerCLP.Rd +87cc07301c3cad4431b6a7a916787f93 *man/chgColUpperCLP.Rd +3998d99207a7c1260723825664df6133 *man/chgObjCoefsCLP.Rd +6bfa51e7bb325ac428f9270a028c8f7a *man/chgRowLowerCLP.Rd +633054b25943786817eebc3642183c1c *man/chgRowUpperCLP.Rd +84c9bba40b1ddfe90954903ce1fd3f6d *man/clpAPI-package.Rd +49d588eb46fcebee1712674bb4f7d3aa *man/clpPtr-class.Rd +fcf3a7ff8b53a3ec50c958c3d2166ca3 *man/copyNamesCLP.Rd +659504f9c06c120f6c55517d63bf4994 *man/delColsCLP.Rd +045ae82acdc295785959fd1e8db6cf5a *man/delProbCLP.Rd +9c1d261b4d7a3e3b4375fe8e75cedf39 *man/delRowsCLP.Rd +9cabdc8298f7370c21e15b513a0c7ca1 *man/dropNamesCLP.Rd +012d88d845f835bfe2cfea4ba08a6e3d *man/dualCLP.Rd +278341a1d5c00b1dbc8d7701ae0b8d86 *man/getColDualCLP.Rd +a6d90e81c179278dbf6086646af4a366 *man/getColLowerCLP.Rd +36a0fd7a47f52c73d59e82fd5857110d *man/getColPrimCLP.Rd +80d47275b11ba6c766b7b164e411d0fc *man/getColUpperCLP.Rd +f2f2fcd4e3c90634ab136b4627ae4b08 *man/getIndCLP.Rd +68a872b9c42e981c3317f8f965af541f *man/getLogLevelCLP.Rd +9162f07ae7aea48973cd93e1ee018d3e *man/getNnzCLP.Rd +81f39e9aa5747819fd1f87f8a1c36d21 *man/getNumColsCLP.Rd +fe178eb36ee4084fa25e21e56b04be92 *man/getNumNnzCLP.Rd +e43df9658e7fbe8c631349bdc06c73ea *man/getNumRowsCLP.Rd +7c577badd12b83de9afff5287619018b *man/getObjCoefsCLP.Rd +faa9ce206e630ab2d33cfa7b3d3d9117 *man/getObjDirCLP.Rd +4d8cc7aa9d96418f85633255fcf2867f *man/getObjValCLP.Rd +869b586c8026d2ec8e703ea761d6630e *man/getRowDualCLP.Rd +8212e338fbed580675f023fc6c477d3c *man/getRowLowerCLP.Rd +c943286578d76fbf3761b0a30c7fecd4 *man/getRowPrimCLP.Rd +57c2faa7f4443187dab2649912ed7688 *man/getRowUpperCLP.Rd +72df7fd600abfc56ce19a11f84842402 *man/getScaleFlagCLP.Rd +7b57d27e7160f754119e62a428ba27f3 *man/getSolStatusCLP.Rd +fd66b1d0be60b2c2855c93bfebd584ff *man/getVecLenCLP.Rd +4ae77953b088288d8b5c9c88e0e83446 *man/getVecStartCLP.Rd +8f8ecad322db363f477c83c35fc09603 *man/idiotCLP.Rd +6551a8a960f4462b59c34cdce1103161 *man/initProbCLP.Rd +f38b36396c9aaf39189b160c40167b65 *man/lengthNamesCLP.Rd +21aaec1dccf7fadd698c3da90bfd8d35 *man/loadMatrixCLP.Rd +70b15fb57229f15409b540663e81c4fc *man/loadProblemCLP.Rd +b52e0947a60ff6f1839a37d224a7a3df *man/primalCLP.Rd +a01c1ad1bfac218ad53b3c3abf90a2e2 *man/printModelCLP.Rd +a418a1cbfec3f1bdd4acf49f32f7b2e2 *man/probNameCLP.Rd +13cbb298a95e03c13e895dcd72c7147b *man/readMPSCLP.Rd +9870599290752fe1f5fbb51515c88151 *man/resizeCLP.Rd +dc8d186dbdf094fb26aef82502d4871b *man/restoreModelCLP.Rd +8f39cfcdbc1a927b83a8f1897865ed78 *man/return_codeCLP.Rd +ebdf498e2559a65c19729a1a21c9e72b *man/saveModelCLP.Rd +ff95f14cb153143c4addab443ab162c0 *man/scaleModelCLP.Rd +e04ef106322792a2c83721d6cf20e0dd *man/setLogLevelCLP.Rd +7411687c9940b4d378325078af8355c3 *man/setObjDirCLP.Rd +cd6ee2d6da156be2d3b7938d1d787a87 *man/solveInitialBarrierCLP.Rd +40bce1c1ba932f49b7b77b16b7210cb7 *man/solveInitialBarrierNoCrossCLP.Rd +c49b476f94cfbfbeb8a93a8bc7083d0f *man/solveInitialCLP.Rd +46cd2ee701fcdac1c2473b1072336e2d *man/solveInitialDualCLP.Rd +f89b721b6ec8b260fe3cdb7024932030 *man/solveInitialPrimalCLP.Rd +5724c8b0b98b6cf1bcc15bad70f87f5a *man/status_codeCLP.Rd +fa89b81b2935b875d4230c3e2c1c2e25 *man/versionCLP.Rd +e4cff70c399a10f65c797ddb9bfc2f65 *src/Makevars.in +5e18cdf60e85c6ed074a9125868cef8d *src/Makevars.win +80e01a59b216fbb14dd6b3b7aaa0f506 *src/clpAPI.c +ebf775ae8f5797658db56f2e81349c14 *src/clpAPI.h +f1ee63eab916e1506cb4af5fbcdddd5e *src/clpR.h +2f0955cfb67608368cf62466a9d2226f *src/init.c +f932b68cee56631e482786a0e888fe45 *vignettes/clpAPI.Rnw diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000000000000000000000000000000000000..cb546f186266591e1f4053f26e3a4a0453bee0ad --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,75 @@ +useDynLib(clpAPI) + +import(methods) + +exportClass("clpPtr") + +export( +# methods +"clpPointer", +"clpPtrType", +"clpPtrType<-", +"isNULLpointerCLP", +"isCLPpointer", +# function names +addColsCLP, +addRowsCLP, +chgColLowerCLP, +chgColUpperCLP, +chgObjCoefsCLP, +chgRowLowerCLP, +chgRowUpperCLP, +#colNameCLP, +copyNamesCLP, +delColsCLP, +delProbCLP, +delRowsCLP, +dualCLP, +dropNamesCLP, +getColDualCLP, +getColLowerCLP, +getColPrimCLP, +getColUpperCLP, +getIndCLP, +getLogLevelCLP, +getNnzCLP, +getNumColsCLP, +getNumNnzCLP, +getNumRowsCLP, +getObjCoefsCLP, +getObjDirCLP, +getObjValCLP, +getRowDualCLP, +getRowLowerCLP, +getRowPrimCLP, +getRowUpperCLP, +getScaleFlagCLP, +getSolStatusCLP, +getVecLenCLP, +getVecStartCLP, +idiotCLP, +initProbCLP, +loadMatrixCLP, +loadProblemCLP, +lengthNamesCLP, +primalCLP, +printModelCLP, +probNameCLP, +readMPSCLP, +resizeCLP, +restoreModelCLP, +return_codeCLP, +#rowNameCLP, +saveModelCLP, +scaleModelCLP, +setLogLevelCLP, +setObjDirCLP, +solveInitialBarrierCLP, +solveInitialBarrierNoCrossCLP, +solveInitialCLP, +solveInitialDualCLP, +solveInitialPrimalCLP, +status_codeCLP, +versionCLP +) + diff --git a/R/clp.R b/R/clp.R new file mode 100644 index 0000000000000000000000000000000000000000..513b62a9562d49056a093f0600e49898b349a5f4 --- /dev/null +++ b/R/clp.R @@ -0,0 +1,48 @@ +#------------------------------------------------------------------------------# +# R interface to COIN-OR Clp # +#------------------------------------------------------------------------------# + +# clp.R +# R interface to COIN-OR Clp. +# +# Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, +# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. +# All right reserved. +# Email: geliudie@uni-duesseldorf.de +# +# This file is part of clpAPI. +# +# ClpAPI is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ClpAPI is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with clpAPI If not, see <http://www.gnu.org/licenses/>. + + +#------------------------------------------------------------------------------# + +# return codes of clp optimizations +return_codeCLP <- function(code) { + if (code == 0) { return( "solution process was successful" ) } + else { return(paste("Failed to obtain solution, unknown error code:", code)) } +} + + +# solution status codes of clp optimizations +status_codeCLP <- function(code) { + if (code == 0) { return( "solution is optimal" ) } + else if (code == 1) { return( "solution is primal infeasible" ) } + else if (code == 2) { return( "solution is dual infeasible" ) } + else if (code == 3) { return( "stopped on iterations etc" ) } + else if (code == 4) { return( "stopped due to errors" ) } + else { return(paste("unknown status code:", code)) } +} + + diff --git a/R/clpAPI.R b/R/clpAPI.R new file mode 100644 index 0000000000000000000000000000000000000000..95644a57180eacdae8cb2422a990d3a0105b9d98 --- /dev/null +++ b/R/clpAPI.R @@ -0,0 +1,830 @@ +#------------------------------------------------------------------------------# +# R interface to COIN-OR Clp # +#------------------------------------------------------------------------------# + +# clpAPI.R +# R interface to COIN-OR Clp. +# +# Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, +# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. +# All right reserved. +# Email: geliudie@uni-duesseldorf.de +# +# This file is part of clpAPI. +# +# ClpAPI is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ClpAPI is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with clpAPI If not, see <http://www.gnu.org/licenses/>. + + +#------------------------------------------------------------------------------# +# the interface # +#------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------# + +delProbCLP <- function(lp) { + + invisible(.Call("delProb", clpPointer(lp), PACKAGE = "clpAPI")) + +} + + +#------------------------------------------------------------------------------# + +initProbCLP <- function(ptrtype = "clp_prob") { + lp <- .Call("initProb", PACKAGE = "clpAPI", + as.character(ptrtype) + ) + + lpP <- clp_Pointer(lp) + + return(lpP) +} + + +#------------------------------------------------------------------------------# + +setObjDirCLP <- function(lp, lpdir) { + + invisible( + .Call("setObjDir", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(lpdir) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getObjDirCLP <- function(lp) { + + lpdir <- .Call("getObjDir", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(lpdir) + +} + + +#------------------------------------------------------------------------------# + +resizeCLP <- function(lp, nrows, ncols) { + + invisible( + .Call("resize", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(nrows), + as.integer(ncols) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +addRowsCLP <- function(lp, nrows, lb, ub, rowst, cols, val) { + + invisible( + .Call("addRows", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(nrows), + as.numeric(lb), + as.numeric(ub), + as.integer(rowst), + as.integer(cols), + as.numeric(val) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +addColsCLP <- function(lp, ncols, lb, ub, obj, colst, rows, val) { + + invisible( + .Call("addCols", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(ncols), + as.numeric(lb), + as.numeric(ub), + as.numeric(obj), + as.integer(colst), + as.integer(rows), + as.numeric(val) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getNumRowsCLP <- function(lp) { + + nrows <- .Call("getNumRows", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(nrows) + +} + + +#------------------------------------------------------------------------------# + +getNumColsCLP <- function(lp) { + + ncols <- .Call("getNumCols", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ncols) + +} + + +#------------------------------------------------------------------------------# + +chgObjCoefsCLP <- function(lp, objCoef) { + + invisible( + .Call("chgObjCoefs", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(objCoef) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getObjCoefsCLP <- function(lp) { + + objCoefs <- .Call("getObjCoefs", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(objCoefs) + +} + + +#------------------------------------------------------------------------------# + +chgRowLowerCLP <- function(lp, rlb) { + + invisible( + .Call("chgRowLower", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(rlb) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getRowLowerCLP <- function(lp) { + + rlb <- .Call("getRowLower", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(rlb) + +} + + +#------------------------------------------------------------------------------# + +chgRowUpperCLP <- function(lp, rub) { + + invisible( + .Call("chgRowUpper", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(rub) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getRowUpperCLP <- function(lp) { + + rub <- .Call("getRowUpper", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(rub) + +} + + +#------------------------------------------------------------------------------# + +chgColLowerCLP <- function(lp, lb) { + + invisible( + .Call("chgColLower", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(lb) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getColLowerCLP <- function(lp) { + + lb <- .Call("getColLower", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(lb) + +} + + +#------------------------------------------------------------------------------# + +chgColUpperCLP <- function(lp, ub) { + + invisible( + .Call("chgColUpper", PACKAGE = "clpAPI", + clpPointer(lp), + as.numeric(ub) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getColUpperCLP <- function(lp) { + + ub <- .Call("getColUpper", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ub) + +} + + +#------------------------------------------------------------------------------# + +loadProblemCLP <- function(lp, ncols, nrows, ia, ja, ra, + lb = NULL, ub = NULL, + obj_coef = NULL, rlb = NULL, rub = NULL) { + + if (is.null(lb)) { + Clb <- as.null(lb) + } + else { + Clb <- as.numeric(lb) + } + + if (is.null(ub)) { + Cub <- as.null(ub) + } + else { + Cub <- as.numeric(ub) + } + + if (is.null(obj_coef)) { + Cobj_coef <- as.null(obj_coef) + } + else { + Cobj_coef <- as.numeric(obj_coef) + } + + if (is.null(rlb)) { + Crlb <- as.null(rlb) + } + else { + Crlb <- as.numeric(rlb) + } + + if (is.null(rub)) { + Crub <- as.null(rub) + } + else { + Crub <- as.numeric(rub) + } + + invisible( + .Call("loadProblem", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(ncols), + as.integer(nrows), + as.integer(ia), + as.integer(ja), + as.numeric(ra), + Clb, + Cub, + Cobj_coef, + Crlb, + Crub +# as.numeric(lb), +# as.numeric(ub), +# as.numeric(obj_coef), +# as.numeric(rlb), +# as.numeric(rub) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +loadMatrixCLP <- function(lp, ncols, nrows, ia, ja, ra) { + + invisible( + .Call("loadMatrix", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(ncols), + as.integer(nrows), + as.integer(ia), + as.integer(ja), + as.numeric(ra) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getNumNnzCLP <- function(lp) { + + nnz <- .Call("getNumNnz", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(nnz) + +} + + +#------------------------------------------------------------------------------# + +getVecStartCLP <- function(lp) { + + vec_start <- .Call("getVecStart", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(vec_start) + +} + + +#------------------------------------------------------------------------------# + +getIndCLP <- function(lp) { + + index <- .Call("getInd", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(index) + +} + + +#------------------------------------------------------------------------------# + +getVecLenCLP <- function(lp) { + + vec_len <- .Call("getVecLen", PACKAGE = "clpAPI", + lp + ) + return(vec_len) + +} + + +#------------------------------------------------------------------------------# + +getNnzCLP <- function(lp) { + + n_elem <- .Call("getNnz", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(n_elem) + +} + + +#------------------------------------------------------------------------------# + +printModelCLP <- function(lp, prefix = "CLPmodel") { + + invisible( + .Call("printModel", PACKAGE = "clpAPI", + clpPointer(lp), + as.character(prefix) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +setLogLevelCLP <- function(lp, amount) { + + invisible( + .Call("setLogLevel", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(amount) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getLogLevelCLP <- function(lp) { + + amount <- .Call("getLogLevel", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(amount) + +} + + +#------------------------------------------------------------------------------# + +scaleModelCLP <- function(lp, mode) { + + invisible( + .Call("scaleModel", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(mode) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getScaleFlagCLP <- function(lp) { + + flag <- .Call("getScaleFlag", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(flag) + +} + + +#------------------------------------------------------------------------------# + +solveInitialCLP <- function(lp) { + + ret <- .Call("solveInitial", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +solveInitialDualCLP <- function(lp) { + + ret <- .Call("solveInitialDual", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +solveInitialPrimalCLP <- function(lp) { + + ret <- .Call("solveInitialPrimal", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +solveInitialBarrierCLP <- function(lp) { + + ret <- .Call("solveInitialBarrier", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +solveInitialBarrierNoCrossCLP <- function(lp) { + + ret <- .Call("solveInitialBarrierNoCross", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +dualCLP <- function(lp, ifValP = 0) { + + ret <- .Call("dual", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(ifValP) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +primalCLP <- function(lp, ifValP = 0) { + + ret <- .Call("primal", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(ifValP) + ) + return(ret) + +} + + +#------------------------------------------------------------------------------# + +idiotCLP <- function(lp, thd = 0) { + + invisible( + .Call("idiot", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(thd) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +getSolStatusCLP <- function(lp) { + + stat <- .Call("getSolStatus", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(stat) + +} + + +#------------------------------------------------------------------------------# + +getObjValCLP <- function(lp) { + + obj <- .Call("getObjVal", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(obj) + +} + + +#------------------------------------------------------------------------------# + +getColPrimCLP <- function(lp) { + + col_prim <- .Call("getColPrim", clpPointer(lp), PACKAGE = "clpAPI") + + return(col_prim) + +} + + +#------------------------------------------------------------------------------# + +getColDualCLP <- function(lp) { + + col_dual <- .Call("getColDual", clpPointer(lp), PACKAGE = "clpAPI") + + return(col_dual) + +} + + +#------------------------------------------------------------------------------# + +getRowPrimCLP <- function(lp) { + + row_prim <- .Call("getRowPrim", clpPointer(lp), PACKAGE = "clpAPI") + + return(row_prim) + +} + + +#------------------------------------------------------------------------------# + +getRowDualCLP <- function(lp) { + + row_dual <- .Call("getRowDual", clpPointer(lp), PACKAGE = "clpAPI") + + return(row_dual) + +} + + +#------------------------------------------------------------------------------# + +delRowsCLP <- function(lp, num, i) { + + invisible( + .Call("delRows", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(num), + as.integer(i) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +delColsCLP <- function(lp, num, j) { + + invisible( + .Call("delCols", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(num), + as.integer(j) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +readMPSCLP <- function(lp, fname, keepNames = TRUE, ignoreErrors = FALSE) { + + check <- .Call("readMPS", PACKAGE = "clpAPI", + clpPointer(lp), + as.character(fname), + as.integer(keepNames), + as.integer(ignoreErrors) + ) + return(check) + +} + + +#------------------------------------------------------------------------------# + +saveModelCLP <- function(lp, fname) { + + check <- .Call("saveModel", PACKAGE = "clpAPI", + clpPointer(lp), + as.character(fname) + ) + return(check) + +} + + +#------------------------------------------------------------------------------# + +restoreModelCLP <- function(lp, fname) { + + check <- .Call("restoreModel", PACKAGE = "clpAPI", + clpPointer(lp), + as.character(fname) + ) + return(check) + +} + + +#------------------------------------------------------------------------------# + +versionCLP <- function() { + + version <- .Call("version", PACKAGE = "clpAPI") + return(version) + +} + + +#------------------------------------------------------------------------------# + +dropNamesCLP <- function(lp) { + + invisible( + .Call("dropNames", PACKAGE = "clpAPI", + clpPointer(lp) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +copyNamesCLP <- function(lp, cnames, rnames) { + + invisible( + .Call("copyNames", PACKAGE = "clpAPI", + clpPointer(lp), + as.character(cnames), + as.character(rnames) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +lengthNamesCLP <- function(lp) { + + nnames <- .Call("lengthNames", PACKAGE = "clpAPI", + clpPointer(lp) + ) + return(nnames) + +} + + +#------------------------------------------------------------------------------# + +rowNameCLP <- function(lp, i, rname) { + + invisible( + .Call("rowName", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(i), + as.character(rname) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +colNameCLP <- function(lp, j, cname) { + + invisible( + .Call("colName", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(j), + as.character(cname) + ) + ) + +} + + +#------------------------------------------------------------------------------# + +probNameCLP <- function(lp, pname) { + + invisible( + .Call("probName", PACKAGE = "clpAPI", + clpPointer(lp), + as.integer(nchar(pname)), + as.character(pname) + ) + ) + +} diff --git a/R/clp_ptrClass.R b/R/clp_ptrClass.R new file mode 100644 index 0000000000000000000000000000000000000000..b48eaf8144fb4b980a9d3121fb8a8bf1dc015134 --- /dev/null +++ b/R/clp_ptrClass.R @@ -0,0 +1,161 @@ +#------------------------------------------------------------------------------# +# R interface to COIN-OR Clp # +#------------------------------------------------------------------------------# + +# clp_ptrClass.R +# R interface to COIN-OR Clp. +# +# Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, +# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. +# All right reserved. +# Email: geliudie@uni-duesseldorf.de +# +# This file is part of clpAPI. +# +# ClpAPI is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ClpAPI is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with clpAPI If not, see <http://www.gnu.org/licenses/>. + + +#------------------------------------------------------------------------------# +# definition of class clpPtr # +#------------------------------------------------------------------------------# + + +# representation of class clpPtr +setClass(Class = "clpPtr", + representation( + clpPtrType = "character", + clpPointer = "externalptr" + ) + #, contains = "externalptr" +) + + +#------------------------------------------------------------------------------# + +# contructor for class clpPtr +setMethod(f = "initialize", + signature = "clpPtr", + definition = function(.Object, p, w) { + + .Object@clpPointer <- attr(p, which = w, exact = TRUE) + .Object@clpPtrType <- as.character(p) + + return(.Object) + + } +) + + +# contructor for pointers to clp problem structures +clp_Pointer <- function(pointer) { + + if (is(pointer, "clp_ptr")) { + pObj <- new("clpPtr", + p = pointer, + w = as.character("clp_ptr")) + } + else { + pObj <- pointer + } + + return(pObj) +} + + +#------------------------------------------------------------------------------# + +# clpPtrType +setMethod("clpPtrType", signature(object = "clpPtr"), + function(object) { + return(object@clpPtrType) + } +) + +setReplaceMethod("clpPtrType", signature = (object = "clpPtr"), + function(object, value) { + object@clpPtrType <- value + return(object) + } +) + + +# clpPointer +setMethod("clpPointer", signature(object = "clpPtr"), + function(object) { + return(object@clpPointer) + } +) + + +#------------------------------------------------------------------------------# + +setMethod("isNULLpointerCLP", signature(object = "clpPtr"), + function(object) { + return(.Call("isNULLptr", PACKAGE = "clpAPI", clpPointer(object))) + } +) + +setMethod("isCLPpointer", signature(object = "clpPtr"), + function(object) { + return(.Call("isCLPptr", PACKAGE = "clpAPI", clpPointer(object))) + } +) + + +#------------------------------------------------------------------------------# + +setMethod("show", signature(object = "clpPtr"), + function(object) { + + nc <- NA + + if (isNULLpointerCLP(object)) { + ptrtype <- "NULL" + } + else { + if (isCLPpointer(object)) { + ptrtype <- "COIN-OR Clp problem object" + nc <- getNumColsCLP(object) + } + else { + ptrtype <- "unknown" + } + } + + cat("object of class ", dQuote("clpPtr"), + ": pointer to ", ptrtype, ".\n", sep = "") + + if (!is.na(nc)) { + if ( (nc < 1) || (nc > 10) ) { + cat(paste("Number of variables: ", + getNumColsCLP(object), "\n")) + cat(paste("Number of constraints:", + getNumRowsCLP(object), "\n")) + } + else { + # make a more illustrative method here + cat(paste("Number of variables: ", + getNumColsCLP(object), "\n")) + cat(paste("Number of constraints:", + getNumRowsCLP(object), "\n")) + } + } + + cat(paste("Slot ", + dQuote("clpPtrType"), ": ", + clpPtrType(object), "\n", sep = "")) + cat(paste("Slot ", dQuote("clpPointer"), ": ", sep = "")) + print(slot(object, "clpPointer"), sep = "") + } +) diff --git a/R/generics.R b/R/generics.R new file mode 100644 index 0000000000000000000000000000000000000000..0e65ad2d187fe5228ade6dbfd5dc6be45101e40a --- /dev/null +++ b/R/generics.R @@ -0,0 +1,51 @@ +#------------------------------------------------------------------------------# +# R interface to COIN-OR Clp # +#------------------------------------------------------------------------------# + +# generics.R +# R interface to COIN-OR Clp. +# +# Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, +# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. +# All right reserved. +# Email: geliudie@uni-duesseldorf.de +# +# This file is part of clpAPI. +# +# ClpAPI is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ClpAPI is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with clpAPI If not, see <http://www.gnu.org/licenses/>. + + +#------------------------------------------------------------------------------# +# generics # +#------------------------------------------------------------------------------# + +setGeneric(name = "clpPointer", + def = function(object) { standardGeneric("clpPointer") } +) + +setGeneric(name = "clpPtrType", + def = function(object) { standardGeneric("clpPtrType") } +) +setGeneric(name = "clpPtrType<-", + def = function(object, value) { standardGeneric("clpPtrType<-") } +) + +setGeneric(name = "isNULLpointerCLP", + def = function(object) { standardGeneric("isNULLpointerCLP") } +) + +setGeneric(name = "isCLPpointer", + def = function(object) { standardGeneric("isCLPpointer") } +) + diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000000000000000000000000000000000000..5cee061e7ae013d4e85bfec46bffde253d801532 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,37 @@ +#------------------------------------------------------------------------------# +# R interface to COIN-OR Clp # +#------------------------------------------------------------------------------# + +# zzz.R +# R interface to COIN-OR Clp. +# +# Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, +# Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. +# All right reserved. +# Email: geliudie@uni-duesseldorf.de +# +# This file is part of clpAPI. +# +# ClpAPI is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ClpAPI is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with clpAPI If not, see <http://www.gnu.org/licenses/>. + + +.packageName <- "clpAPI" + +.onLoad <- function(libname, pkgname) { + .Call("initCLP", PACKAGE = "clpAPI") +} + +.onAttach <- function(libname, pkgname) { + packageStartupMessage("using COIN OR Clp version ", versionCLP()) +} diff --git a/build/vignette.rds b/build/vignette.rds new file mode 100644 index 0000000000000000000000000000000000000000..9b3d47b9fee20a56b8653f9b47f7d2a1babf978d Binary files /dev/null and b/build/vignette.rds differ diff --git a/cleanup b/cleanup new file mode 100755 index 0000000000000000000000000000000000000000..f34a53809d37aca8301396494144252c2bc48bca --- /dev/null +++ b/cleanup @@ -0,0 +1,4 @@ +#! /bin/sh + +rm -rf autom4te.cache src/Makevars src/*.o +exit 0 diff --git a/configure b/configure new file mode 100755 index 0000000000000000000000000000000000000000..5ca8a22d1ea69950e131590b8833701a36fdaa31 --- /dev/null +++ b/configure @@ -0,0 +1,4798 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for clpAPI 1.2.6. +# +# Report bugs to <geliudie@uni-duesseldorf.de>. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: geliudie@uni-duesseldorf.de about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='clpAPI' +PACKAGE_TARNAME='clpapi' +PACKAGE_VERSION='1.2.6' +PACKAGE_STRING='clpAPI 1.2.6' +PACKAGE_BUGREPORT='geliudie@uni-duesseldorf.de' +PACKAGE_URL='' + +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +PKG_CPPFLAGS +PKG_LIBS +PKG_CFLAGS +EGREP +GREP +ac_prefix_program +PKG_CONFIG +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_clp_include +with_clp_lib +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures clpAPI 1.2.6 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/clpapi] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of clpAPI 1.2.6:";; + esac + cat <<\_ACEOF + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-clp-include=PATH location of COIN-OR Clp include directory + [[/usr/local/include]] + --with-clp-lib=PATH location of COIN-OR Clp callable library + [[usr/local/lib]] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <geliudie@uni-duesseldorf.de>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +clpAPI configure 1.2.6 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ------------------------------------------ ## +## Report this to geliudie@uni-duesseldorf.de ## +## ------------------------------------------ ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by clpAPI $as_me 1.2.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +: ${R_HOME=`R RHOME`} +if test -z "${R_HOME}"; then + echo "could not determine R_HOME" + exit 1 +fi + +CC=`"${R_HOME}/bin/R" CMD config CC` +CPP=`"${R_HOME}/bin/R" CMD config CPP` +CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS` +CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS` +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + +ARGS_OK="FALSE" + +if test -n "$PKG_CPPFLAGS" -a -n "$PKG_LIBS" ; then + ARGS_OK="TRUE" +else + if test -n "$PKG_CPPFLAGS" -o -n "$PKG_LIBS" ; then + as_fn_error $? "Please set both variables: PKG_CPPFLAGS AND PKG_LIBS" "$LINENO" 5 + fi +fi + + + + +# Check whether --with-clp-include was given. +if test "${with_clp_include+set}" = set; then : + withval=$with_clp_include; CLP_INCLUDE=$withval +else + CLP_INCLUDE="" +fi + + + +# Check whether --with-clp-lib was given. +if test "${with_clp_lib+set}" = set; then : + withval=$with_clp_lib; CLP_LIB=$withval +else + CLP_LIB="" +fi + + + + +if test "$ARGS_OK" = "FALSE" ; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_dummy="$PATH:/usr/local/bin" +for as_dir in $as_dummy +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + if test "${PKG_CONFIG}" != "" ; then + if "${PKG_CONFIG}" --exists clp; then + + CLP_LIBS=`${PKG_CONFIG} --libs clp` + CLP_CFLAGS=`${PKG_CONFIG} --cflags clp` + + if test -z "$CLP_LIBS" -a -z "$CLP_CFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: can not get information about clp from pkg-config" >&5 +$as_echo "$as_me: can not get information about clp from pkg-config" >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: set compile and link flags according to pkg-config" >&5 +$as_echo "$as_me: set compile and link flags according to pkg-config" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: compile flags are $CLP_CFLAGS" >&5 +$as_echo "$as_me: compile flags are $CLP_CFLAGS" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: link flags are $CLP_LIBS" >&5 +$as_echo "$as_me: link flags are $CLP_LIBS" >&6;} + PKG_LIBS="${CLP_LIBS}" + PKG_CPPFLAGS="${CLP_CFLAGS}" + ARGS_OK="TRUE" + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: pkg-config file for clp is not available" >&5 +$as_echo "$as_me: pkg-config file for clp is not available" >&6;} + fi + fi +fi + + + + +if test "$ARGS_OK" = "FALSE" ; then + + if test -n "$CLP_INCLUDE" -a -n "$CLP_LIB" ; then + + if test -d "$CLP_INCLUDE" ; then + if test -d "$CLP_INCLUDE/coin" ; then + PKG_CPPFLAGS="-I${CLP_INCLUDE} -I${CLP_INCLUDE}/coin" + else + PKG_CPPFLAGS="-I${CLP_INCLUDE}" + fi + else + as_fn_error $? "directory $CLP_INCLUDE does not exist" "$LINENO" 5 + fi + + if test -d "$CLP_LIB" ; then + if test -d "$CLP_LIB/coin" ; then + PKG_LIBS="-L${CLP_LIB} -L${CLP_LIB}/coin" + else + PKG_LIBS="-L${CLP_LIB}" + fi + else + as_fn_error $? "directory $CLP_LIB does not exist" "$LINENO" 5 + fi + + else + + + if test "x$prefix" = xNONE; then + $as_echo_n "checking for prefix by " >&6 + # Extract the first word of "clp", so it can be a program name with args. +set dummy clp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_prefix_program+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_prefix_program in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_prefix_program="$ac_prefix_program" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_prefix_program="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_prefix_program=$ac_cv_path_ac_prefix_program +if test -n "$ac_prefix_program"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prefix_program" >&5 +$as_echo "$ac_prefix_program" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -n "$ac_prefix_program"; then + prefix=`$as_dirname -- "$ac_prefix_program" || +$as_expr X"$ac_prefix_program" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_prefix_program" : 'X\(//\)[^/]' \| \ + X"$ac_prefix_program" : 'X\(//\)$' \| \ + X"$ac_prefix_program" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_prefix_program" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + prefix=`$as_dirname -- "$prefix" || +$as_expr X"$prefix" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$prefix" : 'X\(//\)[^/]' \| \ + X"$prefix" : 'X\(//\)$' \| \ + X"$prefix" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$prefix" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + fi +fi + + + if test "$prefix" = "NONE" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: No prefix given, trying /usr and /usr/local" >&5 +$as_echo "$as_me: No prefix given, trying /usr and /usr/local" >&6;} + + if test -d "/usr/include" -o -d "/usr/local/include" ; then + PKG_CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/include/coin -I/usr/local/include/coin" + else + as_fn_error $? "directories /usr/include and /usr/local/include do not exist" "$LINENO" 5 + fi + + if test -d "/usr/local/lib" -o -d "/usr/local/lib64" -o -d "/usr/lib" -o -d "/usr/lib64" ; then + PKG_LIBS="" + if test -d "/usr/local/lib" ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib" + if test -d "/usr/local/lib/coin" ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib/coin" + fi + fi + if test -d "/usr/local/lib64" ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib64" + if test -d "/usr/local/lib64/coin" ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib64/coin" + fi + fi + if test -d "/usr/lib" ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib" + if test -d "/usr/lib/coin" ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib/coin" + fi + fi + if test -d "/usr/lib64" ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib64" + if test -d "/usr/lib64/coin" ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib64/coin" + fi + fi + # PKG_LIBS="-L/usr/local/lib -Wl,-rpath /usr/local/lib" + else + as_fn_error $? "none of the directories /usr/local/lib, /usr/local/lib64, /usr/lib of /usr/lib64 exists" "$LINENO" 5 + fi + + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: found executable clp in $prefix" >&5 +$as_echo "$as_me: found executable clp in $prefix" >&6;} + + if test -d "$prefix/include" ; then + PKG_CPPFLAGS="-I$prefix/include" + if test -d "$prefix/include/coin" ; then + PKG_CPPFLAGS="$PKG_CPPFLAGS -I$prefix/include/coin" + fi + else + as_fn_error $? "directory $prefix/include does not exist" "$LINENO" 5 + fi + + if test -d "$prefix/lib" -o -d "$prefix/lib64" ; then + PKG_LIBS="" + if test -d "$prefix/lib" ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib" + if test -d "$prefix/lib/coin" ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib/coin" + fi + fi + if test -d "$prefix/lib64" ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib64" + if test -d "$prefix/lib64/coin" ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib64/coin" + fi + fi + else + as_fn_error $? "neither $prefix/lib nor $prefix/lib64 exist" "$LINENO" 5 + fi + + fi + + fi + + PKG_LIBS="${PKG_LIBS} -lClp -lCoinUtils -lm" + + ARGS_OK="TRUE" +fi + + + +if test -z "$PKG_CFLAGS" ; then + if test "${R_ARCH}" = "/x86_64" ; then + PKG_CFLAGS="-m64" + elif test "${R_ARCH}" = "/i386" ; then + PKG_CFLAGS="-m32" + else + PKG_CFLAGS="" + fi +fi + + + +LIBS="${PKG_LIBS}" +CFLAGS="${CFLAGS} ${PKG_CFLAGS}" +CPPFLAGS="${CPPFLAGS} ${PKG_CPPFLAGS}" + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_header_mongrel "$LINENO" "Clp_C_Interface.h" "ac_cv_header_Clp_C_Interface_h" "$ac_includes_default" +if test "x$ac_cv_header_Clp_C_Interface_h" = xyes; then : + +else + as_fn_error $? "Could not find Clp_C_Interface.h: + clpAPI requires clp from http://www.coin-or.org/projects/Clp.xml + use --with-clp-include or CLP_INCLUDE to specify the include path." "$LINENO" 5 +fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing Clp_newModel" >&5 +$as_echo_n "checking for library containing Clp_newModel... " >&6; } +if ${ac_cv_search_Clp_newModel+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char Clp_newModel (); +int +main () +{ +return Clp_newModel (); + ; + return 0; +} +_ACEOF +for ac_lib in '' Clp; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_Clp_newModel=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_Clp_newModel+:} false; then : + break +fi +done +if ${ac_cv_search_Clp_newModel+:} false; then : + +else + ac_cv_search_Clp_newModel=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_Clp_newModel" >&5 +$as_echo "$ac_cv_search_Clp_newModel" >&6; } +ac_res=$ac_cv_search_Clp_newModel +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + as_fn_error $? "Could not link to clp: + use --with-clp-lib or CLP_LIB to specify the lib path." "$LINENO" 5 +fi + + + + + + + +ac_config_files="$ac_config_files src/Makevars" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +# +# If the first sed substitution is executed (which looks for macros that +# take arguments), then branch to the quote section. Otherwise, +# look for a macro that doesn't take arguments. +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} +t clear +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +t quote +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +t quote +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` + + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by clpAPI $as_me 1.2.6, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + +Configuration files: +$config_files + +Report bugs to <geliudie@uni-duesseldorf.de>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +clpAPI config.status 1.2.6 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/Makevars") CONFIG_FILES="$CONFIG_FILES src/Makevars" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +exit 0 diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..a7b1946f99467d526606a6cb3dbf18e01e7ce8b4 --- /dev/null +++ b/configure.ac @@ -0,0 +1,259 @@ +AC_INIT([clpAPI], [1.2.6], [geliudie@uni-duesseldorf.de]) + +dnl # -------------------------------------------------------------------- +dnl # global (environment) variables +dnl # -------------------------------------------------------------------- +dnl +dnl # PKG_CPPFLAGS C preprocessor flags -I... +dnl # PKG_CFLAGS C compiler flags +dnl # PKG_LIBS libraries -l... + + +dnl # -------------------------------------------------------------------- +dnl # R compiler and flags +dnl # -------------------------------------------------------------------- + +: ${R_HOME=`R RHOME`} +if test -z "${R_HOME}"; then + echo "could not determine R_HOME" + exit 1 +fi + +dnl # GNU R default settings +CC=`"${R_HOME}/bin/R" CMD config CC` +CPP=`"${R_HOME}/bin/R" CMD config CPP` +CFLAGS=`"${R_HOME}/bin/R" CMD config CFLAGS` +CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS` +AC_PROG_CC +AC_PROG_CPP + + +dnl # -------------------------------------------------------------------- +dnl # test for global variables +dnl # -------------------------------------------------------------------- + +ARGS_OK="FALSE" + +if test [ -n "$PKG_CPPFLAGS" -a -n "$PKG_LIBS" ] ; then + ARGS_OK="TRUE" +else + if test [ -n "$PKG_CPPFLAGS" -o -n "$PKG_LIBS" ] ; then + AC_MSG_ERROR([Please set both variables: PKG_CPPFLAGS AND PKG_LIBS]) + fi +fi + + +dnl # -------------------------------------------------------------------- +dnl # get arguments +dnl # -------------------------------------------------------------------- + +AC_ARG_WITH(clp-include, + AC_HELP_STRING([--with-clp-include=PATH], + [location of COIN-OR Clp include directory [[/usr/local/include]]] + ), + [CLP_INCLUDE=$withval], + [CLP_INCLUDE=""]) + +AC_ARG_WITH(clp-lib, + AC_HELP_STRING([--with-clp-lib=PATH], + [location of COIN-OR Clp callable library [[usr/local/lib]]] + ), + [CLP_LIB=$withval], + [CLP_LIB=""]) + + +dnl # -------------------------------------------------------------------- +dnl # pkg-config +dnl # -------------------------------------------------------------------- + +dnl # include and library directories +if test [ "$ARGS_OK" = "FALSE" ] ; then + AC_PATH_PROG([PKG_CONFIG], [pkg-config], [], [$PATH:/usr/local/bin]) + + if test [ "${PKG_CONFIG}" != "" ] ; then + if "${PKG_CONFIG}" --exists clp; then + + CLP_LIBS=`${PKG_CONFIG} --libs clp` + CLP_CFLAGS=`${PKG_CONFIG} --cflags clp` + + if test [ -z "$CLP_LIBS" -a -z "$CLP_CFLAGS" ] ; then + AC_MSG_NOTICE([can not get information about clp from pkg-config]) + else + AC_MSG_NOTICE([set compile and link flags according to pkg-config]) + AC_MSG_NOTICE([compile flags are $CLP_CFLAGS]) + AC_MSG_NOTICE([link flags are $CLP_LIBS]) + PKG_LIBS="${CLP_LIBS}" + PKG_CPPFLAGS="${CLP_CFLAGS}" + ARGS_OK="TRUE" + fi + else + AC_MSG_NOTICE([pkg-config file for clp is not available]) + fi + fi +fi + + +dnl # -------------------------------------------------------------------- +dnl # test arguments +dnl # -------------------------------------------------------------------- + +dnl # include and library directories + +dnl # include and library directories +if test [ "$ARGS_OK" = "FALSE" ] ; then + + if test [ -n "$CLP_INCLUDE" -a -n "$CLP_LIB" ] ; then + + if test [ -d "$CLP_INCLUDE" ] ; then + if test [ -d "$CLP_INCLUDE/coin" ] ; then + PKG_CPPFLAGS="-I${CLP_INCLUDE} -I${CLP_INCLUDE}/coin" + else + PKG_CPPFLAGS="-I${CLP_INCLUDE}" + fi + else + AC_MSG_ERROR([directory $CLP_INCLUDE does not exist]) + fi + + if test [ -d "$CLP_LIB" ] ; then + if test [ -d "$CLP_LIB/coin" ] ; then + PKG_LIBS="-L${CLP_LIB} -L${CLP_LIB}/coin" + else + PKG_LIBS="-L${CLP_LIB}" + fi + else + AC_MSG_ERROR([directory $CLP_LIB does not exist]) + fi + + else + + dnl # if no arguments are given, try to find the clp executable. If is not + dnl # found, use /usr/local + + AC_PREFIX_PROGRAM(clp) + + if test [ "$prefix" = "NONE" ] ; then + + AC_MSG_NOTICE([No prefix given, trying /usr and /usr/local]) + + if test [ -d "/usr/include" -o -d "/usr/local/include" ] ; then + PKG_CPPFLAGS="-I/usr/include -I/usr/local/include -I/usr/include/coin -I/usr/local/include/coin" + else + AC_MSG_ERROR([directories /usr/include and /usr/local/include do not exist]) + fi + + if test [ -d "/usr/local/lib" -o -d "/usr/local/lib64" -o -d "/usr/lib" -o -d "/usr/lib64"] ; then + PKG_LIBS="" + if test [ -d "/usr/local/lib" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib" + if test [ -d "/usr/local/lib/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib/coin" + fi + fi + if test [ -d "/usr/local/lib64" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib64" + if test [ -d "/usr/local/lib64/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/local/lib64/coin" + fi + fi + if test [ -d "/usr/lib" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib" + if test [ -d "/usr/lib/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib/coin" + fi + fi + if test [ -d "/usr/lib64" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib64" + if test [ -d "/usr/lib64/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L/usr/lib64/coin" + fi + fi + # PKG_LIBS="-L/usr/local/lib -Wl,-rpath /usr/local/lib" + else + AC_MSG_ERROR([none of the directories /usr/local/lib, /usr/local/lib64, /usr/lib of /usr/lib64 exists]) + fi + + else + + AC_MSG_NOTICE([found executable clp in $prefix]) + + if test [ -d "$prefix/include" ] ; then + PKG_CPPFLAGS="-I$prefix/include" + if test [ -d "$prefix/include/coin" ] ; then + PKG_CPPFLAGS="$PKG_CPPFLAGS -I$prefix/include/coin" + fi + else + AC_MSG_ERROR([directory $prefix/include does not exist]) + fi + + if test [ -d "$prefix/lib" -o -d "$prefix/lib64" ] ; then + PKG_LIBS="" + if test [ -d "$prefix/lib" ] ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib" + if test [ -d "$prefix/lib/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib/coin" + fi + fi + if test [ -d "$prefix/lib64" ] ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib64" + if test [ -d "$prefix/lib64/coin" ] ; then + PKG_LIBS="$PKG_LIBS -L$prefix/lib64/coin" + fi + fi + else + AC_MSG_ERROR([neither $prefix/lib nor $prefix/lib64 exist]) + fi + + fi + + fi + + PKG_LIBS="${PKG_LIBS} -lClp -lCoinUtils -lm" + + ARGS_OK="TRUE" +fi + + +dnl # -------------------------------------------------------------------- +dnl # CFLAGS +dnl # -------------------------------------------------------------------- + +if test [ -z "$PKG_CFLAGS" ] ; then + if test [ "${R_ARCH}" = "/x86_64" ] ; then + PKG_CFLAGS="-m64" + elif test [ "${R_ARCH}" = "/i386" ] ; then + PKG_CFLAGS="-m32" + else + PKG_CFLAGS="" + fi +fi + + +dnl # -------------------------------------------------------------------- +dnl # check header and library +dnl # -------------------------------------------------------------------- + +LIBS="${PKG_LIBS}" +CFLAGS="${CFLAGS} ${PKG_CFLAGS}" +CPPFLAGS="${CPPFLAGS} ${PKG_CPPFLAGS}" + +AC_CHECK_HEADER([Clp_C_Interface.h],, + AC_MSG_ERROR([Could not find Clp_C_Interface.h: + clpAPI requires clp from http://www.coin-or.org/projects/Clp.xml + use --with-clp-include or CLP_INCLUDE to specify the include path.])) + + +AC_SEARCH_LIBS([Clp_newModel], [Clp], , + AC_MSG_ERROR([Could not link to clp: + use --with-clp-lib or CLP_LIB to specify the lib path.])) + + +dnl # -------------------------------------------------------------------- +dnl # substitute src/Makevars +dnl # -------------------------------------------------------------------- + +AC_SUBST(PKG_CFLAGS) +AC_SUBST(PKG_LIBS) +AC_SUBST(PKG_CPPFLAGS) +AC_OUTPUT(src/Makevars) + +exit 0 diff --git a/configure.win b/configure.win new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/inst/INSTALL b/inst/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..ec725f88f0adc0244236db11f822d316d09e256e --- /dev/null +++ b/inst/INSTALL @@ -0,0 +1,66 @@ +GNU R package clpAPI: R Interface to C API of COIN-OR Clp + + +The installation procedure for the clpAPI package needs to know where to +find the COIN-OR Clp include directory and where to find the callable library. + + +# ---------------------------------------------------------------------------- # +# Linux and MacOS X installation +# ---------------------------------------------------------------------------- # + +There are basically four different ways of installing the clpAPI package: + +1) Use --with-clp-<ARG> + + --with-clp-include=PATH with PATH being the include directory of + COIN-OR Clp + + --with-clp-lib=PATH with PATH being the directory containing the + callable library. + + R CMD INSTALL --configure-args=" \ + --with-clp-include=/path/to/include/dir \ + --with-clp-lib=/path/to/lib/dir" clpAPI_X.X.X.tar.gz + + + When using --with-clp-<ARG>, both arguments must be given. + +2) Use of environment variables + + PKG_CPPFLAGS giving the PATH to the include directory of + COIN-OR Clp + PKG_LIBS giving the PATH to the directory containing the + callable library. + +3) Use --prefix + + --prefix=PATH with path being the installation directory of + COIN-OR Clp. The include directory is assumed to + be PATH/include and the callable library should + be in PATH/lib. + + If either --with-clp-<ARG> nor --prefix is given, it is checked wether + clp is in the PATH. If yes, PATH is used as prefix. If not, + /usr/local/include and /usr/local/lib are tested. + +3) Use pkg-config + + If pkg-config is available on your system, the pkg-config information + of COIN-OR Clp will be used. + + +# ---------------------------------------------------------------------------- # +# Windows installation +# ---------------------------------------------------------------------------- # + +For the installation on Windows systems the file Makewars.win in src/ is +required. The file looks like this: + +PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I${CLP_PATH}/include/coin +PKG_LIBS=-L${CLP_PATH}/lib/coin -lClp -lCoinUtils -lstdc++ + +with the environment variable CLP_PATH being the installation directory +of COIN-OR Clp. This procedure was tested successfully on 32-bit Windows XP. + + diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd new file mode 100644 index 0000000000000000000000000000000000000000..59d6fe5f16120ba33cac2e3feee0e236f8e4d855 --- /dev/null +++ b/inst/NEWS.Rd @@ -0,0 +1,180 @@ +%% clpAPI Version History + +\name{NEWS} +\title{clpAPI News} +\encoding{UTF-8} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.6 2013-10-26}{ + \itemize{ + \item a minor bugfix in file \file{configure.ac} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.5 2013-09-08}{ + \itemize{ + \item removed argument \code{--enable-lapack} from file \file{configure.ac} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.4 2013-07-17}{ + \itemize{ + \item added function \code{probNameCLP()} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.3 2013-05-23}{ + \itemize{ + \item prints the version number of COIN-OR Clp on startup + \item added functions \code{dropNamesCLP()}, \code{copyNamesCLP()} and + \code{lengthNamesCLP()} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.2 2013-01-16}{ + \itemize{ + \item removed old file \file{NEWS.Rd} from top level directory + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.1 2012-04-21}{ + \itemize{ + \item bugfix in file \file{configure.ac} when using pkg-config + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.2.0 2012-04-20}{ + \itemize{ + \item updated \file{configure.ac} script + + \item file \file{NEWS} is now in \file{inst/NEWS.Rd} + + \item added finalizer for COIN-OR Clp problem objects + + \item Function \code{initProbCLP()} returns an instances of class + \code{clpPtr}. This class has two data slots: + \tabular{ll}{ + clpPtrType \tab a character string giving the pointer type and \cr + clpPointer \tab a pointer to a C structure \cr + } + + \item file \file{c2r.map} in \file{inst/}: mapping of filenames between + C API and \pkg{clpAPI}, run + \preformatted{ +c2r <- system.file(package = "clpAPI", "c2r.map") +source(c2r) + } + in order to use original function names of the COIN-OR Clp C API. + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.7 2011-08-22}{ + \itemize{ + \item minor update in \file{configure.ac} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.6 2011-07-29}{ + \itemize{ + \item \file{configure.ac} script and \file{Makevars.win} are now compatible + to COIN-OR Clp version 1.14.0 + } +} + + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.5 2011-07-28}{ + \itemize{ + \item added \file{NAMESPACE} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.4 2011-07-27}{ + \itemize{ + \item removed file \file{COPYING} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.3 2011-07-27}{ + \itemize{ + \item changes in \file{configure.ac} + \item updated package vignette + \item added files \file{INSTALL} and \file{README} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.2 2011-07-14}{ + \itemize{ + \item minor changes in \file{configure.ac} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.1.1 2011-07-12}{ + \itemize{ + \item renamed to \pkg{clpAPI} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.0.3 2011-05-12}{ + \itemize{ + \item added functions \code{getColDualCLP()}, \code{getRowPrimCLP()} and + \code{getRowDualCLP()} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.0.2 2010-12-15}{ + \itemize{ + \item fixed a bug in \file{configure.ac} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.0.1 2010-11-05}{ + \itemize{ + + + \item added functions \code{addRowsCLP()}, \code{addColsCLP()}, + \code{deleteRowsCLP()} and \code{deleteColsCLP()} + } +} + + +% ---------------------------------------------------------------------------- % +\section{Changes in version 1.0.0 2010-08-19}{ + \itemize{ + \item initial public release + } +} + + diff --git a/inst/README b/inst/README new file mode 100644 index 0000000000000000000000000000000000000000..7ee9c6635cce030573260378e08bb1cdefc1b826 --- /dev/null +++ b/inst/README @@ -0,0 +1,4 @@ +GNU R package clpAPI: R Interface to C API of COIN-OR Clp + +The package clpAPI requires a working installation of COIN-OR Clp (including +libraries and header files). diff --git a/inst/c2r.map b/inst/c2r.map new file mode 100644 index 0000000000000000000000000000000000000000..86f0e3f2c0dad7393efab38c87f90c47eda7dcc3 --- /dev/null +++ b/inst/c2r.map @@ -0,0 +1,61 @@ +#------------------------------------------------------------------------------# +# map COIN-OR Clp function names to clpAPI function names # +#------------------------------------------------------------------------------# + +# COIN-OR Clp # clpAPI + +Clp_addColumns <- clpAPI::addColsCLP +Clp_addRows <- clpAPI::addRowsCLP +Clp_chgColumnLower <- clpAPI::chgColLowerCLP +Clp_chgColumnUpper <- clpAPI::chgColUpperCLP +Clp_chgObjCoefficients <- clpAPI::chgObjCoefsCLP +Clp_chgRowLower <- clpAPI::chgRowLowerCLP +Clp_chgRowUpper <- clpAPI::chgRowUpperCLP +#Clp_columnName <- clpAPI::colNameCLP +Clp_copyNames <- clpAPI::copyNamesCLP +Clp_deleteColumns <- clpAPI::delColsCLP +Clp_deleteModel <- clpAPI::delProbCLP +Clp_deleteRows <- clpAPI::delRowsCLP +Clp_dropNames <- clpAPI::dropNamesCLP +Clp_dual <- clpAPI::dualCLP +Clp_dualColumnSolution <- clpAPI::getColDualCLP +Clp_columnLower <- clpAPI::getColLowerCLP +Clp_primalColumnSolution <- clpAPI::getColPrimCLP +Clp_columnUpper <- clpAPI::getColUpperCLP +Clp_getIndices <- clpAPI::getIndCLP +Clp_logLevel <- clpAPI::getLogLevelCLP +Clp_getElements <- clpAPI::getNnzCLP +Clp_numberColumns <- clpAPI::getNumColsCLP +Clp_getNumElements <- clpAPI::getNumNnzCLP +Clp_numberRows <- clpAPI::getNumRowsCLP +Clp_objective <- clpAPI::getObjCoefsCLP +Clp_optimizationDirection <- clpAPI::getObjDirCLP +Clp_objectiveValue <- clpAPI::getObjValCLP +Clp_dualRowSolution <- clpAPI::getRowDualCLP +Clp_rowLower <- clpAPI::getRowLowerCLP +Clp_primalRowSolution <- clpAPI::getRowPrimCLP +Clp_problemName <- clpAPI::probNameCLP +Clp_rowUpper <- clpAPI::getRowUpperCLP +Clp_scalingFlag <- clpAPI::getScaleFlagCLP +Clp_status <- clpAPI::getSolStatusCLP +Clp_getVectorLengths <- clpAPI::getVecLenCLP +Clp_getVectorStarts <- clpAPI::getVecStartCLP +Clp_idiot <- clpAPI::idiotCLP +Clp_newModel <- clpAPI::initProbCLP +Clp_lengthNames <- clpAPI::lengthNamesCLP +Clp_loadProblem <- clpAPI::loadProblemCLP +Clp_primal <- clpAPI::primalCLP +Clp_printModel <- clpAPI::printModelCLP +Clp_readMps <- clpAPI::readMPSCLP +Clp_resize <- clpAPI::resizeCLP +Clp_restoreModel <- clpAPI::restoreModelCLP +#Clp_rowName <- clpAPI::rowNameCLP +Clp_saveModel <- clpAPI::saveModelCLP +Clp_scaling <- clpAPI::scaleModelCLP +Clp_setLogLevel <- clpAPI::setLogLevelCLP +Clp_setOptimizationDirection <- clpAPI::setObjDirCLP +Clp_initialBarrierSolve <- clpAPI::solveInitialBarrierCLP +Clp_initialBarrierNoCrossSolve <- clpAPI::solveInitialBarrierNoCrossCLP +Clp_initialSolve <- clpAPI::solveInitialCLP +Clp_initialDualSolve <- clpAPI::solveInitialDualCLP +Clp_initialPrimalSolve <- clpAPI::solveInitialPrimalCLP diff --git a/inst/doc/clpAPI.R b/inst/doc/clpAPI.R new file mode 100644 index 0000000000000000000000000000000000000000..3dac6b3aa4eb2ce0a25bb2b2c21fd198e7d287cf --- /dev/null +++ b/inst/doc/clpAPI.R @@ -0,0 +1,127 @@ +### R code from vignette source 'clpAPI.Rnw' +### Encoding: UTF-8 + +################################################### +### code chunk number 1: clpAPI.Rnw:74-75 +################################################### +library(clpAPI) + + +################################################### +### code chunk number 2: clpAPI.Rnw:78-79 +################################################### +prob <- initProbCLP() + + +################################################### +### code chunk number 3: clpAPI.Rnw:82-83 +################################################### +setObjDirCLP(prob, -1) + + +################################################### +### code chunk number 4: clpAPI.Rnw:86-88 +################################################### +nc <- 3 +nr <- 3 + + +################################################### +### code chunk number 5: clpAPI.Rnw:92-93 +################################################### +ia <- c(0, 1, 2, 0, 1, 2, 0, 1, 2) + + +################################################### +### code chunk number 6: clpAPI.Rnw:96-97 +################################################### +ja <- c(0, 3, 6, 9) + + +################################################### +### code chunk number 7: clpAPI.Rnw:100-101 +################################################### +ar <- c(2, 4, 3, 3, 1, 4, 1, 2, 2) + + +################################################### +### code chunk number 8: clpAPI.Rnw:104-105 +################################################### +clb <- rep(0, 3) + + +################################################### +### code chunk number 9: clpAPI.Rnw:108-109 +################################################### +rub <- c(5, 11, 8) + + +################################################### +### code chunk number 10: clpAPI.Rnw:112-113 +################################################### +obj <- c(5, 4, 3) + + +################################################### +### code chunk number 11: clpAPI.Rnw:116-117 +################################################### +loadProblemCLP(prob, nc, nr, ia, ja, ar, clb, NULL, obj, NULL, rub) + + +################################################### +### code chunk number 12: clpAPI.Rnw:120-121 +################################################### +solveInitialCLP(prob) + + +################################################### +### code chunk number 13: clpAPI.Rnw:124-125 +################################################### +getObjValCLP(prob) + + +################################################### +### code chunk number 14: clpAPI.Rnw:129-130 +################################################### +getColPrimCLP(prob) + + +################################################### +### code chunk number 15: clpAPI.Rnw:134-135 +################################################### +getColDualCLP(prob) + + +################################################### +### code chunk number 16: clpAPI.Rnw:138-139 +################################################### +delProbCLP(prob) + + +################################################### +### code chunk number 17: clpAPI.Rnw:154-155 +################################################### +help("Clp_addColumns") + + +################################################### +### code chunk number 18: clpAPI.Rnw:165-167 +################################################### +c2r <- system.file(package = "clpAPI", "c2r.map") +source(c2r) + + +################################################### +### code chunk number 19: clpAPI.Rnw:170-172 +################################################### +pr1 <- initProbCLP() +delProbCLP(pr1) + + +################################################### +### code chunk number 20: clpAPI.Rnw:175-177 +################################################### +pr2 <- Clp_newModel() +Clp_deleteModel(pr2) + + diff --git a/inst/doc/clpAPI.Rnw b/inst/doc/clpAPI.Rnw new file mode 100644 index 0000000000000000000000000000000000000000..c1bf50b28847f3bc53b47e394ed157ac367438ca --- /dev/null +++ b/inst/doc/clpAPI.Rnw @@ -0,0 +1,183 @@ +\documentclass[a4paper,headings=small]{scrartcl} +\usepackage[english]{babel} +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc} +\usepackage{textcomp,lmodern} +\typearea[current]{last} +\usepackage{fixltx2e,mparhack,mathdots} + +\usepackage{natbib} +\usepackage{hyperref} +\bibliographystyle{abbrvnat} + +\usepackage{microtype} + + +\newcommand{\Comp}[1]{\texttt{#1}} + +\addtolength{\skip\footins}{0.5\baselineskip} + +\usepackage{fnpos} + + +\hypersetup{ + pdftitle = {clpAPI -- Quick Start}, + pdfauthor = {Gabriel Gelius-Dietrich}, + pdfsubject = {R Interface to C API of COIN-OR Clp}, + pdfkeywords = {Optimization, COIN-OR Clp}, + pdfborder = {0 0 0}, + pdfhighlight = {/N} +} + + +\newcommand{\pkg}[1]{\emph{#1}} +\newcommand{\pkgname}{\pkg{clpAPI}} +\newcommand{\prgname}[1]{\textsc{#1}} + + +\begin{document} +\title{clpAPI -- Quick Start} +%\VignetteIndexEntry{Package clpAPI -- Quick Start} +\author{Gabriel Gelius-Dietrich} + +\maketitle + +\section{Introduction} +The package \pkgname{} provides a low level interface to the C~API of +COIN-OR Clp\footnote{COIN-OR linear programming version 1.12.0 or higher +\url{https://projects.coin-or.org/Clp}} (COIN-OR linear programming). +The package \pkgname{} relies on a separate installation of COIN-OR Clp. + +\section{Installation} +See \Comp{INSTALL} for installation instructions and platform specific details. + +\section{Usage} + +In the following, an example lp-problem will be created and solved: + +\noindent +\hspace{.5in} maximize +$$z = 5 x_1 + 4 x_2 + 3 x_3$$ +\hspace{.5in} subject to +$$ +\begin{array}{r@{\:}c@{\:}r@{\:}c@{\:}r@{\:}c@{\:}r} +2 x_1 &+& 3 x_2 &+& x_3 & \leq 5 \\ +4 x_1 &+& x_2 &+& 2 x_3 & \leq 11 \\ +3 x_1 &+& 4 x_2 &+& 2 x_3 & \leq 8 \\ +\end{array} +$$ +\hspace{.5in} where all variables are non-negative +$$x_1 \geq 0, \ x_2 \geq 0, \ x_3 \geq 0$$ + +\noindent +Load the library. +<<>>= +library(clpAPI) +@ +Create a problem object. +<<>>= +prob <- initProbCLP() +@ +Set the direction of optimization ($-1$: maximize, $1$: minimize). +<<>>= +setObjDirCLP(prob, -1) +@ +Prepare data structures for the problem object. Number of columns and rows: +<<>>= +nc <- 3 +nr <- 3 +@ +The constraint matrix is passed in column major order format. \textbf{Be +careful here:} all indices start with 0! Row indices. +<<>>= +ia <- c(0, 1, 2, 0, 1, 2, 0, 1, 2) +@ +Column indices. +<<>>= +ja <- c(0, 3, 6, 9) +@ +Non-zero elements. +<<>>= +ar <- c(2, 4, 3, 3, 1, 4, 1, 2, 2) +@ +Lower bounds for the variables (columns). +<<>>= +clb <- rep(0, 3) +@ +Right hand side (row upper bounds for the rows). +<<>>= +rub <- c(5, 11, 8) +@ +Objective coefficients. +<<>>= +obj <- c(5, 4, 3) +@ +Load problem data into the problem object. +<<>>= +loadProblemCLP(prob, nc, nr, ia, ja, ar, clb, NULL, obj, NULL, rub) +@ +Solve the problem using the simplex algorithm. +<<>>= +solveInitialCLP(prob) +@ +Retrieve the value of the objective function after optimization. +<<>>= +getObjValCLP(prob) +@ +Retrieve the primal values of the structural variables (columns) after +optimization. +<<>>= +getColPrimCLP(prob) +@ +Retrieve the dual values of the structural variables (columns) after +optimization (reduced costs). +<<>>= +getColDualCLP(prob) +@ +Free memory, allacated to the problem object. +<<>>= +delProbCLP(prob) +@ + + +\section{Function names} + +\subsection{Searching} + +The function names in \pkgname{} are different from the names in +\prgname{COIN-OR Clp}, +e.\,g. the function \texttt{addColsCLP} in \pkgname{} is called +\texttt{Clp\_addColumns} in \prgname{COIN-OR Clp}. The directory \texttt{inst/} +containes a file \texttt{c2r.map} which maps a \prgname{COIN-OR Clp} function +name to the corresponding \pkgname{} function name. Additionally, all man-pages +contain an alias to the \prgname{COIN-OR Clp} function name. The call +<<>>= +help("Clp_addColumns") +@ +will bring up the man-page of \texttt{addColsCLP}. + + +\subsection{Mapping} + +The file \texttt{c2r.map} in \texttt{inst/} maps the \pkgname{} function names +to the orininal \prgname{COIN-OR Clp} function names of its C-API. +To use the latter, run +<<>>= +c2r <- system.file(package = "clpAPI", "c2r.map") +source(c2r) +@ +now either +<<>>= +pr1 <- initProbCLP() +delProbCLP(pr1) +@ +or the original functions +<<>>= +pr2 <- Clp_newModel() +Clp_deleteModel(pr2) +@ +work both. Keep in mind that the mapping only affects the function names not the +arguments of a function. + + +\end{document} diff --git a/man/addColsCLP.Rd b/man/addColsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..5335e5d8a808c6fc441f6dcc3e2394734ad29469 --- /dev/null +++ b/man/addColsCLP.Rd @@ -0,0 +1,71 @@ +\name{addColsCLP} +\alias{addColsCLP} +\alias{Clp_addColumns} + +\title{ + Add Columns +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_addColumns}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + addColsCLP(lp, ncols, lb, ub, obj, colst, rows, val) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ncols}{ + Number of columns to add. + } + \item{lb}{ + Lower bounds of the new columns. + } + \item{ub}{ + Upper bounds of the new columns. + } + \item{obj}{ + Objective coeficients of the new columns. + } + \item{colst}{ + Vector containing the starting indices of new rows (Arguments \code{rows} + and \code{val} must be in column major order). The first element of + \code{colst} must be \code{0}, the last element must be + \code{length(val)+1}. + } + \item{rows}{ + Row indices of the non zero elements in the new columns. + } + \item{val}{ + Numerical values of the new non zero elements. + } +} + +\details{ + Interface to the C function \code{addRows} which calls + the COIN-OR Clp function \code{Clp_addRows}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } diff --git a/man/addRowsCLP.Rd b/man/addRowsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..9e29fea229bdc4010ff9e49575e7b47e03bd00f6 --- /dev/null +++ b/man/addRowsCLP.Rd @@ -0,0 +1,68 @@ +\name{addRowsCLP} +\alias{addRowsCLP} +\alias{Clp_addRows} + +\title{ + Add Rows +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_addRows}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + addRowsCLP(lp, nrows, lb, ub, rowst, cols, val) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{nrows}{ + Number of rows to add. + } + \item{lb}{ + Lower bounds of the new rows. + } + \item{ub}{ + Upper bounds of the new rows. + } + \item{rowst}{ + Vector containing the starting indices of new rows (Arguments \code{cols} + and \code{val} must be in row major order). The first element of + \code{rowst} must be \code{0}, the last element must be + \code{length(val)+1}. + } + \item{cols}{ + Column indices of the non zero elements in the new rows. + } + \item{val}{ + Numerical values of the new non zero elements. + } +} + +\details{ + Interface to the C function \code{addRows} which calls + the COIN-OR Clp function \code{Clp_addRows}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } diff --git a/man/chgColLowerCLP.Rd b/man/chgColLowerCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..980f8504d90fe1268dba80b51f023d3512bbe9e0 --- /dev/null +++ b/man/chgColLowerCLP.Rd @@ -0,0 +1,52 @@ +\name{chgColLowerCLP} +\alias{chgColLowerCLP} +\alias{Clp_chgColumnLower} + +\title{ + Set/Change Column Lower Bounds +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_chgColumnLower}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + chgColLowerCLP(lp, lb) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{lb}{ + Numeric vector containing the lower bounds of the + columns of the model. + } +} + +\details{ + Interface to the C function \code{chgColLower} which calls + the COIN-OR Clp function \code{Clp_chgColumnLower}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/chgColUpperCLP.Rd b/man/chgColUpperCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..26dd4d5fa5875b3f693fc401c94f6440248b72e5 --- /dev/null +++ b/man/chgColUpperCLP.Rd @@ -0,0 +1,52 @@ +\name{chgColUpperCLP} +\alias{chgColUpperCLP} +\alias{Clp_chgColumnUpper} + +\title{ + Set/Change Column Upper Bounds +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_chgColumnUpper}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + chgColUpperCLP(lp, ub) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ub}{ + Numeric vector containing the upper bounds of the + columns of the model. + } +} + +\details{ + Interface to the C function \code{chgColUpper} which calls + the COIN-OR Clp function \code{Clp_chgColumnUpper}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/chgObjCoefsCLP.Rd b/man/chgObjCoefsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..b5233880108101940f896e8f2484daef270a7386 --- /dev/null +++ b/man/chgObjCoefsCLP.Rd @@ -0,0 +1,52 @@ +\name{chgObjCoefsCLP} +\alias{chgObjCoefsCLP} +\alias{Clp_chgObjCoefficients} + +\title{ + Set/Change Objective Coefficients +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_chgObjCoefficients}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + chgObjCoefsCLP(lp, objCoef) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{objCoef}{ + Numeric vector containing the objective coefficients + of the model. + } +} + +\details{ + Interface to the C function \code{chgObjCoefs} which calls + the COIN-OR Clp function \code{Clp_chgObjCoefficients}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/chgRowLowerCLP.Rd b/man/chgRowLowerCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..fe8b81cf91bd538236dee6b0599324557784222b --- /dev/null +++ b/man/chgRowLowerCLP.Rd @@ -0,0 +1,52 @@ +\name{chgRowLowerCLP} +\alias{chgRowLowerCLP} +\alias{Clp_chgRowLower} + +\title{ + Set/Change Row Lower Bounds +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_chgRowLower}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + chgRowLowerCLP(lp, rlb) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{rlb}{ + Numeric vector containing the lower bounds of the + rows of the model. + } +} + +\details{ + Interface to the C function \code{chgColLower} which calls + the COIN-OR Clp function \code{Clp_chgRowLower}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/chgRowUpperCLP.Rd b/man/chgRowUpperCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..7ced423db98e6040674efe862628a334b20b7fd2 --- /dev/null +++ b/man/chgRowUpperCLP.Rd @@ -0,0 +1,52 @@ +\name{chgRowUpperCLP} +\alias{chgRowUpperCLP} +\alias{Clp_chgRowUpper} + +\title{ + Set/Change Row Upper Bounds +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_chgRowUpper}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ +chgRowUpperCLP(lp, rub) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{rub}{ + Numeric vector containing the upper bounds of the + rows of the model. + } +} + +\details{ + Interface to the C function \code{chgRowUpper} which calls + the COIN-OR Clp function \code{Clp_chgRowUpper}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/clpAPI-package.Rd b/man/clpAPI-package.Rd new file mode 100644 index 0000000000000000000000000000000000000000..ceb9d21d72cd71059461bd47f910302696f4f004 --- /dev/null +++ b/man/clpAPI-package.Rd @@ -0,0 +1,78 @@ +\name{clpAPI-package} +\alias{clpAPI-package} +\alias{clpAPI} + +\docType{package} + +\title{ + R Interface to C API of COIN-OR Clp +} + +\description{ + A low level interface to COIN-OR Clp (COIN Linear Program code). +} + +\details{ + The package \code{clpAPI} provides access to the callable library + of COIN-OR Clp from within R. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ package } +\keyword{ optimize} + +\examples{ +# load package +library(clpAPI) + +# preparing the model +lp <- initProbCLP() + +nrows <- 5 +ncols <- 8 + +# objective function +obj <- c(1, 0, 0, 0, 2, 0, 0, -1) + +# upper and lower bounds of the rows +rlower <- c(2.5, -1000, 4, 1.8, 3) +rupper <- c(1000, 2.1, 4, 5, 15) + +# upper and lower bounds of the columns +clower <- c(2.5, 0, 0, 0, 0.5, 0, 0, 0) +cupper <- c(1000, 4.1, 1, 1, 4, 1000, 1000, 4.3) + +# constraint matrix +ia <- c(0, 4, 0, 1, 1, 2, 0, 3, 0, 4, 2, 3, 0, 4) +ja <- c(0, 2, 4, 6, 8, 10, 11, 12, 14) +ar <- c(3.0, 5.6, 1.0, 2.0, 1.1, 1.0, -2.0, 2.8, + -1.0, 1.0, 1.0, -1.2, -1.0, 1.9) + +# direction of optimization +setObjDirCLP(lp, 1) + +# load problem data +loadProblemCLP(lp, ncols, nrows, ia, ja, ar, + clower, cupper, obj, rlower, rupper) + +# solve lp problem +solveInitialCLP(lp) + +# retrieve the results +getSolStatusCLP(lp) +getObjValCLP(lp) +getColPrimCLP(lp) + +# remove problem object +delProbCLP(lp) +} diff --git a/man/clpPtr-class.Rd b/man/clpPtr-class.Rd new file mode 100644 index 0000000000000000000000000000000000000000..b77a75280b7c7830629d205c0f5551bd28ed8f93 --- /dev/null +++ b/man/clpPtr-class.Rd @@ -0,0 +1,85 @@ +\name{clpPtr-class} + +\Rdversion{1.1} +\docType{class} + +\alias{clpPtr-class} +\alias{clpPtr} +\alias{isCLPpointer,clpPtr-method} +\alias{isNULLpointerCLP,clpPtr-method} +\alias{clpPointer,clpPtr-method} +\alias{clpPtrType,clpPtr-method} +\alias{clpPtrType<-,clpPtr-method} +\alias{isCLPpointer} +\alias{isNULLpointerCLP} +\alias{clpPointer} +\alias{clpPtrType} +\alias{clpPtrType<-} + +\title{Class \code{"clpPtr"}} + +\description{ + Structure of the class \code{"clpPtr"}. Objects of that class are + used to hold pointers to C structures used by COIN-OR Clp. +} + +\section{Objects from the Class}{ + Objects can be created by calls of the form\cr + \code{test <- initProbCLP()}. +} + +\section{Slots}{ + \describe{ + \item{\code{clpPtrType}:}{ + Object of class \code{"character"} giving the pointer type. + } + \item{\code{clpPointer}:}{ + Object of class \code{"externalptr"} containig the pointer to a + C structure. + } + } +} + +\section{Methods}{ + \describe{ + \item{isCLPpointer}{\code{signature(object = "clpPtr")}: + returns \code{TRUE} if \code{clpPointer(object)} is a pointer to a + COIN-OR Clp problem object, otherwise \code{FALSE}. + } + \item{isNULLpointerCLP}{\code{signature(object = "clpPtr")}: + returns \code{TRUE} if \code{clpPointer(object)} is a NULL pointer, + otherwise \code{FALSE}. + } + \item{clpPointer}{\code{signature(object = "clpPtr")}: + gets the \code{clpPointer} slot. + } + \item{clpPtrType}{\code{signature(object = "clpPtr")}: + gets the \code{clpPtrType} slot. + } + \item{clpPtrType<-}{\code{signature(object = "clpPtr")}: + sets the \code{clpPtrType} slot. + } + } +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\seealso{ + \code{\link{initProbCLP}} +} + +\examples{ + showClass("clpPtr") +} + +\keyword{ optimize } + diff --git a/man/copyNamesCLP.Rd b/man/copyNamesCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..fafa2014b01591cc5c0037ab1233dfa86edbf420 --- /dev/null +++ b/man/copyNamesCLP.Rd @@ -0,0 +1,56 @@ +\name{copyNamesCLP} +\alias{copyNamesCLP} +\alias{Clp_copyNames} + +\title{ + Copy Column and Row Names in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_copyNames}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + copyNamesCLP(lp, cnames, rnames) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{cnames}{ + Character vector, containing the column names, must not be longer than the + number of columns in the model. + } + \item{rnames}{ + Character vector, containing the row names, must not be longer than the + number of rows in the model. + } +} + +\details{ + Interface to the C function \code{copyNames} which calls + the COIN-OR Clp function \code{Clp_copyNames}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/delColsCLP.Rd b/man/delColsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a7eb20ca2d008f45398296f1e1d5f29f58fd0edb --- /dev/null +++ b/man/delColsCLP.Rd @@ -0,0 +1,55 @@ +\name{delColsCLP} +\alias{delColsCLP} +\alias{Clp_deleteColumns} + +\title{ + Delete Columns in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_deleteColumns}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + delColsCLP(lp, num, j) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{num}{ + Number of columns to delete. + } + \item{j}{ + Integer vector, containing the indices of columns to delete + (the first column has index 0). + } +} + +\details{ + Interface to the C function \code{delCols} which calls + the COIN-OR Clp function \code{Clp_deleteColumns}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/delProbCLP.Rd b/man/delProbCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..4198af8a9a942923fccf484b0a32281f65eb3dbf --- /dev/null +++ b/man/delProbCLP.Rd @@ -0,0 +1,48 @@ +\name{delProbCLP} +\alias{delProbCLP} +\alias{Clp_deleteModel} + +\title{ + Delete Problem Object +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_deleteModel}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + delProbCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{delProb} which calls + the COIN-OR Clp function \code{Clp_deleteModel}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/delRowsCLP.Rd b/man/delRowsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..22048b7abbcaaa280aae6ab9dae7f70fba4a80cd --- /dev/null +++ b/man/delRowsCLP.Rd @@ -0,0 +1,55 @@ +\name{delRowsCLP} +\alias{delRowsCLP} +\alias{Clp_deleteRows} + +\title{ + Delete Rows in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_deleteRows}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + delRowsCLP(lp, num, i) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{num}{ + Number of rows to delete. + } + \item{i}{ + Integer vector, containing the indices of rows to delete + (the first row has index 0). + } +} + +\details{ + Interface to the C function \code{delRows} which calls + the COIN-OR Clp function \code{Clp_deleteRows}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/dropNamesCLP.Rd b/man/dropNamesCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..626162e9e2cf46b0c3b545d24b49f7a0e0aaf1d7 --- /dev/null +++ b/man/dropNamesCLP.Rd @@ -0,0 +1,48 @@ +\name{dropNamesCLP} +\alias{dropNamesCLP} +\alias{Clp_dropNames} + +\title{ + Drop Names in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_dropNames}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + dropNamesCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{dropNames} which calls + the COIN-OR Clp function \code{Clp_dropNames}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/dualCLP.Rd b/man/dualCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..f48801839a64b739423729d4849061bf2304dfff --- /dev/null +++ b/man/dualCLP.Rd @@ -0,0 +1,51 @@ +\name{dualCLP} +\alias{dualCLP} +\alias{Clp_dual} + +\title{ + Solve LP Problem with the Dual Simplex Method +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_dual}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + dualCLP(lp, ifValP = 0) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ifValP}{ + An integer value. + } +} + +\details{ + Interface to the C function \code{dual} which calls + the COIN-OR Clp function \code{Clp_dual}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getColDualCLP.Rd b/man/getColDualCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..52d9e34c53c208b170c9c76f13f9b09c8a505364 --- /dev/null +++ b/man/getColDualCLP.Rd @@ -0,0 +1,49 @@ +\name{getColDualCLP} +\alias{getColDualCLP} +\alias{Clp_dualColumnSolution} + +\title{ + Retrieve all Column Dual Values +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_dualColumnSolution}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getColDualCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getColDual} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_dualColumnSolution}. +} + +\value{ + Returns all dual values of the stuctural variables as a numeric vector. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getColLowerCLP.Rd b/man/getColLowerCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..bc9abcf14d5c3d99c8edc0b4c059bf8c8db60596 --- /dev/null +++ b/man/getColLowerCLP.Rd @@ -0,0 +1,50 @@ +\name{getColLowerCLP} +\alias{getColLowerCLP} +\alias{Clp_columnLower} + +\title{ + Retrieve Column Lower Bound +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_columnLower}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + getColLowerCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getColLower} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_columnLower}. +} + +\value{ + The lower bounds of the models columns (the corresponding + structural variables) are returned. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getColPrimCLP.Rd b/man/getColPrimCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..5279983f3bf7f871cfe0736126b6f8fe5171c65a --- /dev/null +++ b/man/getColPrimCLP.Rd @@ -0,0 +1,49 @@ +\name{getColPrimCLP} +\alias{getColPrimCLP} +\alias{Clp_primalColumnSolution} + +\title{ + Retrieve all Column Primal Values +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_primalColumnSolution}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getColPrimCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getColPrim} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_primalColumnSolution}. +} + +\value{ + Returns all primal values of the stuctural variables as a numeric vector. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getColUpperCLP.Rd b/man/getColUpperCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..02bf1b200879bf18ab87d2819f6b613056d63ea4 --- /dev/null +++ b/man/getColUpperCLP.Rd @@ -0,0 +1,50 @@ +\name{getColUpperCLP} +\alias{getColUpperCLP} +\alias{Clp_columnUpper} + +\title{ + Retrieve Column Upper Bounds +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_columnUpper}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + getColUpperCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getColLower} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_columnUpper}. +} + +\value{ + The upper bounds of the models columns (the corresponding + structural variables) are returned. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getIndCLP.Rd b/man/getIndCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a870cac328338bab9690c1b74d408f0b26afb888 --- /dev/null +++ b/man/getIndCLP.Rd @@ -0,0 +1,50 @@ +\name{getIndCLP} +\alias{getIndCLP} +\alias{Clp_getIndices} + +\title{ + Retrieve Row Indices of the Non Zero Elements in the Constraint Matrix +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_getIndices}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getIndCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getInd} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_getIndices}. +} + +\value{ + An integer vector containing the row Indices of the + non zero elements in the constraint matrix. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getLogLevelCLP.Rd b/man/getLogLevelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..8bffd7e874af3dc26e9e07c7ac985057d01d6250 --- /dev/null +++ b/man/getLogLevelCLP.Rd @@ -0,0 +1,49 @@ +\name{getLogLevelCLP} +\alias{getLogLevelCLP} +\alias{Clp_logLevel} + +\title{ + Retrieve the Log Level Flag +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_logLevel}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getLogLevelCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getLogLevel} which calls + the COIN-OR Clp function \code{Clp_logLevel}. +} + +\value{ + Returns the log level flag: 0: nothing, 1: just final, 2: just + factorizations, 3: as 2 plus a bit more, 4: verbose. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getNnzCLP.Rd b/man/getNnzCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..d8233644a53604562d09294da2cefafd847378fd --- /dev/null +++ b/man/getNnzCLP.Rd @@ -0,0 +1,51 @@ +\name{getNnzCLP} +\alias{getNnzCLP} +\alias{Clp_getElements} + +\title{ + Retrieve the Non Zero Elements of the Constraint Matrix + in Column Major Order. +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_getElements}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getNnzCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getNnz} which calls + the COIN-OR Clp functions \code{Clp_getNumElements} and + \code{Clp_getElements}. +} + +\value{ + A numeric vector containing the non zero elements of the + constraint matrix in column major order. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getNumColsCLP.Rd b/man/getNumColsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..36f0bb6c5ffa2ebcccad392693eca66a1f0527ea --- /dev/null +++ b/man/getNumColsCLP.Rd @@ -0,0 +1,48 @@ +\name{getNumColsCLP} +\alias{getNumColsCLP} +\alias{Clp_numberColumns} + +\title{ + Retrieve the Current Number of Columns in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_numberColumns}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getNumColsCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getNumCols} which calls + the COIN-OR Clp function \code{Clp_numberColumns}. +} + +\value{ + The current number of columns in the model. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getNumNnzCLP.Rd b/man/getNumNnzCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..f13687a19cee1faa73ae85adb9b04b0f92dd88a2 --- /dev/null +++ b/man/getNumNnzCLP.Rd @@ -0,0 +1,48 @@ +\name{getNumNnzCLP} +\alias{getNumNnzCLP} +\alias{Clp_getNumElements} + +\title{ + Retrieve the Current Number of Non Zero Elements in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_getNumElements}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getNumNnzCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getNumNnz} which calls + the COIN-OR Clp function \code{Clp_getNumElements}. +} + +\value{ + Returns the current number of non zero elements in the model. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getNumRowsCLP.Rd b/man/getNumRowsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..b00b57306ab019f372ec002aef023c03419a247d --- /dev/null +++ b/man/getNumRowsCLP.Rd @@ -0,0 +1,48 @@ +\name{getNumRowsCLP} +\alias{getNumRowsCLP} +\alias{Clp_numberRows} + +\title{ + Retrieve the Current Number of Rows in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_numberRows}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getNumRowsCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getNumRows} which calls + the COIN-OR Clp function \code{Clp_numberRows}. +} + +\value{ + The current number of rows in the model. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getObjCoefsCLP.Rd b/man/getObjCoefsCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a6a9a7839c6add63897542bfc7f3c250e066e344 --- /dev/null +++ b/man/getObjCoefsCLP.Rd @@ -0,0 +1,49 @@ +\name{getObjCoefsCLP} +\alias{getObjCoefsCLP} +\alias{Clp_objective} + +\title{ + Retrieve Objective Coefficients +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_objective}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + getObjCoefsCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getObjCoefs} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_objective}. +} + +\value{ + A numeric vector containing the objective coefficients. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getObjDirCLP.Rd b/man/getObjDirCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a004dae87477b2ff9bf34301ea6f92e7a80a4a26 --- /dev/null +++ b/man/getObjDirCLP.Rd @@ -0,0 +1,49 @@ +\name{getObjDirCLP} +\alias{getObjDirCLP} +\alias{Clp_optimizationDirection} + +\title{ + Retrieve Optimization Direction Flag +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_optimizationDirection}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getObjDirCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getObjDir} which calls + the COIN-OR Clp function \code{Clp_optimizationDirection}. +} + +\value{ + Returns the optimization direction flag: 1: minimize, + -1: maximize, 0: ignore. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getObjValCLP.Rd b/man/getObjValCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..53b846c692a8821df41f0b2b7c0af1af5a5c51ed --- /dev/null +++ b/man/getObjValCLP.Rd @@ -0,0 +1,48 @@ +\name{getObjValCLP} +\alias{getObjValCLP} +\alias{Clp_objectiveValue} + +\title{ + Retrieve the Value of the Objective Function After Optimization +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_objectiveValue}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getObjValCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getObjVal} which calls + the COIN-OR Clp function \code{Clp_objectiveValue}. +} + +\value{ + Returns the value of the objective function after optimization. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getRowDualCLP.Rd b/man/getRowDualCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..52a9517a223112a883713cd734183f4b5da19263 --- /dev/null +++ b/man/getRowDualCLP.Rd @@ -0,0 +1,49 @@ +\name{getRowDualCLP} +\alias{getRowDualCLP} +\alias{Clp_dualRowSolution} + +\title{ + Retrieve all Row Dual Values +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_dualRowSolution}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getRowDualCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getRowDual} which calls + the COIN-OR Clp functions \code{Clp_numberRows} and + \code{Clp_dualRowSolution}. +} + +\value{ + Returns all dual values of the auxiliary variables as a numeric vector. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getRowLowerCLP.Rd b/man/getRowLowerCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..bed6a182a62e8e15c5cab6f36da521d134a1af39 --- /dev/null +++ b/man/getRowLowerCLP.Rd @@ -0,0 +1,49 @@ +\name{getRowLowerCLP} +\alias{getRowLowerCLP} +\alias{Clp_rowLower} + +\title{ + Retrieve Row Lower Bound +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_rowLower}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + getRowLowerCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getRowLower} which calls + the COIN-OR Clp functions \code{Clp_numberRows} and + \code{Clp_rowLower}. +} + +\value{ + The lower bounds of the models rows are returned. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getRowPrimCLP.Rd b/man/getRowPrimCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..838cd411c2113e5bde7e640af8ddf86be85ca1e6 --- /dev/null +++ b/man/getRowPrimCLP.Rd @@ -0,0 +1,49 @@ +\name{getRowPrimCLP} +\alias{getRowPrimCLP} +\alias{Clp_primalRowSolution} + +\title{ + Retrieve all Row Primal Values +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_primalRowSolution}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getRowPrimCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getRowPrim} which calls + the COIN-OR Clp functions \code{Clp_numberRows} and + \code{Clp_primalRowSolution}. +} + +\value{ + Returns all primal values of the auxiliary variables as a numeric vector. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getRowUpperCLP.Rd b/man/getRowUpperCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..fb3b78d77d68097fdd0a2a0e681dced0168eabd9 --- /dev/null +++ b/man/getRowUpperCLP.Rd @@ -0,0 +1,49 @@ +\name{getRowUpperCLP} +\alias{getRowUpperCLP} +\alias{Clp_rowUpper} + +\title{ + Retrieve Row Upper Bound +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_rowUpper}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + getRowUpperCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getRowUpper} which calls + the COIN-OR Clp functions \code{Clp_numberRows} and + \code{Clp_rowUpper}. +} + +\value{ + The upper bounds of the models rows are returned. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getScaleFlagCLP.Rd b/man/getScaleFlagCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..33415d3c83733d4ac17640176bf09c0add39f0dc --- /dev/null +++ b/man/getScaleFlagCLP.Rd @@ -0,0 +1,49 @@ +\name{getScaleFlagCLP} +\alias{getScaleFlagCLP} +\alias{Clp_scalingFlag} + +\title{ + Retrieve the Scale Flag +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_scalingFlag}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getScaleFlagCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getScaleFlag} which calls + the COIN-OR Clp function \code{Clp_scalingFlag}. +} + +\value{ + Returns the scaling flag: 0: off, 1: equilibrium, 2: geometric, + 3: auto, 4: dynamic (later - maybe not implemented in CLP?). +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getSolStatusCLP.Rd b/man/getSolStatusCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..26d8226bc81d26eb1a8c040efe6078cac63edd60 --- /dev/null +++ b/man/getSolStatusCLP.Rd @@ -0,0 +1,50 @@ +\name{getSolStatusCLP} +\alias{getSolStatusCLP} +\alias{Clp_status} + +\title{ + Retrieve the Solution Status +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_status}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getSolStatusCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getSolStatus} which calls + the COIN-OR Clp function \code{Clp_status}. +} + +\value{ + The solution status: 0: optimal, 1: primal infeasible, + 2: dual infeasible, 3: stopped on iterations etc, + 4: stopped due to errors. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getVecLenCLP.Rd b/man/getVecLenCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..0c7f678833a3c1b3c43b237b7f3df5195cebb535 --- /dev/null +++ b/man/getVecLenCLP.Rd @@ -0,0 +1,50 @@ +\name{getVecLenCLP} +\alias{getVecLenCLP} +\alias{Clp_getVectorLengths} + +\title{ + Retrieve the Number of Non Zero Elements per Column +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_getVectorLengths}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getVecLenCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getVecLen} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_getVectorLengths}. +} + +\value{ + An integer vector containing the number of non zero + elements per column. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/getVecStartCLP.Rd b/man/getVecStartCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a0611219882cb41d503297bd49c8f9ea3f23ccd7 --- /dev/null +++ b/man/getVecStartCLP.Rd @@ -0,0 +1,50 @@ +\name{getVecStartCLP} +\alias{getVecStartCLP} +\alias{Clp_getVectorStarts} + +\title{ + Retrieve Column Starts in Constraint Matrix +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_getVectorStarts}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + getVecStartCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{getVecStart} which calls + the COIN-OR Clp functions \code{Clp_numberColumns} and + \code{Clp_getVectorStarts}. +} + +\value{ + An integer vector containing the column starts in + the constraint matrix. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/idiotCLP.Rd b/man/idiotCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..95d05af8a237427f0e29e904bb3bd82dedc66092 --- /dev/null +++ b/man/idiotCLP.Rd @@ -0,0 +1,51 @@ +\name{idiotCLP} +\alias{idiotCLP} +\alias{Clp_idiot} + +\title{ + Solve LP Problem with the idiot Code +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_idiot}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + idiotCLP(lp, thd = 0) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{thd}{ + An integer value. + } +} + +\details{ + Interface to the C function \code{idiot} which calls + the COIN-OR Clp function \code{Clp_idiot}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/initProbCLP.Rd b/man/initProbCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..443f9a008f1861a8f7527a329a00c111e6de42c0 --- /dev/null +++ b/man/initProbCLP.Rd @@ -0,0 +1,46 @@ +\name{initProbCLP} +\alias{initProbCLP} +\alias{Clp_newModel} + +\title{ + Create a COIN-OR Clp Problem Object +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_newModel}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + initProbCLP(ptrtype = "clp_prob") +} + +\arguments{ + \item{ptrtype}{ + A name for the pointer to a COIN-OR Clp problem object. + } +} + +\details{ + Interface to the C function \code{initProb} which calls + the COIN-OR Clp function \code{Clp_newModel}. +} + +\value{ + An instance of class \code{"\linkS4class{clpPtr}"}. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/lengthNamesCLP.Rd b/man/lengthNamesCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..78f42d139156ffac82cd9b06edf46cbcf0a7e3b7 --- /dev/null +++ b/man/lengthNamesCLP.Rd @@ -0,0 +1,48 @@ +\name{lengthNamesCLP} +\alias{lengthNamesCLP} +\alias{Clp_lengthNames} + +\title{ + Length of the Names in the Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_lengthNames}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + lengthNamesCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{lengthNames} which calls + the COIN-OR Clp function \code{Clp_lengthNames}. +} + +\value{ + Number of characters of the longest name in the Model. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/loadMatrixCLP.Rd b/man/loadMatrixCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..13110a1a46202c21a7eb2893c514b082f67e0a7f --- /dev/null +++ b/man/loadMatrixCLP.Rd @@ -0,0 +1,62 @@ +\name{loadMatrixCLP} +\alias{loadMatrixCLP} + +\title{ + Load Constraint Matrix +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_loadProblem}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + loadMatrixCLP(lp, ncols, nrows, ia, ja, ra) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ncols}{ + Number of Columns. + } + \item{nrows}{ + Number of Rows. + } + \item{ia}{ + Row indices in the constraint matrix. + } + \item{ja}{ + Column starts in constraint matrix. + } + \item{ra}{ + Non zero elements of the constraint matrix. + } +} + +\details{ + Interface to the C function \code{loadMatrix} which calls + the COIN-OR Clp function \code{Clp_loadProblem}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/loadProblemCLP.Rd b/man/loadProblemCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..fa7fb591bc705d73b94b3ad73366b0df44d75844 --- /dev/null +++ b/man/loadProblemCLP.Rd @@ -0,0 +1,80 @@ +\name{loadProblemCLP} +\alias{loadProblemCLP} +\alias{Clp_loadProblem} + +\title{ + Load Problem Data +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_loadProblem}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + loadProblemCLP(lp, ncols, nrows, ia, ja, ra, + lb = NULL, ub = NULL, obj_coef = NULL, + rlb = NULL, rub = NULL) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ncols}{ + Number of Columns. + } + \item{nrows}{ + Number of Rows. + } + \item{ia}{ + Row indices in the constraint matrix. + } + \item{ja}{ + Column starts in constraint matrix. + } + \item{ra}{ + Non zero elements of the constraint matrix. + } + \item{lb}{ + Column lower bounds. + } + \item{ub}{ + Column upper bounds. + } + \item{obj_coef}{ + Objective coefficients. + } + \item{rlb}{ + Row lower bounds. + } + \item{rub}{ + Row upper bounds. + } +} + +\details{ + Interface to the C function \code{loadProblem} which calls + the COIN-OR Clp function \code{Clp_loadProblem}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/primalCLP.Rd b/man/primalCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..d6d708b79a342937ba720f85fc540fad75404ed1 --- /dev/null +++ b/man/primalCLP.Rd @@ -0,0 +1,51 @@ +\name{primalCLP} +\alias{primalCLP} +\alias{Clp_primal} + +\title{ + Solve LP Problem with the Primal Simplex Method +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_primal}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + primalCLP(lp, ifValP = 0) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{ifValP}{ + An integer value. + } +} + +\details{ + Interface to the C function \code{primal} which calls + the COIN-OR Clp function \code{Clp_primal}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/printModelCLP.Rd b/man/printModelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..49feebd7aa9618b0dc7de8c1a794ceeef133e00b --- /dev/null +++ b/man/printModelCLP.Rd @@ -0,0 +1,52 @@ +\name{printModelCLP} +\alias{printModelCLP} +\alias{Clp_printModel} + +\title{ + Print the Model to STDOUT +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_printModel}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + printModelCLP(lp, prefix = "CLPmodel") +} + + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{prefix}{ + A character string containing a name for the model. + } +} + +\details{ + Interface to the C function \code{printModel} which calls + the COIN-OR Clp function \code{Clp_printModel}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/probNameCLP.Rd b/man/probNameCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..10e381053d2e601bd0c0b7d27bf603ed9f1fab5f --- /dev/null +++ b/man/probNameCLP.Rd @@ -0,0 +1,51 @@ +\name{probNameCLP} +\alias{probNameCLP} +\alias{Clp_problemName} + +\title{ + Set Problem Name +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_problemName}. Consult the COIN-OR Clp documentation + for more detailed information. + +} + +\usage{ + probNameCLP(lp, pname) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{pname}{ + A single character string containing the problem name. + } +} + +\details{ + Interface to the C function \code{probName} which calls + the COIN-OR Clp function \code{Clp_problemName}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } diff --git a/man/readMPSCLP.Rd b/man/readMPSCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..4f1ce2bd03ae89c9fbcb1a44ace09adb33960285 --- /dev/null +++ b/man/readMPSCLP.Rd @@ -0,0 +1,57 @@ +\name{readMPSCLP} +\alias{readMPSCLP} +\alias{Clp_readMps} + +\title{ + Read Problem in (Free) MPS Format +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_readMps}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + readMPSCLP(lp, fname, keepNames = TRUE, ignoreErrors = FALSE) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{fname}{ + A filename. + } + \item{keepNames}{ + Boolean, keep variable names. + } + \item{ignoreErrors}{ + If set to \code{TRUE}, errors will be ignored. + } +} + +\details{ + Interface to the C function \code{readMPS} which calls + the COIN-OR Clp function \code{Clp_readMps}. +} + +\value{ + Returns zero on success, otherwise non zero. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/resizeCLP.Rd b/man/resizeCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..6e39c0fc9e6aaef2184c239e61bc41e9f83435f3 --- /dev/null +++ b/man/resizeCLP.Rd @@ -0,0 +1,66 @@ +\name{resizeCLP} +\alias{resizeCLP} +\alias{Clp_resize} + +\title{ + Resize a Model +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_resize}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + resizeCLP(lp, nrows, ncols) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{nrows}{ + Number of rows. + } + \item{ncols}{ + Number of columns. + } +} + +\details{ + Interface to the C function \code{resize} which calls + the COIN-OR Clp function \code{Clp_resize}. + + The function \code{resize} can produce a larger model. + If the current number of rows and columns is \emph{n} + and \emph{m} respectively and you set nrows to \emph{i} + and ncols to \emph{j}, the new number of rows and columns + will be \emph{i} and \emph{j}. It is not possible to + scale down the model. In order to delete rows or columns, + use \code{\link{delRowsCLP}} or \code{\link{delColsCLP}}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\seealso{ + \code{\link{delRowsCLP}} and \code{\link{delColsCLP}}. +} + +\keyword{ optimize } + diff --git a/man/restoreModelCLP.Rd b/man/restoreModelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..5ef4e0f1d7307c58a687ffba86efd2c9881a1b90 --- /dev/null +++ b/man/restoreModelCLP.Rd @@ -0,0 +1,51 @@ +\name{restoreModelCLP} +\alias{restoreModelCLP} +\alias{Clp_restoreModel} + +\title{ + Restore model from file +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_restoreModel}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + restoreModelCLP(lp, fname) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{fname}{ + A filename. + } +} + +\details{ + Interface to the C function \code{restoreModel} which calls + the COIN-OR Clp function \code{Clp_restoreModel}. +} + +\value{ + Returns zero on success, otherwise non zero. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/return_codeCLP.Rd b/man/return_codeCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..1a90ab213dd96eb04f2657851478fe9845c3277a --- /dev/null +++ b/man/return_codeCLP.Rd @@ -0,0 +1,41 @@ +\name{return_codeCLP} +\alias{return_codeCLP} + +\title{ + Translates a COIN-OR Clp Return Code into a Human + Readable String +} + +\description{ + Translates a COIN-OR Clp return code into a human + readable string. +} + +\usage{ + return_codeCLP(code) +} + +\arguments{ + \item{code}{ + Return code from COIN-OR Clp. + } +} + +\value{ + A character string associated with the COIN-OR Clp + return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/saveModelCLP.Rd b/man/saveModelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..ccd4b859c899cac7b37cb1ef14b3a9e9d2bc48dd --- /dev/null +++ b/man/saveModelCLP.Rd @@ -0,0 +1,51 @@ +\name{saveModelCLP} +\alias{saveModelCLP} +\alias{Clp_saveModel} + +\title{ + Save model to file +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_saveModel}. Consult the COIN-OR Clp documentation + for more detailed information. +} + +\usage{ + saveModelCLP(lp, fname) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{fname}{ + A filename. + } +} + +\details{ + Interface to the C function \code{saveModel} which calls + the COIN-OR Clp function \code{Clp_saveModel}. +} + +\value{ + Returns zero on success, otherwise non zero. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/scaleModelCLP.Rd b/man/scaleModelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..a20f472da9af6028a89cc9508911002f059fcd7e --- /dev/null +++ b/man/scaleModelCLP.Rd @@ -0,0 +1,53 @@ +\name{scaleModelCLP} +\alias{scaleModelCLP} +\alias{Clp_scaling} + +\title{ + Set/Unset the Scaling Flag (Method) +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_scaling}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + scaleModelCLP(lp, mode) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{mode}{ + Scaling flag: 0: off, 1: equilibrium, 2: geometric, + 3: auto, 4: dynamic (later - maybe not implemented + in CLP?). + } +} + +\details{ + Interface to the C function \code{scaleModel} which calls + the COIN-OR Clp function \code{Clp_scaling}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/setLogLevelCLP.Rd b/man/setLogLevelCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..d7452ecfa48066ff17aec635e51569d622bcc385 --- /dev/null +++ b/man/setLogLevelCLP.Rd @@ -0,0 +1,52 @@ +\name{setLogLevelCLP} +\alias{setLogLevelCLP} +\alias{Clp_setLogLevel} + +\title{ + Set the Amount of Output to STDOUT +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_setLogLevel}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + setLogLevelCLP(lp, amount) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{amount}{ + Log level flag: 0: nothing, 1: just final, 2: just + factorizations, 3: as 2 plus a bit more, 4: verbose. + } +} + +\details{ + Interface to the C function \code{setLogLevel} which calls + the COIN-OR Clp function \code{Clp_setLogLevel}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/setObjDirCLP.Rd b/man/setObjDirCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..2da198e964aad5145fbf526ff0d9dc68b720c08a --- /dev/null +++ b/man/setObjDirCLP.Rd @@ -0,0 +1,52 @@ +\name{setObjDirCLP} +\alias{setObjDirCLP} +\alias{Clp_setOptimizationDirection} + +\title{ + Set/Change Optimization Direction Flag +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_setOptimizationDirection}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + setObjDirCLP(lp, lpdir) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } + \item{lpdir}{ + Optimization direction flag: 1: minimize, -1: maximize, + 0: ignore. + } +} + +\details{ + Interface to the C function \code{setObjDir} which calls + the COIN-OR Clp function \code{Clp_setOptimizationDirection}. +} + +\value{ + NULL +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/solveInitialBarrierCLP.Rd b/man/solveInitialBarrierCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..3ff33a95c7ae270f4ad67ad448f8e4cdc3eaba4b --- /dev/null +++ b/man/solveInitialBarrierCLP.Rd @@ -0,0 +1,49 @@ +\name{solveInitialBarrierCLP} +\alias{solveInitialBarrierCLP} +\alias{Clp_initialBarrierSolve} + +\title{ + Solve LP Problem with the Initial Barrier Method +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_initialBarrierSolve}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + solveInitialBarrierCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{solveInitialBarrier} + which calls the COIN-OR Clp function + \code{Clp_initialBarrierSolve}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/solveInitialBarrierNoCrossCLP.Rd b/man/solveInitialBarrierNoCrossCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..1cb619a1f3a5b26aef09ff3523af7539ebbcab33 --- /dev/null +++ b/man/solveInitialBarrierNoCrossCLP.Rd @@ -0,0 +1,50 @@ +\name{solveInitialBarrierNoCrossCLP} +\alias{solveInitialBarrierNoCrossCLP} +\alias{Clp_initialBarrierNoCrossSolve} + +\title{ + Solve LP Problem with the Initial Barrier Method + (no Crossover) +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_initialBarrierNoCrossSolve}. Consult the + COIN-OR Clp documentation for more detailed information. +} + +\usage{ + solveInitialBarrierNoCrossCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{solveInitialBarrierNoCross} + which calls the COIN-OR Clp function + \code{Clp_initialBarrierNoCrossSolve}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/solveInitialCLP.Rd b/man/solveInitialCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..b510d303bca77e5bb5dc0c990049f7c1c92792fb --- /dev/null +++ b/man/solveInitialCLP.Rd @@ -0,0 +1,49 @@ +\name{solveInitialCLP} +\alias{solveInitialCLP} +\alias{Clp_initialSolve} + +\title{ + Solve LP Problem with a General Solve Algorithm +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_initialSolve}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + solveInitialCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{solveInitial} + which calls the COIN-OR Clp function + \code{Clp_initialSolve}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/solveInitialDualCLP.Rd b/man/solveInitialDualCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..7d06d1709b6aecae630d0e1720b230f9fafa8bc1 --- /dev/null +++ b/man/solveInitialDualCLP.Rd @@ -0,0 +1,49 @@ +\name{solveInitialDualCLP} +\alias{solveInitialDualCLP} +\alias{Clp_initialDualSolve} + +\title{ + Solve LP Problem with the Initial Dual Simplex Method +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_initialDualSolve}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + solveInitialDualCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{solveInitialDual} + which calls the COIN-OR Clp function + \code{Clp_initialDualSolve}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/solveInitialPrimalCLP.Rd b/man/solveInitialPrimalCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..335049ef86c2c0c257396811cab352ef6f59aae4 --- /dev/null +++ b/man/solveInitialPrimalCLP.Rd @@ -0,0 +1,49 @@ +\name{solveInitialPrimalCLP} +\alias{solveInitialPrimalCLP} +\alias{Clp_initialPrimalSolve} + +\title{ + Solve LP Problem with the Initial Primal Simplex Method +} + +\description{ + Low level interface function to the COIN-OR Clp function + \code{Clp_initialPrimalSolve}. Consult the COIN-OR Clp + documentation for more detailed information. +} + +\usage{ + solveInitialPrimalCLP(lp) +} + +\arguments{ + \item{lp}{ + An object of class \code{"\linkS4class{clpPtr}"} as returned by + \code{\link{initProbCLP}}. This is basically a pointer to a COIN-OR Clp + problem object. + } +} + +\details{ + Interface to the C function \code{solveInitialPrimal} + which calls the COIN-OR Clp function + \code{Clp_initialPrimalSolve}. +} + +\value{ + A return code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/status_codeCLP.Rd b/man/status_codeCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..415961e0e2ff8411054fbad131c8c17d7083cfe8 --- /dev/null +++ b/man/status_codeCLP.Rd @@ -0,0 +1,41 @@ +\name{status_codeCLP} +\alias{status_codeCLP} + +\title{ + Translates a COIN-OR Clp Status Value into a Human + Readable String +} + +\description{ + Translates a COIN-OR Clp status value into a human + readable string. +} + +\usage{ + status_codeCLP(code) +} + +\arguments{ + \item{code}{ + Status code from COIN-OR Clp. + } +} + +\value{ + A character string associated with the COIN-OR Clp + status code. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } + diff --git a/man/versionCLP.Rd b/man/versionCLP.Rd new file mode 100644 index 0000000000000000000000000000000000000000..68f903d9122139ba508efbadfd1529b204c7e590 --- /dev/null +++ b/man/versionCLP.Rd @@ -0,0 +1,38 @@ +\name{versionCLP} +\alias{versionCLP} +\alias{CLP_VERSION} + +\title{ + Determine COIN-OR Clp Callable Library Version +} + +\description{ + Low level interface function to the COIN-OR Clp constant \code{CLP_VERSION}. + Consult the COIN-OR Clp documentation for more detailed information. +} + +\usage{ + versionCLP() +} + +\details{ + Interface to the C function \code{version} which returns the COIN-OR Clp + version number. +} + +\value{ + Returns a single character value containing the COIN-OR Clp version number. +} + +\references{ + The COIN-OR Clp home page at + \url{http://www.coin-or.org/projects/Clp.xml} +} + +\author{ + Gabriel Gelius-Dietrich + + Maintainer: Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de> +} + +\keyword{ optimize } diff --git a/src/Makevars.in b/src/Makevars.in new file mode 100644 index 0000000000000000000000000000000000000000..f03b4d39e17631bd443edc49d5d1275b76391553 --- /dev/null +++ b/src/Makevars.in @@ -0,0 +1,3 @@ +PKG_CFLAGS=@PKG_CFLAGS@ +PKG_CPPFLAGS=@PKG_CPPFLAGS@ +PKG_LIBS=@PKG_LIBS@ diff --git a/src/Makevars.win b/src/Makevars.win new file mode 100644 index 0000000000000000000000000000000000000000..ff18ecb1bab38340bd4d78e765ccc09b4dc47880 --- /dev/null +++ b/src/Makevars.win @@ -0,0 +1,2 @@ +PKG_CPPFLAGS=-g -D_R_=1 -DUSE_R=1 -I${CLP_PATH}/include/coin +PKG_LIBS=-L${CLP_PATH}/lib/coin -L${CLP_PATH}/lib -lClp -lCoinUtils -lstdc++ diff --git a/src/clpAPI.c b/src/clpAPI.c new file mode 100644 index 0000000000000000000000000000000000000000..8b590e8feab2a9995a310c17fb3e03ab9add8dba --- /dev/null +++ b/src/clpAPI.c @@ -0,0 +1,1214 @@ +/* clpAPI.c + R interface to COIN-OR Clp. + + Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, + Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. + All right reserved. + Email: geliudie@uni-duesseldorf.de + + This file is part of clpAPI. + + ClpAPI is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ClpAPI is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with clpAPI. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "clpAPI.h" + + +static SEXP tagCLPprob; + + +/* -------------------------------------------------------------------------- */ +/* Finalizer */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------- */ +/* finalizer for clp problem objects */ +static void clpProbFinalizer (SEXP lp) { + if (!R_ExternalPtrAddr(lp)) { + return; + } + else { + delProb(lp); + } +} + + +/* -------------------------------------------------------------------------- */ +/* help functions */ +/* -------------------------------------------------------------------------- */ + +/* check for pointer to clp */ +SEXP isCLPptr(SEXP ptr) { + + SEXP out = R_NilValue; + + if ( (TYPEOF(ptr) == EXTPTRSXP) && + (R_ExternalPtrTag(ptr) == tagCLPprob) ) { + out = Rf_ScalarLogical(1); + } + else { + out = Rf_ScalarLogical(0); + } + + return out; +} + + +/* check for NULL pointer */ +SEXP isNULLptr(SEXP ptr) { + + SEXP out = R_NilValue; + + if ( (TYPEOF(ptr) == EXTPTRSXP) && + (R_ExternalPtrAddr(ptr) == NULL) ) { + out = Rf_ScalarLogical(1); + } + else { + out = Rf_ScalarLogical(0); + } + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* API-Functions */ +/* -------------------------------------------------------------------------- */ + +/* -------------------------------------------------------------------------- */ +/* initialize clp */ +SEXP initCLP(void) { + tagCLPprob = Rf_install("TYPE_CLP_PROB"); + return R_NilValue; +} + + +/* -------------------------------------------------------------------------- */ +/* remove problem object */ +SEXP delProb(SEXP lp) { + + SEXP out = R_NilValue; + Clp_Simplex *del = NULL; + + checkTypeOfProb(lp); + + del = R_ExternalPtrAddr(lp); + + Clp_deleteModel(del); + R_ClearExternalPtr(lp); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* create new problem object */ +SEXP initProb(SEXP ptrtype) { + + SEXP lpext = R_NilValue; + SEXP ptr, class; + + Clp_Simplex *lp; + + /* create problem pointer */ + PROTECT(ptr = Rf_allocVector(STRSXP, 1)); + SET_STRING_ELT(ptr, 0, STRING_ELT(ptrtype, 0)); + + PROTECT(class = Rf_allocVector(STRSXP, 1)); + SET_STRING_ELT(class, 0, Rf_mkChar("clp_ptr")); + + lp = Clp_newModel(); + + lpext = R_MakeExternalPtr(lp, tagCLPprob, R_NilValue); + PROTECT(lpext); + R_RegisterCFinalizerEx(lpext, clpProbFinalizer, TRUE); + Rf_setAttrib(ptr, class, lpext); + Rf_classgets(ptr, class); + UNPROTECT(3); + + return ptr; +} + + +/* -------------------------------------------------------------------------- */ +/* set optimization direction */ +SEXP setObjDir(SEXP lp, SEXP dir) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_setOptimizationDirection(R_ExternalPtrAddr(lp), Rf_asReal(dir)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get optimization direction */ +SEXP getObjDir(SEXP lp) { + + SEXP out = R_NilValue; + double dir = 0; + + checkProb(lp); + + dir = Clp_optimizationDirection(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarReal(dir); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* resize the model */ +SEXP resize(SEXP lp, SEXP nrows, SEXP ncols) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_resize(R_ExternalPtrAddr(lp), Rf_asInteger(nrows), Rf_asInteger(ncols)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* add rows */ +SEXP addRows(SEXP lp, SEXP nrows, + SEXP lb, SEXP ub, SEXP rowst, SEXP cols, SEXP val) { + + SEXP out = R_NilValue; + + const double *rlb = REAL(lb); + const double *rub = REAL(ub); + const int *rrowst = INTEGER(rowst); + const int *rcols = INTEGER(cols); + const double *rval = REAL(val); + + checkProb(lp); + + Clp_addRows(R_ExternalPtrAddr(lp), Rf_asInteger(nrows), + rlb, rub, rrowst, rcols, rval); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* add columns */ +SEXP addCols(SEXP lp, SEXP ncols, + SEXP lb, SEXP ub, SEXP obj, SEXP colst, SEXP rows, SEXP val) { + + SEXP out = R_NilValue; + + const double *rlb = REAL(lb); + const double *rub = REAL(ub); + const double *robj = REAL(obj); + const int *rcolst = INTEGER(colst); + const int *rrows = INTEGER(rows); + const double *rval = REAL(val); + + checkProb(lp); + + Clp_addColumns(R_ExternalPtrAddr(lp), Rf_asInteger(ncols), + rlb, rub, robj, rcolst, rrows, rval); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get number of rows */ +SEXP getNumRows(SEXP lp) { + + SEXP out = R_NilValue; + int nrows = 0; + + checkProb(lp); + + nrows = Clp_numberRows(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(nrows); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get number of columns */ +SEXP getNumCols(SEXP lp) { + + SEXP out = R_NilValue; + int ncols = 0; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ncols); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* set objective coefficients */ +SEXP chgObjCoefs(SEXP lp, SEXP objCoef) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_chgObjCoefficients(R_ExternalPtrAddr(lp), REAL(objCoef)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get objective coefficients */ +SEXP getObjCoefs(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + double *obj_coef; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + obj_coef = Clp_objective(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, ncols)); + for (k = 0; k < ncols; k++) { + REAL(out)[k] = obj_coef[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* change row lower bounds */ +SEXP chgRowLower(SEXP lp, SEXP rlb) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_chgRowLower(R_ExternalPtrAddr(lp), REAL(rlb)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get row lower bounds */ +SEXP getRowLower(SEXP lp) { + + SEXP out = R_NilValue; + + int nrows, k; + double *rlb; + + checkProb(lp); + + nrows = Clp_numberRows(R_ExternalPtrAddr(lp)); + rlb = Clp_rowLower(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, nrows)); + for (k = 0; k < nrows; k++) { + REAL(out)[k] = rlb[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* change row upper bounds */ +SEXP chgRowUpper(SEXP lp, SEXP rub) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_chgRowUpper(R_ExternalPtrAddr(lp), REAL(rub)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get row upper bounds */ +SEXP getRowUpper(SEXP lp) { + + SEXP out = R_NilValue; + + int nrows, k; + double *rub; + + checkProb(lp); + + nrows = Clp_numberRows(R_ExternalPtrAddr(lp)); + rub = Clp_rowUpper(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, nrows)); + for (k = 0; k < nrows; k++) { + REAL(out)[k] = rub[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* change column lower bounds */ +SEXP chgColLower(SEXP lp, SEXP lb) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_chgColumnLower(R_ExternalPtrAddr(lp), REAL(lb)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get column lower bounds */ +SEXP getColLower(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + double *lb; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + lb = Clp_columnLower(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, ncols)); + for (k = 0; k < ncols; k++) { + REAL(out)[k] = lb[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* change column upper bounds */ +SEXP chgColUpper(SEXP lp, SEXP ub) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_chgColumnUpper(R_ExternalPtrAddr(lp), REAL(ub)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get column upper bounds */ +SEXP getColUpper(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + double *ub; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + ub = Clp_columnUpper(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, ncols)); + for (k = 0; k < ncols; k++) { + REAL(out)[k] = ub[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* load a complete Problem or at least the constraint matrix */ +SEXP loadProblem(SEXP lp, SEXP ncols, SEXP nrows, SEXP ia, SEXP ja, SEXP ra, + SEXP clb, SEXP cub, SEXP obj_coef, SEXP rlb, SEXP rub) { + + SEXP out = R_NilValue; + + int *ria = INTEGER(ia); + /* int *rja = INTEGER(ja); */ + CoinBigIndex *rja = INTEGER(ja); + double *rra = REAL(ra); + double *rclb; + double *rcub; + double *robj_coef; + double *rrlb; + double *rrub; +/* double *rclb = REAL(clb); */ +/* double *rcub = REAL(cub); */ +/* double *robj_coef = REAL(obj_coef); */ +/* double *rrlb = REAL(rlb); */ +/* double *rrub = REAL(rub); */ + + checkProb(lp); + + if (clb == R_NilValue) { + rclb = NULL; + } + else { + rclb = REAL(clb); + } + + if (cub == R_NilValue) { + rcub = NULL; + } + else { + rcub = REAL(cub); + } + + if (obj_coef == R_NilValue) { + robj_coef = NULL; + } + else { + robj_coef = REAL(obj_coef); + } + + if (rlb == R_NilValue) { + rrlb = NULL; + } + else { + rrlb = REAL(rlb); + } + + if (rub == R_NilValue) { + rrub = NULL; + } + else { + rrub = REAL(rub); + } + + Clp_loadProblem(R_ExternalPtrAddr(lp), Rf_asInteger(ncols), + Rf_asInteger(nrows), rja, ria, rra, rclb, rcub, + robj_coef, rrlb, rrub + ); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* load a complete Problem or at least the constraint matrix */ +SEXP loadMatrix(SEXP lp, SEXP ncols, SEXP nrows, SEXP ia, SEXP ja, SEXP ra) { + + SEXP out = R_NilValue; + + int *ria = INTEGER(ia); + /* int *rja = INTEGER(ja); */ + CoinBigIndex *rja = INTEGER(ja); + double *rra = REAL(ra); + + checkProb(lp); + + Clp_loadProblem(R_ExternalPtrAddr(lp), + Rf_asInteger(ncols), Rf_asInteger(nrows), + rja, ria, rra, NULL, NULL, NULL, NULL, NULL + ); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get number of non zero elements in the contraint matrix */ +SEXP getNumNnz(SEXP lp) { + + SEXP out = R_NilValue; + int nnz; + + checkProb(lp); + + nnz = Clp_getNumElements(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(nnz); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Column starts in constraint matrix (ja(-a) in column major order format) */ +SEXP getVecStart(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + /* const int *vec_start; */ + const CoinBigIndex *vec_start; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)) + 1; + vec_start = Clp_getVectorStarts(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(INTSXP, ncols)); + for (k = 0; k < ncols; k++) { + INTEGER(out)[k] = vec_start[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Row indices in the constraint matrix (ia(-1) in column major order format) */ +SEXP getInd(SEXP lp) { + + SEXP out = R_NilValue; + + int nnz, k; + const int *index; + + checkProb(lp); + + nnz = Clp_getNumElements(R_ExternalPtrAddr(lp)); + index = Clp_getIndices(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(INTSXP, nnz)); + for (k = 0; k < nnz; k++) { + INTEGER(out)[k] = index[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Vector (number of nnz per column) length in the constraint matrix + (lg in column major order format) */ +SEXP getVecLen(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + const int *vec_len; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + vec_len = Clp_getVectorLengths(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(INTSXP, ncols)); + for (k = 0; k < ncols; k++) { + INTEGER(out)[k] = vec_len[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Non zero elements in the constraint matrix (ar in column major format) */ +SEXP getNnz(SEXP lp) { + + SEXP out = R_NilValue; + + int nnz, k; + const double *n_elem; + + checkProb(lp); + + nnz = Clp_getNumElements(R_ExternalPtrAddr(lp)); + n_elem = Clp_getElements(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, nnz)); + for (k = 0; k < nnz; k++) { + REAL(out)[k] = n_elem[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* print model */ +SEXP printModel(SEXP lp, SEXP prefix) { + + SEXP out = R_NilValue; + const char *rprefix = CHAR(STRING_ELT(prefix, 0)); + + checkProb(lp); + + Clp_printModel(R_ExternalPtrAddr(lp), rprefix); + /* Clp_printModel(R_ExternalPtrAddr(lp), "CLPmodel"); */ + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* amount of print out */ +SEXP setLogLevel(SEXP lp, SEXP amount) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_setLogLevel(R_ExternalPtrAddr(lp), Rf_asInteger(amount)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get log level */ +SEXP getLogLevel(SEXP lp) { + + SEXP out = R_NilValue; + int amount; + + checkProb(lp); + + amount = Clp_logLevel(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(amount); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* set or unset scaling */ +SEXP scaleModel(SEXP lp, SEXP mode) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_scaling(R_ExternalPtrAddr(lp), Rf_asInteger(mode)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get scale flag */ +SEXP getScaleFlag(SEXP lp) { + + SEXP out = R_NilValue; + int flag; + + checkProb(lp); + + flag = Clp_scalingFlag(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(flag); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* solve model with general solve algorithm */ +SEXP solveInitial(SEXP lp) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_initialSolve(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Dual initial solve */ +SEXP solveInitialDual(SEXP lp) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_initialDualSolve(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Primal initial solve */ +SEXP solveInitialPrimal(SEXP lp) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_initialPrimalSolve(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Barrier initial solve */ +SEXP solveInitialBarrier(SEXP lp) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_initialBarrierSolve(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Barrier initial solve, no crossover */ +SEXP solveInitialBarrierNoCross(SEXP lp) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_initialBarrierNoCrossSolve(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Dual slgorithm */ +SEXP dual(SEXP lp, SEXP ifValP) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_dual(R_ExternalPtrAddr(lp), Rf_asInteger(ifValP)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* Dual slgorithm */ +SEXP primal(SEXP lp, SEXP ifValP) { + + SEXP out = R_NilValue; + int ret; + + checkProb(lp); + + ret = Clp_primal(R_ExternalPtrAddr(lp), Rf_asInteger(ifValP)); + + out = Rf_ScalarInteger(ret); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* solve problem using the idiot code */ +SEXP idiot(SEXP lp, SEXP thd) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_idiot(R_ExternalPtrAddr(lp), Rf_asInteger(thd)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get solution status */ +SEXP getSolStatus(SEXP lp) { + + SEXP out = R_NilValue; + int stat; + + checkProb(lp); + + stat = Clp_status(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(stat); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* solve model with general solve algorithm */ +SEXP getObjVal(SEXP lp) { + + SEXP out = R_NilValue; + double obj; + + checkProb(lp); + + obj = Clp_objectiveValue(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarReal(obj); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get column primal solution */ +SEXP getColPrim(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + double *col_prim; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + col_prim = Clp_primalColumnSolution(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, ncols)); + for (k = 0; k < ncols; k++) { + REAL(out)[k] = col_prim[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get column dual solution */ +SEXP getColDual(SEXP lp) { + + SEXP out = R_NilValue; + + int ncols, k; + double *col_dual; + + checkProb(lp); + + ncols = Clp_numberColumns(R_ExternalPtrAddr(lp)); + col_dual = Clp_dualColumnSolution(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, ncols)); + for (k = 0; k < ncols; k++) { + REAL(out)[k] = col_dual[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get row primal solution */ +SEXP getRowPrim(SEXP lp) { + + SEXP out = R_NilValue; + + int nrows, k; + double *row_prim; + + checkProb(lp); + + nrows = Clp_numberRows(R_ExternalPtrAddr(lp)); + row_prim = Clp_primalRowSolution(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, nrows)); + for (k = 0; k < nrows; k++) { + REAL(out)[k] = row_prim[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get row dual solution */ +SEXP getRowDual(SEXP lp) { + + SEXP out = R_NilValue; + + int nrows, k; + double *row_dual; + + checkProb(lp); + + nrows = Clp_numberRows(R_ExternalPtrAddr(lp)); + row_dual = Clp_dualRowSolution(R_ExternalPtrAddr(lp)); + + PROTECT(out = Rf_allocVector(REALSXP, nrows)); + for (k = 0; k < nrows; k++) { + REAL(out)[k] = row_dual[k]; + } + UNPROTECT(1); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* delete rows */ +SEXP delRows(SEXP lp, SEXP num, SEXP i) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_deleteRows(R_ExternalPtrAddr(lp), Rf_asInteger(num), INTEGER(i)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* delete columns */ +SEXP delCols(SEXP lp, SEXP num, SEXP j) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_deleteColumns(R_ExternalPtrAddr(lp), Rf_asInteger(num), INTEGER(j)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* read problem data in MPS format */ +SEXP readMPS(SEXP lp, SEXP fname, SEXP keepNames, SEXP ignoreErrors) { + + SEXP out = R_NilValue; + const char *rfname = CHAR(STRING_ELT(fname, 0)); + int check = 0; + + checkProb(lp); + + check = Clp_readMps(R_ExternalPtrAddr(lp), rfname, Rf_asInteger(keepNames), + Rf_asInteger(ignoreErrors) + ); + + out = Rf_ScalarInteger(check); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* save model to file */ +SEXP saveModel(SEXP lp, SEXP fname) { + + SEXP out = R_NilValue; + const char *rfname = CHAR(STRING_ELT(fname, 0)); + int check = 0; + + checkProb(lp); + + check = Clp_saveModel(R_ExternalPtrAddr(lp), rfname); + + out = Rf_ScalarInteger(check); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* restore model from file */ +SEXP restoreModel(SEXP lp, SEXP fname) { + + SEXP out = R_NilValue; + const char *rfname = CHAR(STRING_ELT(fname, 0)); + int check = 0; + + checkProb(lp); + + check = Clp_restoreModel(R_ExternalPtrAddr(lp), rfname); + + out = Rf_ScalarInteger(check); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* get COIN OR Clp version */ +SEXP version() { + + SEXP out = R_NilValue; + + out = Rf_mkString(CLP_VERSION); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* drop names */ +SEXP dropNames(SEXP lp) { + + SEXP out = R_NilValue; + + checkProb(lp); + + Clp_dropNames(R_ExternalPtrAddr(lp)); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* copy in names */ +SEXP copyNames(SEXP lp, SEXP cnames, SEXP rnames) { + + SEXP out = R_NilValue; + + int k, numcn, numrn; + const char **rcnames; + const char ** rrnames; + + checkProb(lp); + + numcn = Rf_length(cnames); + rcnames = R_Calloc(numcn, const char *); + for (k = 0; k < numcn; k++) { + rcnames[k] = CHAR(STRING_ELT(cnames, k)); + } + + numrn = Rf_length(rnames); + rrnames = R_Calloc(numrn, const char *); + for (k = 0; k < numrn; k++) { + rrnames[k] = CHAR(STRING_ELT(rnames, k)); + } + + Clp_copyNames(R_ExternalPtrAddr(lp), rrnames, rcnames); + + if (cnames != R_NilValue) { + R_Free(rcnames); + } + if (rnames != R_NilValue) { + R_Free(rrnames); + } + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* length of names */ +SEXP lengthNames(SEXP lp) { + + SEXP out = R_NilValue; + int ncnames; + + checkProb(lp); + + ncnames = Clp_lengthNames(R_ExternalPtrAddr(lp)); + + out = Rf_ScalarInteger(ncnames); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* fill in row name */ +SEXP rowName(SEXP lp, SEXP i, SEXP rname) { + + SEXP out = R_NilValue; + + const char *rrname = CHAR(STRING_ELT(rname, 0)); + + checkProb(lp); + + Clp_rowName(R_ExternalPtrAddr(lp), Rf_asInteger(i), (char *) rrname); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* fill in column name */ +SEXP colName(SEXP lp, SEXP j, SEXP cname) { + + SEXP out = R_NilValue; + + const char *rcname = CHAR(STRING_ELT(cname, 0)); + + checkProb(lp); + + Clp_columnName(R_ExternalPtrAddr(lp), Rf_asInteger(j), (char *) rcname); + + return out; +} + + +/* -------------------------------------------------------------------------- */ +/* fill in problem name */ +SEXP probName(SEXP lp, SEXP nc, SEXP pname) { + + SEXP out = R_NilValue; + + const char *rpname = CHAR(STRING_ELT(pname, 0)); + + checkProb(lp); + + Clp_problemName(R_ExternalPtrAddr(lp), Rf_asInteger(nc), (char *) rpname); + + return out; +} diff --git a/src/clpAPI.h b/src/clpAPI.h new file mode 100644 index 0000000000000000000000000000000000000000..043c1cb39410a00e7eddf77269cc798b5e73bdd0 --- /dev/null +++ b/src/clpAPI.h @@ -0,0 +1,221 @@ +/* clpAPI.h + R interface to COIN-OR Clp. + + Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, + Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. + All right reserved. + Email: geliudie@uni-duesseldorf.de + + This file is part of clpAPI. + + ClpAPI is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ClpAPI is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with clpAPI. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include "clpR.h" + + +/* -------------------------------------------------------------------------- */ +/* help functions */ +/* -------------------------------------------------------------------------- */ + +/* check for pointer to clp */ +SEXP isCLPptr(SEXP ptr); + +/* check for NULL pointer */ +SEXP isNULLptr(SEXP ptr); + + +/* -------------------------------------------------------------------------- */ +/* API functions */ +/* -------------------------------------------------------------------------- */ + +/* initialize clp */ +SEXP initCLP(void); + +/* remove problem object */ +SEXP delProb(SEXP lp); + +/* create new problem object */ +SEXP initProb(SEXP ptrtype); + +/* set optimization direction */ +SEXP setObjDir(SEXP lp, SEXP dir); + +/* get optimization direction */ +SEXP getObjDir(SEXP lp); + +/* resize the model */ +SEXP resize(SEXP lp, SEXP nrows, SEXP ncols); + +/* add rows */ +SEXP addRows(SEXP lp, SEXP nrows, + SEXP lb, SEXP ub, SEXP rowst, SEXP cols, SEXP val); + +/* add columns */ +SEXP addCols(SEXP lp, SEXP ncols, + SEXP lb, SEXP ub, SEXP obj, SEXP colst, SEXP rows, SEXP val); + +/* get number of rows */ +SEXP getNumRows(SEXP lp); + +/* get number of columns */ +SEXP getNumCols(SEXP lp); + +/* set objective coefficients */ +SEXP chgObjCoefs(SEXP lp, SEXP objCoef); + +/* get objective coefficients */ +SEXP getObjCoefs(SEXP lp); + +/* change row lower bounds */ +SEXP chgRowLower(SEXP lp, SEXP rlb); + +/* get row lower bounds */ +SEXP getRowLower(SEXP lp); + +/* change row upper bounds */ +SEXP chgRowUpper(SEXP lp, SEXP rub); + +/* get row upper bounds */ +SEXP getRowUpper(SEXP lp); + +/* change column lower bounds */ +SEXP chgColLower(SEXP lp, SEXP lb); + +/* get column lower bounds */ +SEXP getColLower(SEXP lp); + +/* change column upper bounds */ +SEXP chgColUpper(SEXP lp, SEXP ub); + +/* get column upper bounds */ +SEXP getColUpper(SEXP lp); + +/* load a complete Problem or at least the constraint matrix */ +SEXP loadProblem(SEXP lp, SEXP ncols, SEXP nrows, SEXP ia, SEXP ja, SEXP ra, + SEXP clb, SEXP cub, SEXP obj_coef, SEXP rlb, SEXP rub); + +/* load a complete Problem or at least the constraint matrix */ +SEXP loadMatrix(SEXP lp, SEXP ncols, SEXP nrows, SEXP ia, SEXP ja, SEXP ra); + +/* get number of non zero elements in the contraint matrix */ +SEXP getNumNnz(SEXP lp); + +/* Column starts in constraint matrix (ja(-a) in column major order format) */ +SEXP getVecStart(SEXP lp); + +/* Row indices in the constraint matrix (ia(-1) in column major order format) */ +SEXP getInd(SEXP lp); + +/* Vector (number of nnz per column) length in the constraint matrix + (lg in column major order format) */ +SEXP getVecLen(SEXP lp); + +/* Non zero elements in the constraint matrix (ar in column major format) */ +SEXP getNnz(SEXP lp); + +/* print model */ +SEXP printModel(SEXP lp, SEXP prefix); + +/* amount of print out */ +SEXP setLogLevel(SEXP lp, SEXP amount); + +/* get log level */ +SEXP getLogLevel(SEXP lp); + +/* set or unset scaling */ +SEXP scaleModel(SEXP lp, SEXP mode); + +/* get scale flag */ +SEXP getScaleFlag(SEXP lp); + +/* solve model with general solve algorithm */ +SEXP solveInitial(SEXP lp); + +/* Dual initial solve */ +SEXP solveInitialDual(SEXP lp); + +/* Primal initial solve */ +SEXP solveInitialPrimal(SEXP lp); + +/* Barrier initial solve */ +SEXP solveInitialBarrier(SEXP lp); + +/* Barrier initial solve, no crossover */ +SEXP solveInitialBarrierNoCross(SEXP lp); + +/* Dual slgorithm */ +SEXP dual(SEXP lp, SEXP ifValP); + +/* Dual slgorithm */ +SEXP primal(SEXP lp, SEXP ifValP); + +/* solve problem using the idiot code */ +SEXP idiot(SEXP lp, SEXP thd); + +/* get solution status */ +SEXP getSolStatus(SEXP lp); + +/* solve model with general solve algorithm */ +SEXP getObjVal(SEXP lp); + +/* get column primal solution */ +SEXP getColPrim(SEXP lp); + +/* get column dual solution */ +SEXP getColDual(SEXP lp); + +/* get row primal solution */ +SEXP getRowPrim(SEXP lp); + +/* get row dual solution */ +SEXP getRowDual(SEXP lp); + +/* delete rows */ +SEXP delRows(SEXP lp, SEXP num, SEXP i); + +/* delete columns */ +SEXP delCols(SEXP lp, SEXP num, SEXP j); + +/* read problem data in MPS format */ +SEXP readMPS(SEXP lp, SEXP fname, SEXP keepNames, SEXP ignoreErrors); + +/* save model to file */ +SEXP saveModel(SEXP lp, SEXP fname); + +/* restore model from file */ +SEXP restoreModel(SEXP lp, SEXP fname); + +/* get COIN OR Clp version */ +SEXP version(); + +/* drop names */ +SEXP dropNames(SEXP lp); + +/* copy in names */ +SEXP copyNames(SEXP lp, SEXP cnames, SEXP rnames); + +/* length of names */ +SEXP lengthNames(SEXP lp); + +/* fill in row name */ +SEXP rowName(SEXP lp, SEXP i, SEXP rname); + +/* fill in column name */ +SEXP colName(SEXP lp, SEXP j, SEXP cname); + +/* fill in problem name */ +SEXP probName(SEXP lp, SEXP nc, SEXP pname); + diff --git a/src/clpR.h b/src/clpR.h new file mode 100644 index 0000000000000000000000000000000000000000..5e61acfae9b5bd153ba9ec2fe1ba26b087a74e76 --- /dev/null +++ b/src/clpR.h @@ -0,0 +1,65 @@ +/* clpR.h + R interface to COIN-OR Clp. + + Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, + Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. + All right reserved. + Email: geliudie@uni-duesseldorf.de + + This file is part of clpAPI. + + ClpAPI is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ClpAPI is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with clpAPI. If not, see <http://www.gnu.org/licenses/>. +*/ + + +#include <stdio.h> +#include <stdlib.h> +#include <Clp_C_Interface.h> +#include <ClpConfig.h> + + +/* avoid remapping of Rf_<function> to <function> in R header files */ +#ifndef R_NO_REMAP +#define R_NO_REMAP +#endif /* R_NO_REMAP */ + +/* use strict R headers */ +#ifndef STRICT_R_HEADERS +#define STRICT_R_HEADERS +#endif /* STRICT_R_HEADERS */ + +#include <R.h> +#include <Rinternals.h> + + +/* -------------------------------------------------------------------------- */ +/* NULL */ +#define checkIfNil(cp) do { \ + if (R_ExternalPtrAddr(cp) == NULL) \ + Rf_error("You passed a nil value!"); \ +} while (0) + + +/* -------------------------------------------------------------------------- */ +/* problem */ +#define checkTypeOfProb(cp) do { \ + if ( (TYPEOF(cp) != EXTPTRSXP) || (R_ExternalPtrTag(cp) != tagCLPprob) ) \ + Rf_error("You must pass a clp problem!"); \ +} while (0) + +#define checkProb(p) do { \ + checkIfNil(p); \ + checkTypeOfProb(p); \ +} while (0) + diff --git a/src/init.c b/src/init.c new file mode 100644 index 0000000000000000000000000000000000000000..83045757938546fa57b72076458e0c0d40b13d6c --- /dev/null +++ b/src/init.c @@ -0,0 +1,100 @@ +/* init.c + R interface to COIN-OR Clp. + + Copyright (C) 2011-2013 Gabriel Gelius-Dietrich, Dpt. for Bioinformatics, + Institute for Informatics, Heinrich-Heine-University, Duesseldorf, Germany. + All right reserved. + Email: geliudie@uni-duesseldorf.de + + This file is part of clpAPI. + + ClpAPI is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ClpAPI is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with clpAPI. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <R.h> +#include <Rinternals.h> + +#include "clpAPI.h" + +#include <R_ext/Rdynload.h> + +static const R_CallMethodDef callMethods[] = { + {"isCLPptr", (DL_FUNC) &isCLPptr, 1}, + {"isNULLptr", (DL_FUNC) &isNULLptr, 1}, + {"initCLP", (DL_FUNC) &initCLP, 0}, + {"delProb", (DL_FUNC) &delProb, 1}, + {"initProb", (DL_FUNC) &initProb, 1}, + {"setObjDir", (DL_FUNC) &setObjDir, 2}, + {"getObjDir", (DL_FUNC) &getObjDir, 1}, + {"resize", (DL_FUNC) &resize, 3}, + {"addRows", (DL_FUNC) &addRows, 7}, + {"addCols", (DL_FUNC) &addCols, 8}, + {"getNumRows", (DL_FUNC) &getNumRows, 1}, + {"getNumCols", (DL_FUNC) &getNumCols, 1}, + {"chgObjCoefs", (DL_FUNC) &chgObjCoefs, 2}, + {"getObjCoefs", (DL_FUNC) &getObjCoefs, 1}, + {"chgRowLower", (DL_FUNC) &chgRowLower, 2}, + {"getRowLower", (DL_FUNC) &getRowLower, 1}, + {"chgRowUpper", (DL_FUNC) &chgRowUpper, 2}, + {"getRowUpper", (DL_FUNC) &getRowUpper, 1}, + {"chgColLower", (DL_FUNC) &chgColLower, 2}, + {"getColLower", (DL_FUNC) &getColLower, 1}, + {"chgColUpper", (DL_FUNC) &chgColUpper, 2}, + {"getColUpper", (DL_FUNC) &getColUpper, 1}, + {"loadProblem", (DL_FUNC) &loadProblem, 11}, + {"loadMatrix", (DL_FUNC) &loadMatrix, 6}, + {"getNumNnz", (DL_FUNC) &getNumNnz, 1}, + {"getVecStart", (DL_FUNC) &getVecStart, 1}, + {"getInd", (DL_FUNC) &getInd, 1}, + {"getVecLen", (DL_FUNC) &getVecLen, 1}, + {"getNnz", (DL_FUNC) &getNnz, 1}, + {"printModel", (DL_FUNC) &printModel, 2}, + {"setLogLevel", (DL_FUNC) &setLogLevel, 2}, + {"getLogLevel", (DL_FUNC) &getLogLevel, 1}, + {"scaleModel", (DL_FUNC) &scaleModel, 2}, + {"getScaleFlag", (DL_FUNC) &getScaleFlag, 1}, + {"solveInitial", (DL_FUNC) &solveInitial, 1}, + {"solveInitialDual", (DL_FUNC) &solveInitialDual, 1}, + {"solveInitialPrimal", (DL_FUNC) &solveInitialPrimal, 1}, + {"solveInitialBarrier", (DL_FUNC) &solveInitialBarrier, 1}, + {"solveInitialBarrierNoCross", (DL_FUNC) &solveInitialBarrierNoCross, 1}, + {"dual", (DL_FUNC) &dual, 2}, + {"primal", (DL_FUNC) &primal, 2}, + {"idiot", (DL_FUNC) &idiot, 2}, + {"getSolStatus", (DL_FUNC) &getSolStatus, 1}, + {"getObjVal", (DL_FUNC) &getObjVal, 1}, + {"getColPrim", (DL_FUNC) &getColPrim, 1}, + {"getColDual", (DL_FUNC) &getColDual, 1}, + {"getRowPrim", (DL_FUNC) &getRowPrim, 1}, + {"getRowDual", (DL_FUNC) &getRowDual, 1}, + {"delRows", (DL_FUNC) &delRows, 3}, + {"delCols", (DL_FUNC) &delCols, 3}, + {"readMPS", (DL_FUNC) &readMPS, 4}, + {"saveModel", (DL_FUNC) &saveModel, 2}, + {"restoreModel", (DL_FUNC) &restoreModel, 2}, + {"version", (DL_FUNC) &version, 0}, + {"dropNames", (DL_FUNC) &dropNames, 1}, + {"copyNames", (DL_FUNC) ©Names, 3}, + {"lengthNames", (DL_FUNC) &lengthNames, 1}, + {"rowName", (DL_FUNC) &rowName, 3}, + {"colName", (DL_FUNC) &colName, 3}, + {"probName", (DL_FUNC) &probName, 3}, + {NULL, NULL, 0} +}; + + +void R_init_clpAPI(DllInfo *info) { + R_registerRoutines(info, NULL, callMethods, NULL, NULL); + R_useDynamicSymbols(info, FALSE); +} diff --git a/vignettes/clpAPI.Rnw b/vignettes/clpAPI.Rnw new file mode 100644 index 0000000000000000000000000000000000000000..c1bf50b28847f3bc53b47e394ed157ac367438ca --- /dev/null +++ b/vignettes/clpAPI.Rnw @@ -0,0 +1,183 @@ +\documentclass[a4paper,headings=small]{scrartcl} +\usepackage[english]{babel} +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc} +\usepackage{textcomp,lmodern} +\typearea[current]{last} +\usepackage{fixltx2e,mparhack,mathdots} + +\usepackage{natbib} +\usepackage{hyperref} +\bibliographystyle{abbrvnat} + +\usepackage{microtype} + + +\newcommand{\Comp}[1]{\texttt{#1}} + +\addtolength{\skip\footins}{0.5\baselineskip} + +\usepackage{fnpos} + + +\hypersetup{ + pdftitle = {clpAPI -- Quick Start}, + pdfauthor = {Gabriel Gelius-Dietrich}, + pdfsubject = {R Interface to C API of COIN-OR Clp}, + pdfkeywords = {Optimization, COIN-OR Clp}, + pdfborder = {0 0 0}, + pdfhighlight = {/N} +} + + +\newcommand{\pkg}[1]{\emph{#1}} +\newcommand{\pkgname}{\pkg{clpAPI}} +\newcommand{\prgname}[1]{\textsc{#1}} + + +\begin{document} +\title{clpAPI -- Quick Start} +%\VignetteIndexEntry{Package clpAPI -- Quick Start} +\author{Gabriel Gelius-Dietrich} + +\maketitle + +\section{Introduction} +The package \pkgname{} provides a low level interface to the C~API of +COIN-OR Clp\footnote{COIN-OR linear programming version 1.12.0 or higher +\url{https://projects.coin-or.org/Clp}} (COIN-OR linear programming). +The package \pkgname{} relies on a separate installation of COIN-OR Clp. + +\section{Installation} +See \Comp{INSTALL} for installation instructions and platform specific details. + +\section{Usage} + +In the following, an example lp-problem will be created and solved: + +\noindent +\hspace{.5in} maximize +$$z = 5 x_1 + 4 x_2 + 3 x_3$$ +\hspace{.5in} subject to +$$ +\begin{array}{r@{\:}c@{\:}r@{\:}c@{\:}r@{\:}c@{\:}r} +2 x_1 &+& 3 x_2 &+& x_3 & \leq 5 \\ +4 x_1 &+& x_2 &+& 2 x_3 & \leq 11 \\ +3 x_1 &+& 4 x_2 &+& 2 x_3 & \leq 8 \\ +\end{array} +$$ +\hspace{.5in} where all variables are non-negative +$$x_1 \geq 0, \ x_2 \geq 0, \ x_3 \geq 0$$ + +\noindent +Load the library. +<<>>= +library(clpAPI) +@ +Create a problem object. +<<>>= +prob <- initProbCLP() +@ +Set the direction of optimization ($-1$: maximize, $1$: minimize). +<<>>= +setObjDirCLP(prob, -1) +@ +Prepare data structures for the problem object. Number of columns and rows: +<<>>= +nc <- 3 +nr <- 3 +@ +The constraint matrix is passed in column major order format. \textbf{Be +careful here:} all indices start with 0! Row indices. +<<>>= +ia <- c(0, 1, 2, 0, 1, 2, 0, 1, 2) +@ +Column indices. +<<>>= +ja <- c(0, 3, 6, 9) +@ +Non-zero elements. +<<>>= +ar <- c(2, 4, 3, 3, 1, 4, 1, 2, 2) +@ +Lower bounds for the variables (columns). +<<>>= +clb <- rep(0, 3) +@ +Right hand side (row upper bounds for the rows). +<<>>= +rub <- c(5, 11, 8) +@ +Objective coefficients. +<<>>= +obj <- c(5, 4, 3) +@ +Load problem data into the problem object. +<<>>= +loadProblemCLP(prob, nc, nr, ia, ja, ar, clb, NULL, obj, NULL, rub) +@ +Solve the problem using the simplex algorithm. +<<>>= +solveInitialCLP(prob) +@ +Retrieve the value of the objective function after optimization. +<<>>= +getObjValCLP(prob) +@ +Retrieve the primal values of the structural variables (columns) after +optimization. +<<>>= +getColPrimCLP(prob) +@ +Retrieve the dual values of the structural variables (columns) after +optimization (reduced costs). +<<>>= +getColDualCLP(prob) +@ +Free memory, allacated to the problem object. +<<>>= +delProbCLP(prob) +@ + + +\section{Function names} + +\subsection{Searching} + +The function names in \pkgname{} are different from the names in +\prgname{COIN-OR Clp}, +e.\,g. the function \texttt{addColsCLP} in \pkgname{} is called +\texttt{Clp\_addColumns} in \prgname{COIN-OR Clp}. The directory \texttt{inst/} +containes a file \texttt{c2r.map} which maps a \prgname{COIN-OR Clp} function +name to the corresponding \pkgname{} function name. Additionally, all man-pages +contain an alias to the \prgname{COIN-OR Clp} function name. The call +<<>>= +help("Clp_addColumns") +@ +will bring up the man-page of \texttt{addColsCLP}. + + +\subsection{Mapping} + +The file \texttt{c2r.map} in \texttt{inst/} maps the \pkgname{} function names +to the orininal \prgname{COIN-OR Clp} function names of its C-API. +To use the latter, run +<<>>= +c2r <- system.file(package = "clpAPI", "c2r.map") +source(c2r) +@ +now either +<<>>= +pr1 <- initProbCLP() +delProbCLP(pr1) +@ +or the original functions +<<>>= +pr2 <- Clp_newModel() +Clp_deleteModel(pr2) +@ +work both. Keep in mind that the mapping only affects the function names not the +arguments of a function. + + +\end{document}