Skip to content
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: RcppEigen
Type: Package
Title: 'Rcpp' Integration for the 'Eigen' Templated Linear Algebra Library
Version: 0.3.2.9.0
Date: 2016-08-20
Version: 0.3.2.9.1
Date: 2017-03-13
Author: Douglas Bates, Dirk Eddelbuettel, Romain Francois, and Yixuan Qiu;
the authors of Eigen for the included version of Eigen
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand Down
58 changes: 40 additions & 18 deletions inst/include/RcppEigenCholmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,46 @@
#ifndef RcppEigen_CHOLMOD_H
#define RcppEigen_CHOLMOD_H

/* Original of this is Matrix/inst/include/cholmod.h --- sync with it (e.g for lme4) !
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <stddef.h>
#include <limits.h>

// Rather use C99 -- which we require in R anyway
#include <inttypes.h>


#ifdef __cplusplus
extern "C" {
#endif

// from Matrix/src/SuiteSparse_config/SuiteSparse_config.h - line 51 :
#ifndef SuiteSparse_long

#ifdef _WIN64
/* #ifdef _WIN64 */

#define SuiteSparse_long __int64
#define SuiteSparse_long_max _I64_MAX
#define SuiteSparse_long_idd "I64d"
/* #define SuiteSparse_long __int64 */
/* #define SuiteSparse_long_max _I64_MAX */
/* #define SuiteSparse_long_idd "I64d" */

#else
/* #else */

#define SuiteSparse_long long
#define SuiteSparse_long_max LONG_MAX
#define SuiteSparse_long_idd "ld"
/* #define SuiteSparse_long long */
/* #define SuiteSparse_long_max LONG_MAX */
/* #define SuiteSparse_long_idd "ld" */

/* #endif */

#define SuiteSparse_long int64_t
// typically long (but on WIN64)
#define SuiteSparse_ulong uint64_t
// only needed for ../COLAMD/Source/colamd.c (original has 'unsigned Int' which fails!!)
#define SuiteSparse_long_max 9223372036854775801
// typically LONG_MAX (but ..)
#define SuiteSparse_long_idd PRId64
// typically "ld"

#endif
#define SuiteSparse_long_id "%" SuiteSparse_long_idd
#endif

Expand All @@ -54,6 +74,7 @@ extern "C" {
#define UF_long_id SuiteSparse_long_id
#endif


#define CHOLMOD_HAS_VERSION_FUNCTION

#define CHOLMOD_DATE "April 25, 2013"
Expand Down Expand Up @@ -570,7 +591,7 @@ typedef struct cholmod_common_struct
*/

size_t nrow ; /* size of Flag and Head */
UF_long mark ; /* mark value for Flag array */
SuiteSparse_long mark ; /* mark value for Flag array */
size_t iworksize ; /* size of Iwork. Upper bound: 6*nrow+ncol */
size_t xworksize ; /* size of Xwork, in bytes.
* maxrank*nrow*sizeof(double) for update/downdate.
Expand All @@ -595,7 +616,7 @@ typedef struct cholmod_common_struct
void *Iwork ; /* size iworksize, 2*nrow+ncol for most routines,
* up to 6*nrow+ncol for cholmod_analyze. */

int itype ; /* If CHOLMOD_LONG, Flag, Head, and Iwork are UF_long.
int itype ; /* If CHOLMOD_LONG, Flag, Head, and Iwork are SuiteSparse_long.
* Otherwise all three arrays are int. */

int dtype ; /* double or float */
Expand Down Expand Up @@ -660,8 +681,8 @@ typedef struct cholmod_common_struct
double SPQR_small ; /* task size is >= small */

/* ---------------------------------------------------------------------- */
UF_long SPQR_istat [10] ; /* for SuiteSparseQR statistics */
UF_long other2 [6] ; /* reduced from size 16 in v1.6 */
SuiteSparse_long SPQR_istat [10] ; /* for SuiteSparseQR statistics */
SuiteSparse_long other2 [6] ; /* reduced from size 16 in v1.6 */

/* ---------------------------------------------------------------------- */
int other3 [10] ; /* reduced from size 16 in v1.1. */
Expand Down Expand Up @@ -700,7 +721,7 @@ typedef struct cholmod_common_struct

} cholmod_common ;

// in ../../src/CHOLMOD/Include/cholmod_core.h skip forward to - line 1114 :
// in ../../src/CHOLMOD/Include/cholmod_core.h skip forward to - line 1170 :
/* A sparse matrix stored in compressed-column form. */

typedef struct cholmod_sparse_struct
Expand All @@ -709,7 +730,7 @@ typedef struct cholmod_sparse_struct
size_t ncol ;
size_t nzmax ; /* maximum number of entries in the matrix */

/* pointers to int or UF_long: */
/* pointers to int or SuiteSparse_long: */
void *p ; /* p [0..ncol], the column pointers */
void *i ; /* i [0..nzmax-1], the row indices */

Expand Down Expand Up @@ -742,8 +763,9 @@ typedef struct cholmod_sparse_struct
*/

int itype ; /* CHOLMOD_INT: p, i, and nz are int.
* CHOLMOD_INTLONG: p is UF_long, i and nz are int.
* CHOLMOD_LONG: p, i, and nz are UF_long. */
* CHOLMOD_INTLONG: p is SuiteSparse_long,
* i and nz are int.
* CHOLMOD_LONG: p, i, and nz are SuiteSparse_long */

int xtype ; /* pattern, real, complex, or zomplex */
int dtype ; /* x and z are double or float */
Expand All @@ -753,7 +775,7 @@ typedef struct cholmod_sparse_struct

} cholmod_sparse ;

// in ../../src/CHOLMOD/Include/cholmod_core.h skip forward to - line 1554 :
// in ../../src/CHOLMOD/Include/cholmod_core.h skip forward to - line 1552 :
/* A symbolic and numeric factorization, either simplicial or supernodal.
* In all cases, the row indices in the columns of L are kept sorted. */

Expand Down