Skip to content

Commit 9abb401

Browse files
authored
Merge pull request #65 from RcppCore/feature/eigen-3.3.5
Feature/eigen 3.3.5
2 parents 95d0d2c + 1264675 commit 9abb401

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+573
-255
lines changed

.Rbuildignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ debian
77
^.*\.Rproj$
88
^\.Rproj\.user$
99
.*\.tar\.gz$
10-
^patches/
10+
^patches

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2018-11-24 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* DESCRIPTION (Version, Date): Release 0.3.3.5.0
4+
5+
2018-11-23 Dirk Eddelbuettel <edd@debian.org>
6+
7+
* inst/include/Eigen: Updated to release 3.3.5
8+
* inst/include/unsupported: Idem
9+
* patches/eigen-3.3.5.diff: Diff of local patches
10+
111
2018-09-02 Dirk Eddelbuettel <edd@debian.org>
212

313
* .travis.yml: Switch Travis CI to R 3.5 repo

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: RcppEigen
22
Type: Package
33
Title: 'Rcpp' Integration for the 'Eigen' Templated Linear Algebra Library
4-
Version: 0.3.3.4.0
5-
Date: 2018-02-05
4+
Version: 0.3.3.5.0
5+
Date: 2018-11-24
66
Author: Douglas Bates, Dirk Eddelbuettel, Romain Francois, and Yixuan Qiu;
77
the authors of Eigen for the included version of Eigen
88
Maintainer: Dirk Eddelbuettel <edd@debian.org>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## RcppEigen
22

