[Rcpp-commits] r3272 - in pkg/RcppEigen/inst/include: Eigen/src/Geometry unsupported/Eigen/src/SparseExtra

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 3 20:23:27 CET 2011


Author: dmbates
Date: 2011-11-03 20:23:26 +0100 (Thu, 03 Nov 2011)
New Revision: 3272

Modified:
   pkg/RcppEigen/inst/include/Eigen/src/Geometry/Quaternion.h
   pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h
Log:
Minor changes in Eigen sources


Modified: pkg/RcppEigen/inst/include/Eigen/src/Geometry/Quaternion.h
===================================================================
--- pkg/RcppEigen/inst/include/Eigen/src/Geometry/Quaternion.h	2011-11-03 19:22:38 UTC (rev 3271)
+++ pkg/RcppEigen/inst/include/Eigen/src/Geometry/Quaternion.h	2011-11-03 19:23:26 UTC (rev 3272)
@@ -185,7 +185,7 @@
     return typename internal::cast_return_type<Derived,Quaternion<NewScalarType> >::type(
       coeffs().template cast<NewScalarType>());
   }
-  
+
 #ifdef EIGEN_QUATERNIONBASE_PLUGIN
 # include EIGEN_QUATERNIONBASE_PLUGIN
 #endif
@@ -225,22 +225,25 @@
   typedef _Scalar Scalar;
   typedef Matrix<_Scalar,4,1,_Options> Coefficients;
   enum{
-    IsAligned = bool(EIGEN_ALIGN) && ((int(_Options)&Aligned)==Aligned),
+    IsAligned = internal::traits<Coefficients>::Flags & AlignedBit,
     Flags = IsAligned ? (AlignedBit | LvalueBit) : LvalueBit
   };
 };
 }
 
 template<typename _Scalar, int _Options>
-class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >{
+class Quaternion : public QuaternionBase<Quaternion<_Scalar,_Options> >
+{
   typedef QuaternionBase<Quaternion<_Scalar,_Options> > Base;
+  enum { IsAligned = internal::traits<Quaternion>::IsAligned };
+
 public:
   typedef _Scalar Scalar;
 
   EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Quaternion)
   using Base::operator*=;
 
-  typedef typename internal::traits<Quaternion<Scalar,_Options> >::Coefficients Coefficients;
+  typedef typename internal::traits<Quaternion>::Coefficients Coefficients;
   typedef typename Base::AngleAxisType AngleAxisType;
 
   /** Default constructor leaving the quaternion uninitialized. */
@@ -274,6 +277,8 @@
   inline Coefficients& coeffs() { return m_coeffs;}
   inline const Coefficients& coeffs() const { return m_coeffs;}
 
+  EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(IsAligned)
+
 protected:
   Coefficients m_coeffs;
   

Modified: pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h
===================================================================
--- pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h	2011-11-03 19:22:38 UTC (rev 3271)
+++ pkg/RcppEigen/inst/include/unsupported/Eigen/src/SparseExtra/SimplicialCholesky.h	2011-11-03 19:23:26 UTC (rev 3272)
@@ -194,12 +194,12 @@
     
     /** \returns the permutation P
       * \sa permutationPinv() */
-    const PermutationMatrix<Dynamic,Dynamic,Index>& permutationP() const
+    const PermutationMatrix<Dynamic>& permutationP() const
     { return m_P; }
     
     /** \returns the inverse P^-1 of the permutation P
       * \sa permutationP() */
-    const PermutationMatrix<Dynamic,Dynamic,Index>& permutationPinv() const
+    const PermutationMatrix<Dynamic>& permutationPinv() const
     { return m_Pinv; }
     
     /** \returns true if the factorization is initialized */
@@ -258,7 +258,10 @@
       }
       else
       {
+        if(m_matrix.nonZeros()>0) // otherwise L==I
           m_matrix.template triangularView<Lower>().solveInPlace(dest);
+      
+        if (m_matrix.nonZeros()>0) // otherwise L==I
           m_matrix.adjoint().template triangularView<Upper>().solveInPlace(dest);
       }
       
@@ -307,8 +310,8 @@
     CholMatrixType m_matrix;
     VectorXi m_parent;		// elimination tree
     VectorXi m_nonZerosPerCol;
-    PermutationMatrix<Dynamic,Dynamic,Index> m_P;     // the permutation
-    PermutationMatrix<Dynamic,Dynamic,Index> m_Pinv;  // the inverse permutation
+    PermutationMatrix<Dynamic> m_P;     // the permutation
+    PermutationMatrix<Dynamic> m_Pinv;  // the inverse permutation
     VectorType m_diag;		// the diagonal coefficients
 };
 



More information about the Rcpp-commits mailing list