[Rcpp-commits] r3501 - in pkg/RcppEigen/inst/include/Eigen/src: Core PardisoSupport

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 10 21:20:21 CET 2012


Author: dmbates
Date: 2012-03-10 21:20:20 +0100 (Sat, 10 Mar 2012)
New Revision: 3501

Modified:
   pkg/RcppEigen/inst/include/Eigen/src/Core/Block.h
   pkg/RcppEigen/inst/include/Eigen/src/Core/CwiseNullaryOp.h
   pkg/RcppEigen/inst/include/Eigen/src/Core/Functors.h
   pkg/RcppEigen/inst/include/Eigen/src/Core/GlobalFunctions.h
   pkg/RcppEigen/inst/include/Eigen/src/PardisoSupport/PardisoSupport.h
Log:
Update to repository version from 2012-03-09


Modified: pkg/RcppEigen/inst/include/Eigen/src/Core/Block.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/Core/Block.h	2012-03-10 20:19:32 UTC (rev 3500)
+++ pkg/RcppEigen/inst/include/Eigen/src/Core/Block.h	2012-03-10 20:20:20 UTC (rev 3501)
@@ -362,7 +362,7 @@
     }
 
     typename XprType::Nested m_xpr;
-    int m_outerStride;
+    Index m_outerStride;
 };
 
 

Modified: pkg/RcppEigen/inst/include/Eigen/src/Core/CwiseNullaryOp.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/Core/CwiseNullaryOp.h	2012-03-10 20:19:32 UTC (rev 3500)
+++ pkg/RcppEigen/inst/include/Eigen/src/Core/CwiseNullaryOp.h	2012-03-10 20:20:20 UTC (rev 3501)
@@ -241,6 +241,8 @@
   * assumed to be a(0), a(1), ..., a(size). This assumption allows for better vectorization
   * and yields faster code than the random access version.
   *
+  * When size is set to 1, a vector of length 1 containing 'high' is returned.
+  *
   * \only_for_vectors
   *
   * Example: \include DenseBase_LinSpaced_seq.cpp
@@ -273,6 +275,7 @@
   * \brief Sets a linearly space vector.
   *
   * The function generates 'size' equally spaced values in the closed interval [low,high].
+  * When size is set to 1, a vector of length 1 containing 'high' is returned.
   *
   * \only_for_vectors
   *
@@ -384,6 +387,7 @@
   * \brief Sets a linearly space vector.
   *
   * The function generates 'size' equally spaced values in the closed interval [low,high].
+  * When size is set to 1, a vector of length 1 containing 'high' is returned.
   *
   * \only_for_vectors
   *
@@ -403,6 +407,7 @@
   * \brief Sets a linearly space vector.
   *
   * The function fill *this with equally spaced values in the closed interval [low,high].
+  * When size is set to 1, a vector of length 1 containing 'high' is returned.
   *
   * \only_for_vectors
   *

Modified: pkg/RcppEigen/inst/include/Eigen/src/Core/Functors.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/Core/Functors.h	2012-03-10 20:19:32 UTC (rev 3500)
+++ pkg/RcppEigen/inst/include/Eigen/src/Core/Functors.h	2012-03-10 20:20:20 UTC (rev 3501)
@@ -178,6 +178,18 @@
   enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess=0 };
 };
 