3-
[![Build Status](https://travis-ci.org/RcppCore/RcppEigen.svg)](https://travis-ci.org/RcppCore/RcppEigen) [![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![License](http://img.shields.io/badge/license-MPL2-brightgreen.svg?style=flat)](http://www.mozilla.org/MPL/2.0/) [![CRAN](http://www.r-pkg.org/badges/version/RcppEigen)](https://cran.r-project.org/package=RcppEigen) [![Downloads](http://cranlogs.r-pkg.org/badges/RcppEigen?color=brightgreen)](http://www.r-pkg.org/pkg/RcppEigen)
3+
[![Build Status](https://travis-ci.org/RcppCore/RcppEigen.svg)](https://travis-ci.org/RcppCore/RcppEigen) [![License](http://img.shields.io/badge/license-GPL%20%28%3E=%202%29-brightgreen.svg?style=flat)](http://www.gnu.org/licenses/gpl-2.0.html) [![License](http://img.shields.io/badge/license-MPL2-brightgreen.svg?style=flat)](http://www.mozilla.org/MPL/2.0/) [![CRAN](http://www.r-pkg.org/badges/version/RcppEigen)](https://cran.r-project.org/package=RcppEigen) [![Dependencies](https://tinyverse.netlify.com/badge/RcppEigen)](https://cran.r-project.org/package=RcppEigen) [![Downloads](http://cranlogs.r-pkg.org/badges/RcppEigen?color=brightgreen)](http://www.r-pkg.org/pkg/RcppEigen)
44

55
### Overview
66

@@ -12,12 +12,12 @@ systems. Its performance on many algorithms is comparable with some of the
1212
best implementations based on `Lapack` and level-3 `BLAS`.
1313

1414
The RcppEigen package includes the header files from the Eigen C++
15-
template library (currently version 3.3.4). Thus users do not need to
15+
template library (currently version 3.3.5). Thus users do not need to
1616
install Eigen itself in order to use RcppEigen.
1717

1818
### Status
1919

20-
The package is reasonably mature and under active development, following the
20+
The package is mature and under active development, following the
2121
[Eigen](http://eigen.tuxfamily.org) release cycle.
2222

2323
### Documentation

inst/NEWS.Rd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
\newcommand{\ghpr}{\href{https://github.com/RcppCore/RcppEigen/pull/#1}{##1}}
44
\newcommand{\ghit}{\href{https://github.com/RcppCore/RcppEigen/issues/#1}{##1}}
55

6-
\section{Changes in RcppEigen version 0.3.x.y.z (2018-aa-bb)}{
6+
\section{Changes in RcppEigen version 0.3.3.5.0 (2018-11-24)}{
77
\itemize{
8+
\item Updated to version 3.3.5 of Eigen (Dirk in \ghpr{65})
89
\item Long vectors are now supported via \code{R_xlen_t} (Ralf
910
Stubner in \ghpr{55} fixing \ghit{54}).
11+
\item The benchmarking example was updated in its use of
12+
RcppArmadillo (Michael Weylandt in \ghpr{56}).
1013
}
1114
}
1215

inst/include/Eigen/Core

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@
171171
#ifdef __AVX512DQ__
172172
#define EIGEN_VECTORIZE_AVX512DQ
173173
#endif
174+
#ifdef __AVX512ER__
175+
#define EIGEN_VECTORIZE_AVX512ER
176+
#endif
174177
#endif
175178

176179
// include files
@@ -384,6 +387,7 @@ using std::ptrdiff_t;
384387
#include "src/Core/arch/AVX/MathFunctions.h"
385388
#include "src/Core/arch/AVX/Complex.h"
386389
#include "src/Core/arch/AVX/TypeCasting.h"
390+
#include "src/Core/arch/SSE/TypeCasting.h"
387391
#elif defined EIGEN_VECTORIZE_SSE
388392
#include "src/Core/arch/SSE/PacketMath.h"
389393
#include "src/Core/arch/SSE/MathFunctions.h"

inst/include/Eigen/src/Cholesky/LDLT.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,14 @@ void LDLT<_MatrixType,_UpLo>::_solve_impl(const RhsType &rhs, DstType &dst) cons
570570
// more precisely, use pseudo-inverse of D (see bug 241)
571571
using std::abs;
572572
const typename Diagonal<const MatrixType>::RealReturnType vecD(vectorD());
573-
// In some previous versions, tolerance was set to the max of 1/highest and the maximal diagonal entry * epsilon
574-
// as motivated by LAPACK's xGELSS:
573+
// In some previous versions, tolerance was set to the max of 1/highest (or rather numeric_limits::min())
574+
// and the maximal diagonal entry * epsilon as motivated by LAPACK's xGELSS:
575575
// RealScalar tolerance = numext::maxi(vecD.array().abs().maxCoeff() * NumTraits<RealScalar>::epsilon(),RealScalar(1) / NumTraits<RealScalar>::highest());
576576
// However, LDLT is not rank revealing, and so adjusting the tolerance wrt to the highest
577577
// diagonal element is not well justified and leads to numerical issues in some cases.
578578
// Moreover, Lapack's xSYTRS routines use 0 for the tolerance.
579-
RealScalar tolerance = RealScalar(1) / NumTraits<RealScalar>::highest();
579+
// Using numeric_limits::min() gives us more robustness to denormals.
580+
RealScalar tolerance = (std::numeric_limits<RealScalar>::min)();
580581

581582
for (Index i = 0; i < vecD.size(); ++i)
582583
{

inst/include/Eigen/src/Core/Assign_MKL.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class vml_assign_traits
8484
struct Assignment<DstXprType, CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested>, assign_op<EIGENTYPE,EIGENTYPE>, \
8585
Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \
8686
typedef CwiseUnaryOp<scalar_##EIGENOP##_op<EIGENTYPE>, SrcXprNested> SrcXprType; \
87-
static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &/*func*/) { \
87+
static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &func) { \
88+
resize_if_allowed(dst, src, func); \
8889
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \
8990
if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) { \
9091
VMLOP(dst.size(), (const VMLTYPE*)src.nestedExpression().data(), \
@@ -144,7 +145,8 @@ EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(ceil, Ceil, _)
144145
Dense2Dense, typename enable_if<vml_assign_traits<DstXprType,SrcXprNested>::EnableVml>::type> { \
145146
typedef CwiseBinaryOp<scalar_##EIGENOP##_op<EIGENTYPE,EIGENTYPE>, SrcXprNested, \
146147
const CwiseNullaryOp<internal::scalar_constant_op<EIGENTYPE>,Plain> > SrcXprType; \
147-
static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &/*func*/) { \
148+
static void run(DstXprType &dst, const SrcXprType &src, const assign_op<EIGENTYPE,EIGENTYPE> &func) { \
149+
resize_if_allowed(dst, src, func); \
148150
eigen_assert(dst.rows() == src.rows() && dst.cols() == src.cols()); \
149151
VMLTYPE exponent = reinterpret_cast<const VMLTYPE&>(src.rhs().functor().m_other); \
150152
if(vml_assign_traits<DstXprType,SrcXprNested>::Traversal==LinearTraversal) \

inst/include/Eigen/src/Core/CoreEvaluators.h

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,14 +1020,16 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
10201020
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& block)
10211021
: m_argImpl(block.nestedExpression()),
10221022
m_startRow(block.startRow()),
1023-
m_startCol(block.startCol())
1023+
m_startCol(block.startCol()),
1024+
m_linear_offset(InnerPanel?(XprType::IsRowMajor ? block.startRow()*block.cols() : block.startCol()*block.rows()):0)
10241025
{ }
10251026

10261027
typedef typename XprType::Scalar Scalar;
10271028
typedef typename XprType::CoeffReturnType CoeffReturnType;
10281029

10291030
enum {
1030-
RowsAtCompileTime = XprType::RowsAtCompileTime
1031+
RowsAtCompileTime = XprType::RowsAtCompileTime,
1032+
ForwardLinearAccess = InnerPanel && bool(evaluator<ArgType>::Flags&LinearAccessBit)
10311033
};
10321034

10331035
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
@@ -1039,7 +1041,10 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
10391041
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
10401042
CoeffReturnType coeff(Index index) const
10411043
{
1042-
return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1044+
if (ForwardLinearAccess)
1045+
return m_argImpl.coeff(m_linear_offset.value() + index);
1046+
else
1047+
return coeff(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
10431048
}
10441049

10451050
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
@@ -1051,7 +1056,10 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
10511056
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
10521057
Scalar& coeffRef(Index index)
10531058
{
1054-
return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
1059+
if (ForwardLinearAccess)
1060+
return m_argImpl.coeffRef(m_linear_offset.value() + index);
1061+
else
1062+
return coeffRef(RowsAtCompileTime == 1 ? 0 : index, RowsAtCompileTime == 1 ? index : 0);
10551063
}
10561064

10571065
template<int LoadMode, typename PacketType>
@@ -1065,8 +1073,11 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
10651073
EIGEN_STRONG_INLINE
10661074
PacketType packet(Index index) const
10671075
{
1068-
return packet<LoadMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1069-
RowsAtCompileTime == 1 ? index : 0);
1076+
if (ForwardLinearAccess)
1077+
return m_argImpl.template packet<LoadMode,PacketType>(m_linear_offset.value() + index);
1078+
else
1079+
return packet<LoadMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1080+
RowsAtCompileTime == 1 ? index : 0);
10701081
}
10711082

10721083
template<int StoreMode, typename PacketType>
@@ -1080,15 +1091,19 @@ struct unary_evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel>, IndexBa
10801091
EIGEN_STRONG_INLINE
10811092
void writePacket(Index index, const PacketType& x)
10821093
{
1083-
return writePacket<StoreMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1084-
RowsAtCompileTime == 1 ? index : 0,
1085-
x);
1094+
if (ForwardLinearAccess)
1095+
return m_argImpl.template writePacket<StoreMode,PacketType>(m_linear_offset.value() + index, x);
1096+
else
1097+
return writePacket<StoreMode,PacketType>(RowsAtCompileTime == 1 ? 0 : index,
1098+
RowsAtCompileTime == 1 ? index : 0,
1099+
x);
10861100
}
10871101

10881102
protected:
10891103
evaluator<ArgType> m_argImpl;
10901104
const variable_if_dynamic<Index, (ArgType::RowsAtCompileTime == 1 && BlockRows==1) ? 0 : Dynamic> m_startRow;
10911105
const variable_if_dynamic<Index, (ArgType::ColsAtCompileTime == 1 && BlockCols==1) ? 0 : Dynamic> m_startCol;
1106+
const variable_if_dynamic<Index, InnerPanel ? Dynamic : 0> m_linear_offset;
10921107
};
10931108

10941109
// TODO: This evaluator does not actually use the child evaluator;

inst/include/Eigen/src/Core/Diagonal.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ template<typename MatrixType, int _DiagIndex> class Diagonal
7070
EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal)
7171

7272
EIGEN_DEVICE_FUNC
73-
explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {}
73+
explicit inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index)
74+
{
75+
eigen_assert( a_index <= m_matrix.cols() && -a_index <= m_matrix.rows() );
76+
}
7477

7578
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal)
7679

0 commit comments

Comments
 (0)