[Rcpp-commits] r4571 - in pkg/RcppEigen: . inst/include vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Oct 14 19:50:40 CEST 2013


Author: dmbates
Date: 2013-10-14 19:50:40 +0200 (Mon, 14 Oct 2013)
New Revision: 4571

Modified:
   pkg/RcppEigen/.Rbuildignore
   pkg/RcppEigen/DESCRIPTION
   pkg/RcppEigen/NEWS
   pkg/RcppEigen/NEWS.org
   pkg/RcppEigen/inst/include/RcppEigenCholmod.h
   pkg/RcppEigen/vignettes/RcppEigen-Introduction.Rnw
Log:
Create a version compatible with updates cholmod_factor struct in Matrix package.


Modified: pkg/RcppEigen/.Rbuildignore
===================================================================
--- pkg/RcppEigen/.Rbuildignore	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/.Rbuildignore	2013-10-14 17:50:40 UTC (rev 4571)
@@ -1 +1,4 @@
 vignettes/jss835/
+vignettes/RcppEigen-intro-nojss.*
+NEWS.org
+vignettes/jss.bst
\ No newline at end of file

Modified: pkg/RcppEigen/DESCRIPTION
===================================================================
--- pkg/RcppEigen/DESCRIPTION	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/DESCRIPTION	2013-10-14 17:50:40 UTC (rev 4571)
@@ -1,8 +1,8 @@
 Package: RcppEigen
 Type: Package
 Title: Rcpp integration for the Eigen templated linear algebra library.
-Version: 0.3.1.2.1
-Date: 2013-01-14
+Version: 0.3.1.2.3
+Date: 2013-10-14
 Author: Douglas Bates, Romain Francois and Dirk Eddelbuettel
 Maintainer: Douglas Bates <bates at stat.wisc.edu>
 Description: R and Eigen integration using Rcpp.
@@ -23,9 +23,9 @@
  bindings/bridge to Eigen) is licensed under the GNU GPL version 2 or
  later, as is the rest of Rcpp.
 License: GPL (>= 2)
-Depends: Rcpp (>= 0.10.1), Matrix (>= 1.0-1), R(>= 2.14.0)
+Depends: R(>= 3.0.2)
 LazyLoad: yes
-LinkingTo: Rcpp
-Imports: Matrix
+LinkingTo: Rcpp (>= 0.10.5)
+Imports: Matrix (>= 1.0-16), Rcpp
 Suggests: inline, RUnit, testthat
 URL: http://eigen.tuxfamily.org

Modified: pkg/RcppEigen/NEWS
===================================================================
--- pkg/RcppEigen/NEWS	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/NEWS	2013-10-14 17:50:40 UTC (rev 4571)
@@ -1,20 +1,28 @@
-                       NEWS for RcppEigen-0.3.0
-                       ========================
+                     NEWS for RcppEigen-0.3.1.2.3
+                     ============================
 
 Author: Douglas Bates
-Date: 2013-02-02 Sun
+Date: 2013-10-14 Mon
 
 
 Table of Contents
 =================
