From c595322151d36c40ed7040add04357549e7be4cd Mon Sep 17 00:00:00 2001
From: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@hhu.de>
Date: Wed, 26 Jul 2017 10:25:40 +0200
Subject: [PATCH] removed unsupported channel functions; version 1.3.3 and
 1.3.4

---
 DESCRIPTION                   |  6 ++--
 NAMESPACE                     |  4 +--
 R/cplexAPI.R                  | 32 +++++++++----------
 inst/NEWS.Rd                  | 14 ++++++++
 inst/c2r.map                  |  4 +--
 man/addChannelCPLEX.Rd        | 60 -----------------------------------
 man/addFpDestCPLEX.Rd         |  2 +-
 man/delChannelCPLEX.Rd        | 57 ---------------------------------
 man/delFpDestCPLEX.Rd         |  2 +-
 man/disconnectChannelCPLEX.Rd |  3 +-
 man/flushChannelCPLEX.Rd      |  3 +-
 man/flushStdChannelsCPLEX.Rd  |  1 -
 man/getChannelsCPLEX.Rd       |  1 -
 src/cplexAPI.c                | 11 ++++---
 src/cplexAPI.h                |  4 +--
 src/init.c                    |  4 +--
 16 files changed, 51 insertions(+), 157 deletions(-)
 delete mode 100644 man/addChannelCPLEX.Rd
 delete mode 100644 man/delChannelCPLEX.Rd

diff --git a/DESCRIPTION b/DESCRIPTION
index 909d945..7244fec 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
 Package: cplexAPI
 Type: Package
 Title: R Interface to C API of IBM ILOG CPLEX
-Version: 1.3.2
-Date: 2016-11-16
+Version: 1.3.4
+Date: 2017-07-26
 Authors@R: c(person(c("C.", "Jonathan"), "Fritzemeier", role = c("cre", "ctb"), email = "clausjonathan.fritzemeier@uni-duesseldorf.de"),
 			 person("Gabriel", "Gelius-Dietrich", role = c("aut"), email = "geliudie@uni-duesseldorf.de"))
 Depends: R (>= 2.6.0)
@@ -18,4 +18,4 @@ Author: C. Jonathan Fritzemeier [cre, ctb], Gabriel Gelius-Dietrich [aut]
 Maintainer: C. Jonathan Fritzemeier <clausjonathan.fritzemeier@uni-duesseldorf.de>
 NeedsCompilation: yes
 Repository: CRAN