+/** \internal
+  * \brief Template functor to compute the pow of two scalars
+  */
+template<typename Scalar, typename OtherScalar> struct scalar_binary_pow_op {
+  EIGEN_EMPTY_STRUCT_CTOR(scalar_binary_pow_op)
+  inline Scalar operator() (const Scalar& a, const OtherScalar& b) const { return internal::pow(a, b); }
+};
+template<typename Scalar, typename OtherScalar>
+struct functor_traits<scalar_binary_pow_op<Scalar,OtherScalar> > {
+  enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false };
+};
+
 // other binary functors:
 
 /** \internal
@@ -616,7 +628,7 @@
 template <typename Scalar, bool RandomAccess> struct linspaced_op
 {
   typedef typename packet_traits<Scalar>::type Packet;
-  linspaced_op(Scalar low, Scalar high, int num_steps) : impl(low, (high-low)/(num_steps-1)) {}
+  linspaced_op(Scalar low, Scalar high, int num_steps) : impl((num_steps==1 ? high : low), (num_steps==1 ? Scalar() : (high-low)/(num_steps-1))) {}
 
   template<typename Index>
   EIGEN_STRONG_INLINE const Scalar operator() (Index i) const { return impl(i); }
@@ -813,18 +825,18 @@
 struct functor_traits<scalar_pow_op<Scalar> >
 { enum { Cost = 5 * NumTraits<Scalar>::MulCost, PacketAccess = false }; };
 
-/** \internal
-  * \brief Template functor to compute the quotient between a scalar and array entries.
-  * \sa class CwiseUnaryOp, Cwise::inverse()
-  */
-template<typename Scalar>
-struct scalar_inverse_mult_op {
-  scalar_inverse_mult_op(const Scalar& other) : m_other(other) {}
-  inline Scalar operator() (const Scalar& a) const { return m_other / a; }
-  template<typename Packet>
-  inline const Packet packetOp(const Packet& a) const
-  { return internal::pdiv(pset1<Packet>(m_other),a); }
-  Scalar m_other;
+/** \internal
+  * \brief Template functor to compute the quotient between a scalar and array entries.
+  * \sa class CwiseUnaryOp, Cwise::inverse()
+  */
+template<typename Scalar>
+struct scalar_inverse_mult_op {
+  scalar_inverse_mult_op(const Scalar& other) : m_other(other) {}
+  inline Scalar operator() (const Scalar& a) const { return m_other / a; }
+  template<typename Packet>
+  inline const Packet packetOp(const Packet& a) const
+  { return internal::pdiv(pset1<Packet>(m_other),a); }
+  Scalar m_other;
 };
 
 /** \internal

Modified: pkg/RcppEigen/inst/include/Eigen/src/Core/GlobalFunctions.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/Core/GlobalFunctions.h	2012-03-10 20:19:32 UTC (rev 3500)
+++ pkg/RcppEigen/inst/include/Eigen/src/Core/GlobalFunctions.h	2012-03-10 20:20:20 UTC (rev 3501)
@@ -66,24 +66,34 @@
 
   template<typename Derived>
   inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_pow_op<typename Derived::Scalar>, const Derived>
-  pow(const Eigen::ArrayBase<Derived>& x, const typename Derived::Scalar& exponent) { \
-    return x.derived().pow(exponent); \
+  pow(const Eigen::ArrayBase<Derived>& x, const typename Derived::Scalar& exponent) {
+    return x.derived().pow(exponent);
   }
+
+  template<typename Derived>
+  inline const Eigen::CwiseBinaryOp<Eigen::internal::scalar_binary_pow_op<typename Derived::Scalar, typename Derived::Scalar>, const Derived, const Derived>
+  pow(const Eigen::ArrayBase<Derived>& x, const Eigen::ArrayBase<Derived>& exponents) 
+  {
+    return Eigen::CwiseBinaryOp<Eigen::internal::scalar_binary_pow_op<typename Derived::Scalar, typename Derived::Scalar>, const Derived, const Derived>(
+      x.derived(),
+      exponents.derived()
+    );
+  }
 }
 
 namespace Eigen
 {
-  /**
-  * \brief Component-wise division of a scalar by array elements.
-  **/
-  template <typename Derived>
-  inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>
-    operator/(typename Derived::Scalar s, const Eigen::ArrayBase<Derived>& a)
-  {
-    return Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>(
-      a.derived(),
-      Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>(s)  
-    );
+  /**
+  * \brief Component-wise division of a scalar by array elements.
+  **/
+  template <typename Derived>
+  inline const Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>
+    operator/(typename Derived::Scalar s, const Eigen::ArrayBase<Derived>& a)
+  {
+    return Eigen::CwiseUnaryOp<Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>, const Derived>(
+      a.derived(),
+      Eigen::internal::scalar_inverse_mult_op<typename Derived::Scalar>(s)  
+    );
   }
 
   namespace internal

Modified: pkg/RcppEigen/inst/include/Eigen/src/PardisoSupport/PardisoSupport.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/PardisoSupport/PardisoSupport.h	2012-03-10 20:19:32 UTC (rev 3500)
+++ pkg/RcppEigen/inst/include/Eigen/src/PardisoSupport/PardisoSupport.h	2012-03-10 20:20:20 UTC (rev 3501)
@@ -142,7 +142,7 @@
       * See the PARDISO manual to know how to use it. */
     Array<Index,64,1>& pardisoParameterArray()
     {
-      return m_param;
+      return m_iparm;
     }
     
     /** Performs a symbolic decomposition on the sparcity of \a matrix.
@@ -370,7 +370,7 @@
     return false;
 
   //Index n = m_matrix.rows();
-  Index nrhs = b.cols();
+  Index nrhs = Index(b.cols());
   eigen_assert(m_size==b.rows());
   eigen_assert(((MatrixBase<BDerived>::Flags & RowMajorBit) == 0 || nrhs == 1) && "Row-major right hand sides are not supported");
   eigen_assert(((MatrixBase<XDerived>::Flags & RowMajorBit) == 0 || nrhs == 1) && "Row-major matrices of unknowns are not supported");



More information about the Rcpp-commits mailing list