-1 New features visible to users in RcppEigen-0.3.1.2
-2 New features visible to users in RcppEigen-0.3.1
-3 New features visible to users in RcppEigen-0.2.0
-4 New features not visible to users in RcppEigen-0.2.0
+1 New features visible to users in RcppEigen-0.3.1.2.3
+2 New features visible to users in RcppEigen-0.3.1.2
+3 New features visible to users in RcppEigen-0.3.1
+4 New features visible to users in RcppEigen-0.2.0
+5 New features not visible to users in RcppEigen-0.2.0
 
 
-1 New features visible to users in RcppEigen-0.3.1.2 
------------------------------------------------------
+1 New features visible to users in RcppEigen-0.3.1.2.3 
+=======================================================
+  + Fix to RcppEigenCholmod.h to incorporate changes in the
+    cholmod_factor struct. These changes are necessary if code
+    compiled against RcppEigen that uses CHOLMOD factors is to be run
+    with versions of the Matrix package >= 1.1-0
+
+2 New features visible to users in RcppEigen-0.3.1.2 
+=====================================================
   + Upgraded to Eigen 3.1.2
   + Fixes to RcppEigenWrap.h and adjustment of tests accordingly.
     The changes allow RowMajor matrices to be wrapped (thanks to Gael
@@ -27,8 +35,8 @@
     Makefiles
   + Fixes related to Rcpp 0.10.*
 
-2 New features visible to users in RcppEigen-0.3.1 
----------------------------------------------------
+3 New features visible to users in RcppEigen-0.3.1 
+===================================================
   + Upgraded to Eigen 3.1.0
   + Removed the "unsupported" Eigen module AutoDiff which defined a
     macro "sign" that conflicted with a function in the R API (which
@@ -39,8 +47,8 @@
     conflicting definitions in the std:: namespace and the R API and
     Eigen, which I don't have time to investigate.
 
-3 New features visible to users in RcppEigen-0.2.0 
----------------------------------------------------
+4 New features visible to users in RcppEigen-0.2.0 
+===================================================
   + Upgraded the version of Eigen to 3.1.0-alpha2, in which the sparse
     matrix modules are now in the "supported" tree.
   + Added several "unsupported" Eigen modules including
@@ -66,8 +74,8 @@
   + The ability to wrap RowMajor sparse matrices and to use
     as<Eigen::ArrayXd> etc.
 
-4 New features not visible to users in RcppEigen-0.2.0 
--------------------------------------------------------
+5 New features not visible to users in RcppEigen-0.2.0 
+=======================================================
   + Migrated some tests to the testthat package.  Currently there is
     some difficulty with combining testthat, inline and R CMD check.
     These checks are available as

Modified: pkg/RcppEigen/NEWS.org
===================================================================
--- pkg/RcppEigen/NEWS.org	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/NEWS.org	2013-10-14 17:50:40 UTC (rev 4571)
@@ -1,11 +1,17 @@
-#+TITLE:     NEWS for RcppEigen-0.3.0
+#+TITLE:     NEWS for RcppEigen-0.3.1.2.3
 #+AUTHOR:    Douglas Bates
 #+EMAIL:     bates at stat.wisc.edu
-#+DATE:      2013-02-02 Sun
+#+DATE:      2013-10-14 Mon
 #+DESCRIPTION: News regarding the latest version of RcppEigen
 #+KEYWORDS:
 #+LANGUAGE:  en
 
+* New features visible to users in RcppEigen-0.3.1.2.3
+  + Fix to RcppEigenCholmod.h to incorporate changes in the
+    cholmod_factor struct. These changes are necessary if code
+    compiled against RcppEigen that uses CHOLMOD factors is to be run
+    with versions of the Matrix package >= 1.1-0
+
 * New features visible to users in RcppEigen-0.3.1.2
   + Upgraded to Eigen 3.1.2
   + Fixes to RcppEigenWrap.h and adjustment of tests accordingly.

Modified: pkg/RcppEigen/inst/include/RcppEigenCholmod.h
===================================================================
--- pkg/RcppEigen/inst/include/RcppEigenCholmod.h	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/inst/include/RcppEigenCholmod.h	2013-10-14 17:50:40 UTC (rev 4571)
@@ -26,26 +26,43 @@
 extern "C" {
 #endif
 
-// from ../../src/UFconfig/UFconfig.h - line 51 :
-#ifndef UF_long
+// from Matrix/src/SuiteSparse_config/SuiteSparse_config.h - line 51 :
+#ifndef SuiteSparse_long
 
 #ifdef _WIN64
 
-#define UF_long __int64
-#define UF_long_max _I64_MAX
-#define UF_long_idd "I64d"
+#define SuiteSparse_long __int64
+#define SuiteSparse_long_max _I64_MAX
+#define SuiteSparse_long_idd "I64d"
 
 #else
 
-#define UF_long long
-#define UF_long_max LONG_MAX
-#define UF_long_idd "ld"
+#define SuiteSparse_long long
+#define SuiteSparse_long_max LONG_MAX
+#define SuiteSparse_long_idd "ld"
 
 #endif
-#define UF_long_id "%" UF_long_idd
+#define SuiteSparse_long_id "%" SuiteSparse_long_idd
 #endif
 
-#define CHOLMOD_DATE "Jan 25, 2011"
+/* For backward compatibility with prior versions of SuiteSparse.  The UF_*
+ * macros are deprecated and will be removed in a future version. */
+#ifndef UF_long
+#define UF_long     SuiteSparse_long
+#define UF_long_max SuiteSparse_long_max
+#define UF_long_idd SuiteSparse_long_idd
+#define UF_long_id  SuiteSparse_long_id
+#endif
+
+#define CHOLMOD_HAS_VERSION_FUNCTION
+
+#define CHOLMOD_DATE "April 25, 2013"
+#define CHOLMOD_VER_CODE(main,sub) ((main) * 1000 + (sub))
+#define CHOLMOD_MAIN_VERSION 2
+#define CHOLMOD_SUB_VERSION 1
+#define CHOLMOD_SUBSUB_VERSION 2
+#define CHOLMOD_VERSION \
+    CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION)
 // from ../../src/CHOLMOD/Include/cholmod_core.h - line 275 :
 /* Each CHOLMOD object has its own type code. */
 
@@ -61,9 +78,13 @@
 
 /* itype defines the types of integer used: */
 #define CHOLMOD_INT 0		/* all integer arrays are int */
-#define CHOLMOD_INTLONG 1	/* most are int, some are UF_long */
-#define CHOLMOD_LONG 2		/* all integer arrays are UF_long */
+#define CHOLMOD_INTLONG 1	/* most are int, some are SuiteSparse_long */
+#define CHOLMOD_LONG 2		/* all integer arrays are SuiteSparse_long */
 
+/* The itype of all parameters for all CHOLMOD routines must match.
+ * FUTURE WORK: CHOLMOD_INTLONG is not yet supported.
+ */
+
 /* dtype defines what the numerical type is (double or float): */
 #define CHOLMOD_DOUBLE 0	/* all numerical values are double */
 #define CHOLMOD_SINGLE 1	/* all numerical values are float */
@@ -92,6 +113,7 @@
 #define CHOLMOD_OUT_OF_MEMORY (-2)	/* failure: out of memory */
 #define CHOLMOD_TOO_LARGE (-3)		/* failure: integer overflow occured */
 #define CHOLMOD_INVALID (-4)		/* failure: invalid input */
+#define CHOLMOD_GPU_PROBLEM (-5)        /* failure: GPU fatal error */
 #define CHOLMOD_NOT_POSDEF (1)		/* warning: matrix not pos. def. */
 #define CHOLMOD_DSMALL (2)		/* warning: D for LDL'  or diag(L) or */
 					/* LL' has tiny absolute value */
@@ -731,7 +753,7 @@
 
 } cholmod_sparse ;
 
-// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 1495 :
+// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 1554 :
 /* A symbolic and numeric factorization, either simplicial or supernodal.
  * In all cases, the row indices in the columns of L are kept sorted. */
 
@@ -755,6 +777,9 @@
     void *Perm ;	/* size n, permutation used */
     void *ColCount ;	/* size n, column counts for simplicial L */
 
+    void *IPerm ;       /* size n, inverse permutation.  Only created by
+                         * cholmod_solve2 if Bset is used. */
+
     /* ---------------------------------------------------------------------- */
     /* simplicial factorization */
     /* ---------------------------------------------------------------------- */
@@ -846,17 +871,17 @@
      *	    except for the numerical values (x and z).
      */
 
-    int itype ;		/* The integer arrays are Perm, ColCount, p, i, nz,
-			 * next, prev, super, pi, px, and s.  If itype is
-			 * CHOLMOD_INT, all of these are int arrays.
-			 * CHOLMOD_INTLONG: p, pi, px are UF_long, others int.
-			 * CHOLMOD_LONG:    all integer arrays are UF_long. */
-    int xtype ;		/* pattern, real, complex, or zomplex */
-    int dtype ;		/* x and z double or float */
+    int itype ; /* The integer arrays are Perm, ColCount, p, i, nz,
+                 * next, prev, super, pi, px, and s.  If itype is
+		 * CHOLMOD_INT, all of these are int arrays.
+		 * CHOLMOD_INTLONG: p, pi, px are SuiteSparse_long, others int.
+		 * CHOLMOD_LONG:    all integer arrays are SuiteSparse_long. */
+    int xtype ; /* pattern, real, complex, or zomplex */
+    int dtype ; /* x and z double or float */
 
 } cholmod_factor ;
 
-// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 1773 :
+// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 1836 :
 /* A dense matrix in column-oriented form.  It has no itype since it contains
  * no integers.  Entry in row i and column j is located in x [i+j*d].
  */
@@ -874,7 +899,7 @@
 
 } cholmod_dense ;
 
-// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 1952 :
+// in ../../src/CHOLMOD/Include/cholmod_core.h  skip forward to - line 2033 :
 /* A sparse matrix stored in triplet form. */
 
 typedef struct cholmod_triplet_struct
@@ -889,12 +914,55 @@
     void *x ;		/* size nzmax or 2*nzmax, if present */
     void *z ;		/* size nzmax, if present */
 
-    int stype ;		/* symmetry type */
-    //                  [................................]
-    int itype ;		/* CHOLMOD_LONG: i and j are UF_long.  Otherwise int. */
-    int xtype ;		/* pattern, real, complex, or zomplex */
-    int dtype ;		/* x and z are double or float */
+    int stype ;		/* Describes what parts of the matrix are considered:
+			 *
+	* 0:  matrix is "unsymmetric": use both upper and lower triangular parts
+	*     (the matrix may actually be symmetric in pattern and value, but
+	*     both parts are explicitly stored and used).  May be square or
+	*     rectangular.
+	* >0: matrix is square and symmetric.  Entries in the lower triangular
+	*     part are transposed and added to the upper triangular part when
+	*     the matrix is converted to cholmod_sparse form.
+	* <0: matrix is square and symmetric.  Entries in the upper triangular
+	*     part are transposed and added to the lower triangular part when
+	*     the matrix is converted to cholmod_sparse form.
+	*
+	* Note that stype>0 and stype<0 are different for cholmod_sparse and
+	* cholmod_triplet.  The reason is simple.  You can permute a symmetric
+	* triplet matrix by simply replacing a row and column index with their
+	* new row and column indices, via an inverse permutation.  Suppose
+	* P = L->Perm is your permutation, and Pinv is an array of size n.
+	* Suppose a symmetric matrix A is represent by a triplet matrix T, with
+	* entries only in the upper triangular part.  Then the following code:
+	*
+	*	Ti = T->i ;
+	*	Tj = T->j ;
+	*	for (k = 0 ; k < n  ; k++) Pinv [P [k]] = k ;
+	*	for (k = 0 ; k < nz ; k++) Ti [k] = Pinv [Ti [k]] ;
+	*	for (k = 0 ; k < nz ; k++) Tj [k] = Pinv [Tj [k]] ;
+	*
+	* creates the triplet form of C=P*A*P'.  However, if T initially
+	* contains just the upper triangular entries (T->stype = 1), after
+	* permutation it has entries in both the upper and lower triangular
+	* parts.  These entries should be transposed when constructing the
+	* cholmod_sparse form of A, which is what cholmod_triplet_to_sparse
+	* does.  Thus:
+	*
+	*	C = cholmod_triplet_to_sparse (T, 0, &Common) ;
+	*
+	* will return the matrix C = P*A*P'.
+	*
+	* Since the triplet matrix T is so simple to generate, it's quite easy
+	* to remove entries that you do not want, prior to converting T to the
+	* cholmod_sparse form.  So if you include these entries in T, CHOLMOD
+	* assumes that there must be a reason (such as the one above).  Thus,
+	* no entry in a triplet matrix is ever ignored.
+	*/
 
+    int itype ; /* CHOLMOD_LONG: i and j are SuiteSparse_long.  Otherwise int */
+    int xtype ; /* pattern, real, complex, or zomplex */
+    int dtype ; /* x and z are double or float */
+
 } cholmod_triplet ;
 
 // -------- our (Matrix)  short and const_ forms of of the pointers :

Modified: pkg/RcppEigen/vignettes/RcppEigen-Introduction.Rnw
===================================================================
--- pkg/RcppEigen/vignettes/RcppEigen-Introduction.Rnw	2013-10-12 22:41:57 UTC (rev 4570)
+++ pkg/RcppEigen/vignettes/RcppEigen-Introduction.Rnw	2013-10-14 17:50:40 UTC (rev 4571)
@@ -52,7 +52,7 @@
   URL: \url{http://dirk.eddelbuettel.com}\\
 }
 
-%% need no \usepackage{Sweave.sty}
+\usepackage{Sweave}
 
 \newcommand{\argmin}{\operatorname{argmin}\displaylimits}
 \newcommand{\rank}{\operatorname{rank}}



More information about the Rcpp-commits mailing list