Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow intel icc compilation of algorithm.h (closes 640) #643

Merged
merged 4 commits into from
Feb 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2017-01-31 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION (Date, Version): Roll minor version

* inst/include/Rcpp/algorithm.h: Allow algorithm.h to be compiler under
Intel's compiler, add copyright header and include guard

2017-01-31 Nathan Russell <russell.nr2012@gmail.com>

* inst/include/Rcpp/sugar/matrix/upper_tri.h: Inherit from MatrixBase
Expand Down Expand Up @@ -548,7 +555,7 @@

2016-07-10 Nathan Russell <russell.nr2012@gmail.com>

* inst/include/Rcpp/algorithm.h: Accomdate clang compiler
* inst/include/Rcpp/algorithm.h: Accomodate clang compiler

2016-07-03 Dirk Eddelbuettel <edd@debian.org>

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 0.12.9.1
Date: 2017-01-17
Version: 0.12.9.2
Date: 2017-01-31
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey, Qiang Kou,
Nathan Russell, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand Down
4 changes: 3 additions & 1 deletion inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
\newcommand{\ghpr}{\href{https://github.com/RcppCore/Rcpp/pull/#1}{##1}}
\newcommand{\ghit}{\href{https://github.com/RcppCore/Rcpp/issues/#1}{##1}}

\section{Changes in Rcpp version 0.13.0 (2017-03-xx)}{
\section{Changes in Rcpp version 0.12.10 (2017-03-xx)}{
\itemize{
\item Changes in Rcpp API:
\itemize{
Expand All @@ -14,6 +14,8 @@
\itemize{
\item Fixed sugar functions \code{upper_tri()} and \code{lower_tri()}
(Nathan Russell in \ghpr{642} addressing \ghit{641}).
\item The \code{algorithm.h} file now accomodates the Intel compiler
(Dirk in \ghpr{643} addressing isue \ghit{640})
}
}
}
Expand Down
32 changes: 29 additions & 3 deletions inst/include/Rcpp/algorithm.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#if __cplusplus >= 201103L
// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
//
// algorithm.h: Rcpp R/C++ interface class library -- data frames
//
// Copyright (C) 2016 - 2017 Daniel C. Dillon
//
// This file is part of Rcpp.
//
// Rcpp 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 2 of the License, or
// (at your option) any later version.
//
// Rcpp 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 Rcpp. If not, see <http://www.gnu.org/licenses/>.

#ifndef Rcpp__Algorithm_h
#define Rcpp__Algorithm_h

#if __cplusplus >= 201103L || __INTEL_CXX11_MODE__ == 1
# define RCPP_CONSTEXPR constexpr
#else
# define RCPP_CONSTEXPR const
Expand Down Expand Up @@ -211,7 +235,7 @@ template< typename InputIterator >
typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value,
typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type
sum(InputIterator begin, InputIterator end) {

typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type;
typedef typename helpers::rtype< value_type > rtype;

Expand All @@ -236,7 +260,7 @@ template< typename InputIterator >
typename traits::enable_if< helpers::decays_to_ctype< typename std::iterator_traits< InputIterator >::value_type >::value,
typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type >::type
sum_nona(InputIterator begin, InputIterator end) {

typedef typename helpers::ctype< typename std::iterator_traits< InputIterator >::value_type >::type value_type;
typedef typename helpers::rtype< value_type > rtype;

Expand Down Expand Up @@ -465,3 +489,5 @@ void sqrt(InputIterator begin, InputIterator end, OutputIterator out) {
} // namespace Rcpp

#undef RCPP_CONSTEXPR

#endif