Skip to content

Commit 08f8ea8

Browse files
committed
Applied (and documented) diff carried over from 5.0.0
1 parent 447dfb0 commit 08f8ea8

7 files changed

Lines changed: 294 additions & 69 deletions

File tree

ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2026-06-04 Dirk Eddelbuettel <edd@debian.org>
2+
3+
* inst/include/Eigen/: Sync with upstream Eigen 5.0.1
4+
* inst/include/unsupported/Eigen/: Idem
5+
6+
* inst/include/Eigen/CholmodSupport: Apply previous patch
7+
* inst/include/Eigen/src/CholmodSupport/CholmodSupport.h: Idem
8+
* inst/include/Eigen/src/Core/util/DisableStupidWarnings.h: Idem
9+
* inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h: Idem
10+
111
2026-05-03 Dirk Eddelbuettel <edd@debian.org>
212

313
* vignettes/rnw/RcppEigen-Introduction.Rnw: Moved, also update three

inst/include/Eigen/CholmodSupport

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include "src/Core/util/DisableStupidWarnings.h"
1414

15-
#include <cholmod.h>
15+
#include <RcppEigenCholmod.h>
1616

1717
/** \ingroup Support_modules
1818
* \defgroup CholmodSupport_Module CholmodSupport module

inst/include/Eigen/src/CholmodSupport/CholmodSupport.h

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
// IWYU pragma: private
1414
#include "./InternalHeaderCheck.h"
1515

16+
#ifndef R_MATRIX_CHOLMOD
17+
# define R_MATRIX_CHOLMOD(_NAME_) cholmod_ ## _NAME_
18+
#endif
19+
1620
namespace Eigen {
1721

1822
namespace internal {
@@ -84,8 +88,8 @@ cholmod_sparse viewAsCholmod(Ref<SparseMatrix<Scalar_, Options_, StorageIndex_>
8488

8589
if (internal::is_same<StorageIndex_, int>::value) {
8690
res.itype = CHOLMOD_INT;
87-
} else if (internal::is_same<StorageIndex_, SuiteSparse_long>::value) {
88-
res.itype = CHOLMOD_LONG;
91+
// } else if (internal::is_same<StorageIndex_, SuiteSparse_long>::value) {
92+
// res.itype = CHOLMOD_LONG;
8993
} else {
9094
eigen_assert(false && "Index type not supported yet");
9195
}
@@ -172,21 +176,13 @@ namespace internal {
172176
#define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \
173177
template <typename StorageIndex_> \
174178
inline ret cm_##name(cholmod_common& Common) { \
175-
return cholmod_##name(&Common); \
176-
} \
177-
template <> \
178-
inline ret cm_##name<SuiteSparse_long>(cholmod_common & Common) { \
179-
return cholmod_l_##name(&Common); \
179+
return R_MATRIX_CHOLMOD(name)(&Common); \
180180
}
181181

182-
#define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \
183-
template <typename StorageIndex_> \
184-
inline ret cm_##name(t1& a1, cholmod_common& Common) { \
185-
return cholmod_##name(&a1, &Common); \
186-
} \
187-
template <> \
188-
inline ret cm_##name<SuiteSparse_long>(t1 & a1, cholmod_common & Common) { \
189-
return cholmod_l_##name(&a1, &Common); \
182+
#define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \
183+
template <typename StorageIndex_> \
184+
inline ret cm_##name(t1& a1, cholmod_common& Common) { \
185+
return R_MATRIX_CHOLMOD(name) (&a1, &Common); \
190186
}
191187

192188
EIGEN_CHOLMOD_SPECIALIZE0(int, start)
@@ -201,33 +197,33 @@ EIGEN_CHOLMOD_SPECIALIZE1(cholmod_sparse*, factor_to_sparse, cholmod_factor, L)
201197

202198
template <typename StorageIndex_>
203199
inline cholmod_dense* cm_solve(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
204-
return cholmod_solve(sys, &L, &B, &Common);
205-
}
206-
template <>
207-
inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
208-
return cholmod_l_solve(sys, &L, &B, &Common);
200+
return R_MATRIX_CHOLMOD(solve) (sys, &L, &B, &Common);
209201
}
202+
// template <>
203+
// inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
204+
// return cholmod_l_solve(sys, &L, &B, &Common);
205+
// }
210206

211207
template <typename StorageIndex_>
212208
inline cholmod_sparse* cm_spsolve(int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common& Common) {
213-
return cholmod_spsolve(sys, &L, &B, &Common);
214-
}
215-
template <>
216-
inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
217-
cholmod_common& Common) {
218-
return cholmod_l_spsolve(sys, &L, &B, &Common);
209+
return R_MATRIX_CHOLMOD(spsolve) (sys, &L, &B, &Common);
219210
}
211+
// template <>
212+
// inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
213+
// cholmod_common& Common) {
214+
// return cholmod_l_spsolve(sys, &L, &B, &Common);
215+
// }
220216

221217
template <typename StorageIndex_>
222218
inline int cm_factorize_p(cholmod_sparse* A, double beta[2], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L,
223219
cholmod_common& Common) {
224-
return cholmod_factorize_p(A, beta, fset, fsize, L, &Common);
225-
}
226-
template <>
227-
inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
228-
std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
229-
return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
220+
return R_MATRIX_CHOLMOD(factorize_p) (A, beta, fset, fsize, L, &Common);
230221
}
222+
// template <>
223+
// inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
224+
// std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
225+
// return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
226+
// }
231227

232228
#undef EIGEN_CHOLMOD_SPECIALIZE0
233229
#undef EIGEN_CHOLMOD_SPECIALIZE1

inst/include/Eigen/src/Core/util/DisableStupidWarnings.h

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,45 +42,45 @@
4242
#pragma warning disable 2196 279 1684 2259
4343

4444
#elif defined __clang__
45-
#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
46-
#pragma clang diagnostic push
47-
#endif
48-
#if defined(__has_warning)
49-
// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
50-
// this is really a stupid warning as it warns on compile-time expressions involving enums
51-
#if __has_warning("-Wconstant-logical-operand")
52-
#pragma clang diagnostic ignored "-Wconstant-logical-operand"
53-
#endif
54-
#if __has_warning("-Wimplicit-int-float-conversion")
55-
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
56-
#endif
57-
#if (defined(__ALTIVEC__) || defined(__VSX__)) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L))
58-
// warning: generic selections are a C11-specific feature
59-
// ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
60-
#if __has_warning("-Wc11-extensions")
61-
#pragma clang diagnostic ignored "-Wc11-extensions"
62-
#endif
63-
#endif
64-
#endif
45+
// #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
46+
// #pragma clang diagnostic push
47+
// #endif
48+
// #if defined(__has_warning)
49+
// // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
50+
// // this is really a stupid warning as it warns on compile-time expressions involving enums
51+
// #if __has_warning("-Wconstant-logical-operand")
52+
// #pragma clang diagnostic ignored "-Wconstant-logical-operand"
53+
// #endif
54+
// #if __has_warning("-Wimplicit-int-float-conversion")
55+
// #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
56+
// #endif
57+
// #if (defined(__ALTIVEC__) || defined(__VSX__)) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L))
58+
// // warning: generic selections are a C11-specific feature
59+
// // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
60+
// #if __has_warning("-Wc11-extensions")
61+
// #pragma clang diagnostic ignored "-Wc11-extensions"
62+
// #endif
63+
// #endif
64+
// #endif
6565

6666
#elif defined __GNUC__ && !defined(__FUJITSU)
6767

68-
#if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
69-
#pragma GCC diagnostic push
70-
#endif
71-
// g++ warns about local variables shadowing member functions, which is too strict
72-
#pragma GCC diagnostic ignored "-Wshadow"
73-
#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
74-
// Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
75-
#pragma GCC diagnostic ignored "-Wtype-limits"
76-
#endif
77-
#if __GNUC__ >= 6
78-
#pragma GCC diagnostic ignored "-Wignored-attributes"
79-
#endif
80-
#if __GNUC__ == 7
81-
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
82-
#pragma GCC diagnostic ignored "-Wattributes"
83-
#endif
68+
// #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
69+
// #pragma GCC diagnostic push
70+
// #endif
71+
// // g++ warns about local variables shadowing member functions, which is too strict
72+
// #pragma GCC diagnostic ignored "-Wshadow"
73+
// #if __GNUC__ == 4 && __GNUC_MINOR__ < 8
74+
// // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
75+
// #pragma GCC diagnostic ignored "-Wtype-limits"
76+
// #endif
77+
// #if __GNUC__ >= 6
78+
// #pragma GCC diagnostic ignored "-Wignored-attributes"
79+
// #endif
80+
// #if __GNUC__ == 7
81+
// // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
82+
// #pragma GCC diagnostic ignored "-Wattributes"
83+
// #endif
8484
#endif
8585

8686
#if defined __NVCC__ && defined __CUDACC__

inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ class MatrixMarketIterator {
171171
std::string curfile;
172172
curfile = m_folder + "/" + m_curs_id->d_name;
173173
// Discard if it is a folder
174+
#if !(defined(__sun) || defined(_AIX) || defined(__hpux) || defined(__sgi) || defined(__HAIKU__))
174175
if (m_curs_id->d_type == DT_DIR) continue; // FIXME This may not be available on non BSD systems
176+
#endif
175177
// struct stat st_buf;
176178
// stat (curfile.c_str(), &st_buf);
177179
// if (S_ISDIR(st_buf.st_mode)) continue;

0 commit comments

Comments
 (0)