-Date/Publication: 2016-11-16 09:15:00
+Date/Publication: 2017-07-26 09:15:00
diff --git a/NAMESPACE b/NAMESPACE
index 4096934..55473c3 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -22,7 +22,7 @@ export(
 "isNULLpointerCPLEX",
 "summary",
 ## function names
-addChannelCPLEX,
+#addChannelCPLEX,
 addColsCPLEX,
 addFpDestCPLEX,
 addIndConstrCPLEX,
@@ -67,7 +67,7 @@ copyPartBaseCPLEX,
 copyQPsepCPLEX,
 copyQuadCPLEX,
 copyStartCPLEX,
-delChannelCPLEX,
+#delChannelCPLEX,
 delColsCPLEX,
 delFpDestCPLEX,
 delIndConstrsCPLEX,
diff --git a/R/cplexAPI.R b/R/cplexAPI.R
index 848895d..774c031 100644
--- a/R/cplexAPI.R
+++ b/R/cplexAPI.R
@@ -2538,31 +2538,31 @@ flushStdChannelsCPLEX <- function(env) {
 
 #------------------------------------------------------------------------------#
 
-addChannelCPLEX <- function(env, ptrtype = "cplex_chan") {
+#addChannelCPLEX <- function(env, ptrtype = "cplex_chan") {
 
-    newch <- .Call("addChannel", PACKAGE = "cplexAPI",
-                   cplexPointer(env),
-                   as.character(ptrtype)
-              )
+#    newch <- .Call("addChannel", PACKAGE = "cplexAPI",
+#                   cplexPointer(env),
+#                   as.character(ptrtype)
+#              )
 
-    newchP <- cplex_ChannelPointer(newch)
+#    newchP <- cplex_ChannelPointer(newch)
 
-    return(newchP)
-}
+#    return(newchP)
+#}
 
 
 #------------------------------------------------------------------------------#
 
-delChannelCPLEX <- function(env, newch) {
+#delChannelCPLEX <- function(env, newch) {
 
-    invisible(
-        .Call("delChannel", PACKAGE = "cplexAPI",
-              cplexPointer(env),
-              cplexPointer(newch)
-        )
-    )
+#    invisible(
+#        .Call("delChannel", PACKAGE = "cplexAPI",
+#              cplexPointer(env),
+#              cplexPointer(newch)
+#        )
+#    )
 
-}
+#}
 
 
 #------------------------------------------------------------------------------#
diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd
index 4db336b..76f3618 100644
--- a/inst/NEWS.Rd
+++ b/inst/NEWS.Rd
@@ -3,6 +3,20 @@
 \name{NEWS}
 \title{cplexAPI News}
 \encoding{UTF-8}
+% ---------------------------------------------------------------------------- %
+
+\section{Changes in version 1.3.4 2017-07-26}{
+  \itemize{
+    \item The function \code{solution} should avoid returning the dual solution if solved \code{FIXEDMILP}, \code{MILP}, \code{QCP}, \code{MIQCP}, \code{MIQP}, and \code{FIXEDMIQP}.
+  }
+}
+
+\section{Changes in version 1.3.3 2017-01-18}{
+  \itemize{
+    \item In CPLEX Version 1270 are the functions \code{CPXaddchannel} and
+    	\code{CPXdelchannel} removed (\url{http://www.ibm.com/support/knowledgecenter/SSSA5P_12.7.0/ilog.odms.cplex.help/CPLEX/ReleaseNotes/topics/releasenotes127/removed.html}).
+  }
+}
 
 % ---------------------------------------------------------------------------- %
 \section{Changes in version 1.3.2 2016-11-16}{
diff --git a/inst/c2r.map b/inst/c2r.map
index 4dced44..304bae0 100644
--- a/inst/c2r.map
+++ b/inst/c2r.map
@@ -4,7 +4,7 @@
 
 # IBM ILOG CPLEX                # cplexAPI
 
-CPXaddchannel                <- cplexAPI::addChannelCPLEX
+#CPXaddchannel                <- cplexAPI::addChannelCPLEX
 CPXaddcols                   <- cplexAPI::addColsCPLEX
 CPXaddfpdest                 <- cplexAPI::addFpDestCPLEX
 CPXaddindconstr              <- cplexAPI::addIndConstrCPLEX
@@ -55,7 +55,7 @@ CPXcopypartialbase           <- cplexAPI::copyPartBaseCPLEX
 CPXcopyqpsep                 <- cplexAPI::copyQPsepCPLEX
 CPXcopyquad                  <- cplexAPI::copyQuadCPLEX
 CPXcopystart                 <- cplexAPI::copyStartCPLEX
-CPXdelchannel                <- cplexAPI::delChannelCPLEX
+#CPXdelchannel                <- cplexAPI::delChannelCPLEX
 CPXdelcols                   <- cplexAPI::delColsCPLEX
 CPXdelfpdest                 <- cplexAPI::delFpDestCPLEX
 CPXdelindconstrs             <- cplexAPI::delIndConstrsCPLEX
diff --git a/man/addChannelCPLEX.Rd b/man/addChannelCPLEX.Rd
deleted file mode 100644
index fb8adda..0000000
--- a/man/addChannelCPLEX.Rd
+++ /dev/null
@@ -1,60 +0,0 @@
-\name{addChannelCPLEX}
-\alias{addChannelCPLEX}
-\alias{CPXaddchannel}
-
-\title{
-  Instantiates a New Channel Object
-}
-
-\description{
-  Low level interface function to the IBM ILOG CPLEX function
-  \code{CPXaddchannel}.  Consult the IBM ILOG CPLEX documentation for more
-  detailed information.
-}
-
-\usage{
-  addChannelCPLEX(env, ptrtype = "cplex_chan")
-}
-
-\arguments{
-  \item{env}{
-    An object of class \code{"\linkS4class{cplexPtr}"} as returned by
-    \code{\link{openEnvCPLEX}}. This is basically a pointer to an
-    IBM ILOG CPLEX environment.
-  }
-  \item{ptrtype}{
-    A name for the pointer object.
-  }
-}
-
-\details{
-  Interface to the C function \code{addChannel} which calls the CPLEX
-  function \code{CPXaddchannel}.
-}
-
-\value{
-  If successful, addChannelCPLEX returns a pointer to the new channel object
-  (an instance of class \code{"\linkS4class{cplexPtr}"}); otherwise, it returns
-  \code{NULL}.
-}
-
-\references{
-  The IBM ILOG CPLEX home page at
-  \url{https://www.ibm.com/developerworks/university/academicinitiative/}.
-}
-
-\author{
-  Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de>
-
-  Maintainer: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@uni-duesseldorf.de>
-}
-
-
-\seealso{
-  \code{\link{delChannelCPLEX}}, \code{\link{disconnectChannelCPLEX}},
-  \code{\link{flushChannelCPLEX}}, \code{\link{flushStdChannelsCPLEX}},
-  \code{\link{getChannelsCPLEX}}
-}
-
-\keyword{ optimize }
-
diff --git a/man/addFpDestCPLEX.Rd b/man/addFpDestCPLEX.Rd
index 4ea9704..810558f 100644
--- a/man/addFpDestCPLEX.Rd
+++ b/man/addFpDestCPLEX.Rd
@@ -23,7 +23,7 @@
   }
   \item{newch}{
     Pointer to an IBM ILOG CPLEX channel as returned by
-    \code{\link{addChannelCPLEX}}.
+    \code{addChannelCPLEX}.
   }
   \item{cpfile}{
     Pointer to an IBM ILOG CPLEX file as returned by
diff --git a/man/delChannelCPLEX.Rd b/man/delChannelCPLEX.Rd
deleted file mode 100644
index 4e9a39a..0000000
--- a/man/delChannelCPLEX.Rd
+++ /dev/null
@@ -1,57 +0,0 @@
-\name{delChannelCPLEX}
-\alias{delChannelCPLEX}
-\alias{CPXdelchannel}
-
-\title{
-  Flushes all Message Destinations for a Channel
-}
-\description{
-  Low level interface function to the IBM ILOG CPLEX function
-  \code{CPXdelchannel}.  Consult the IBM ILOG CPLEX documentation for more
-  detailed information.
-}
-\usage{
-  delChannelCPLEX(env, newch)
-}
-
-\arguments{
-  \item{env}{
-    An object of class \code{"\linkS4class{cplexPtr}"} as returned by
-    \code{\link{openEnvCPLEX}}. This is basically a pointer to an
-    IBM ILOG CPLEX environment.
-  }
-  \item{newch}{
-    A pointer to the channel containing the message destinations as returned by
-    \code{\link{CPXaddchannel}}.
-  }
-}
-
-\details{
-  Interface to the C function \code{delChannel} which calls the CPLEX
-  function \code{CPXdelchannel}.
-}
-
-\value{
-  \code{NULL}
-}
-
-\references{
-  The IBM ILOG CPLEX home page at
-  \url{https://www.ibm.com/developerworks/university/academicinitiative/}.
-}
-
-\author{
-  Gabriel Gelius-Dietrich <geliudie@uni-duesseldorf.de>
-
-  Maintainer: Claus Jonathan Fritzemeier <clausjonathan.fritzemeier@uni-duesseldorf.de>
-}
-
-
-\seealso{
-  \code{\link{addChannelCPLEX}}, \code{\link{disconnectChannelCPLEX}},
-  \code{\link{flushChannelCPLEX}}, \code{\link{flushStdChannelsCPLEX}},
-  \code{\link{getChannelsCPLEX}}
-}
-
-\keyword{ optimize }
-
diff --git a/man/delFpDestCPLEX.Rd b/man/delFpDestCPLEX.Rd
index 67878d2..de54e28 100644
--- a/man/delFpDestCPLEX.Rd
+++ b/man/delFpDestCPLEX.Rd
@@ -24,7 +24,7 @@
   }
   \item{newch}{
     A pointer to the channel for which destinations are to be deleted as
-    returned by \code{\link{CPXaddchannel}}.
+    returned by \code{CPXaddchannel}.
   }
   \item{cpfile}{
     Pointer to an IBM ILOG CPLEX file as returned by
diff --git a/man/disconnectChannelCPLEX.Rd b/man/disconnectChannelCPLEX.Rd
index f78b4d6..e464324 100644
--- a/man/disconnectChannelCPLEX.Rd
+++ b/man/disconnectChannelCPLEX.Rd
@@ -24,7 +24,7 @@
   }
   \item{newch}{
     A pointer to the channel containing the message destinations as returned by
-    \code{\link{CPXaddchannel}}.
+    \code{CPXaddchannel}.
   }
 }
 
@@ -50,7 +50,6 @@
 
 
 \seealso{
-  \code{\link{addChannelCPLEX}}, \code{\link{delChannelCPLEX}},
   \code{\link{flushChannelCPLEX}}, \code{\link{flushStdChannelsCPLEX}},
   \code{\link{getChannelsCPLEX}}
 }
diff --git a/man/flushChannelCPLEX.Rd b/man/flushChannelCPLEX.Rd
index 7df38ed..7479d85 100644
--- a/man/flushChannelCPLEX.Rd
+++ b/man/flushChannelCPLEX.Rd
@@ -23,7 +23,7 @@
     IBM ILOG CPLEX environment.
   }
   \item{newch}{
-    Pointer to a channel object as returned by \code{\link{addChannelCPLEX}}.
+    Pointer to a channel object as returned by \code{addChannelCPLEX}.
   }
 }
 
@@ -49,7 +49,6 @@
 
 
 \seealso{
-  \code{\link{addChannelCPLEX}}, \code{\link{delChannelCPLEX}},
   \code{\link{disconnectChannelCPLEX}}, \code{\link{flushStdChannelsCPLEX}},
   \code{\link{getChannelsCPLEX}}
 }
diff --git a/man/flushStdChannelsCPLEX.Rd b/man/flushStdChannelsCPLEX.Rd
index 33e8b1b..89259ae 100644
--- a/man/flushStdChannelsCPLEX.Rd
+++ b/man/flushStdChannelsCPLEX.Rd
@@ -46,7 +46,6 @@
 
 
 \seealso{
-  \code{\link{addChannelCPLEX}}, \code{\link{delChannelCPLEX}},
   \code{\link{disconnectChannelCPLEX}}, \code{\link{flushChannelCPLEX}},
   \code{\link{getChannelsCPLEX}}
 }
diff --git a/man/getChannelsCPLEX.Rd b/man/getChannelsCPLEX.Rd
index 5dc19aa..5baa681 100644
--- a/man/getChannelsCPLEX.Rd
+++ b/man/getChannelsCPLEX.Rd
@@ -55,7 +55,6 @@
 
 
 \seealso{
-  \code{\link{addChannelCPLEX}}, \code{\link{delChannelCPLEX}},
   \code{\link{disconnectChannelCPLEX}}, \code{\link{flushChannelCPLEX}},
   \code{\link{flushStdChannelsCPLEX}}
 }
diff --git a/src/cplexAPI.c b/src/cplexAPI.c
index 7228412..fb39898 100644
--- a/src/cplexAPI.c
+++ b/src/cplexAPI.c
@@ -4425,6 +4425,7 @@ SEXP solution(SEXP env, SEXP lp) {
     }
 
     if (ptype == CPXPROB_MILP || ptype == CPXPROB_FIXEDMILP ||
+        ptype == CPXPROB_MIQP || ptype == CPXPROB_FIXEDMIQP ||
         ptype == CPXPROB_QCP  || ptype == CPXPROB_MIQCP) {
         nrch = 1;
         ncch = 1;
@@ -5186,7 +5187,7 @@ SEXP flushStdChannels(SEXP env) {
 
 /* -------------------------------------------------------------------------- */
 /* instantiate a new channel object */
-SEXP addChannel(SEXP env, SEXP ptrtype) {
+/*SEXP addChannel(SEXP env, SEXP ptrtype) {
 
     SEXP chout = R_NilValue;
     SEXP ptr, class;
@@ -5198,7 +5199,7 @@ SEXP addChannel(SEXP env, SEXP ptrtype) {
     newch = CPXaddchannel(R_ExternalPtrAddr(env));
 
     if (newch != NULL) {
-        /* create channel pointer */
+        /* create channel pointer *//*
         PROTECT(ptr = Rf_allocVector(STRSXP, 1));
         SET_STRING_ELT(ptr, 0, STRING_ELT(ptrtype, 0));
         
@@ -5216,12 +5217,12 @@ SEXP addChannel(SEXP env, SEXP ptrtype) {
     }
 
     return ptr;
-}
+}*/
 
 
 /* -------------------------------------------------------------------------- */
 /* flush all message destinations for a channel, ... */
-SEXP delChannel(SEXP env, SEXP newch) {
+/*SEXP delChannel(SEXP env, SEXP newch) {
 
     SEXP out = R_NilValue;
     CPXCHANNELptr delch = NULL;
@@ -5236,7 +5237,7 @@ SEXP delChannel(SEXP env, SEXP newch) {
     R_ClearExternalPtr(newch);
 
     return out;
-}
+}*/
 
 
 /* -------------------------------------------------------------------------- */
diff --git a/src/cplexAPI.h b/src/cplexAPI.h
index cb0d774..fa75a0e 100644
--- a/src/cplexAPI.h
+++ b/src/cplexAPI.h
@@ -571,10 +571,10 @@ SEXP getChannels(SEXP env, SEXP ptrtype);
 SEXP flushStdChannels(SEXP env);
 
 /* instantiate a new channel object */
-SEXP addChannel(SEXP env, SEXP ptrtype);
+//SEXP addChannel(SEXP env, SEXP ptrtype);
 
 /* flush all message destinations for a channel, ... */
-SEXP delChannel(SEXP env, SEXP newch);
+//SEXP delChannel(SEXP env, SEXP newch);
 
 /* flush all message destinations associated with a channel */
 SEXP disconnectChannel(SEXP env, SEXP newch);
diff --git a/src/init.c b/src/init.c
index e0c37eb..5349d0a 100644
--- a/src/init.c
+++ b/src/init.c
@@ -189,8 +189,8 @@ static const R_CallMethodDef callMethods[] = {
     {"getLogFile",                (DL_FUNC) &getLogFile,                2},
     {"getChannels",               (DL_FUNC) &getChannels,               2},
     {"flushStdChannels",          (DL_FUNC) &flushStdChannels,          1},
-    {"addChannel",                (DL_FUNC) &addChannel,                2},
-    {"delChannel",                (DL_FUNC) &delChannel,                2},
+/*    {"addChannel",                (DL_FUNC) &addChannel,                2},*/
+/*    {"delChannel",                (DL_FUNC) &delChannel,                2},*/
     {"disconnectChannel",         (DL_FUNC) &disconnectChannel,         2},
     {"flushChannel",              (DL_FUNC) &flushChannel,              2},
     {"addFpDest",                 (DL_FUNC) &addFpDest,                 3},
-- 
GitLab