Skip to content

Commit 771df90

Browse files
committed
Commit patch file
1 parent 7407a5f commit 771df90

File tree

1 file changed

+192
-0
lines changed

1 file changed

+192
-0
lines changed

patches/eigen-5.0.0.diff

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
diff --git c/inst/include/Eigen/CholmodSupport i/inst/include/Eigen/CholmodSupport
2+
index adc5f8d..bff39e6 100644
3+
--- c/inst/include/Eigen/CholmodSupport
4+
+++ i/inst/include/Eigen/CholmodSupport
5+
@@ -12,7 +12,7 @@
6+
7+
#include "src/Core/util/DisableStupidWarnings.h"
8+
9+
-#include <cholmod.h>
10+
+#include <RcppEigenCholmod.h>
11+
12+
/** \ingroup Support_modules
13+
* \defgroup CholmodSupport_Module CholmodSupport module
14+
diff --git c/inst/include/Eigen/src/CholmodSupport/CholmodSupport.h i/inst/include/Eigen/src/CholmodSupport/CholmodSupport.h
15+
index 7e3c881..cf0059f 100644
16+
--- c/inst/include/Eigen/src/CholmodSupport/CholmodSupport.h
17+
+++ i/inst/include/Eigen/src/CholmodSupport/CholmodSupport.h
18+
@@ -170,24 +170,12 @@ namespace internal {
19+
// template specializations for int and long that call the correct cholmod method
20+
21+
#define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \
22+
- template <typename StorageIndex_> \
23+
- inline ret cm_##name(cholmod_common& Common) { \
24+
- return cholmod_##name(&Common); \
25+
- } \
26+
- template <> \
27+
- inline ret cm_##name<SuiteSparse_long>(cholmod_common & Common) { \
28+
- return cholmod_l_##name(&Common); \
29+
- }
30+
+ template<typename _StorageIndex> inline ret cm_ ## name \
31+
+ (cholmod_common &Common) { return cholmod_ ## name (&Common); }
32+
33+
#define EIGEN_CHOLMOD_SPECIALIZE1(ret, name, t1, a1) \
34+
- template <typename StorageIndex_> \
35+
- inline ret cm_##name(t1& a1, cholmod_common& Common) { \
36+
- return cholmod_##name(&a1, &Common); \
37+
- } \
38+
- template <> \
39+
- inline ret cm_##name<SuiteSparse_long>(t1 & a1, cholmod_common & Common) { \
40+
- return cholmod_l_##name(&a1, &Common); \
41+
- }
42+
+ template<typename _StorageIndex> inline ret cm_ ## name \
43+
+ (t1& a1, cholmod_common &Common) { return cholmod_ ## name (&a1, &Common); }
44+
45+
EIGEN_CHOLMOD_SPECIALIZE0(int, start)
46+
EIGEN_CHOLMOD_SPECIALIZE0(int, finish)
47+
@@ -203,31 +191,31 @@ template <typename StorageIndex_>
48+
inline cholmod_dense* cm_solve(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
49+
return cholmod_solve(sys, &L, &B, &Common);
50+
}
51+
-template <>
52+
-inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
53+
- return cholmod_l_solve(sys, &L, &B, &Common);
54+
-}
55+
+//template <>
56+
+//inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
57+
+// return cholmod_l_solve(sys, &L, &B, &Common);
58+
+//}
59+
60+
template <typename StorageIndex_>
61+
inline cholmod_sparse* cm_spsolve(int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common& Common) {
62+
return cholmod_spsolve(sys, &L, &B, &Common);
63+
}
64+
-template <>
65+
-inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
66+
- cholmod_common& Common) {
67+
- return cholmod_l_spsolve(sys, &L, &B, &Common);
68+
-}
69+
+//template <>
70+
+//inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
71+
+// cholmod_common& Common) {
72+
+// return cholmod_l_spsolve(sys, &L, &B, &Common);
73+
+//}
74+
75+
template <typename StorageIndex_>
76+
inline int cm_factorize_p(cholmod_sparse* A, double beta[2], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L,
77+
cholmod_common& Common) {
78+
return cholmod_factorize_p(A, beta, fset, fsize, L, &Common);
79+
}
80+
-template <>
81+
-inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
82+
- std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
83+
- return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
84+
-}
85+
+//template <>
86+
+//inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
87+
+// std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
88+
+// return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
89+
+//}
90+
91+
#undef EIGEN_CHOLMOD_SPECIALIZE0
92+
#undef EIGEN_CHOLMOD_SPECIALIZE1
93+
diff --git c/inst/include/Eigen/src/Core/util/DisableStupidWarnings.h i/inst/include/Eigen/src/Core/util/DisableStupidWarnings.h
94+
index ab0c542..8c27b14 100644
95+
--- c/inst/include/Eigen/src/Core/util/DisableStupidWarnings.h
96+
+++ i/inst/include/Eigen/src/Core/util/DisableStupidWarnings.h
97+
@@ -42,45 +42,45 @@
98+
#pragma warning disable 2196 279 1684 2259
99+
100+
#elif defined __clang__
101+
-#ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
102+
-#pragma clang diagnostic push
103+
-#endif
104+
-#if defined(__has_warning)
105+
-// -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
106+
-// this is really a stupid warning as it warns on compile-time expressions involving enums
107+
-#if __has_warning("-Wconstant-logical-operand")
108+
-#pragma clang diagnostic ignored "-Wconstant-logical-operand"
109+
-#endif
110+
-#if __has_warning("-Wimplicit-int-float-conversion")
111+
-#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
112+
-#endif
113+
-#if (defined(__ALTIVEC__) || defined(__VSX__)) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L))
114+
-// warning: generic selections are a C11-specific feature
115+
-// ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
116+
-#if __has_warning("-Wc11-extensions")
117+
-#pragma clang diagnostic ignored "-Wc11-extensions"
118+
-#endif
119+
-#endif
120+
-#endif
121+
+// #ifndef EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS
122+
+// #pragma clang diagnostic push
123+
+// #endif
124+
+// #if defined(__has_warning)
125+
+// // -Wconstant-logical-operand - warning: use of logical && with constant operand; switch to bitwise & or remove constant
126+
+// // this is really a stupid warning as it warns on compile-time expressions involving enums
127+
+// #if __has_warning("-Wconstant-logical-operand")
128+
+// #pragma clang diagnostic ignored "-Wconstant-logical-operand"
129+
+// #endif
130+
+// #if __has_warning("-Wimplicit-int-float-conversion")
131+
+// #pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
132+
+// #endif
133+
+// #if (defined(__ALTIVEC__) || defined(__VSX__)) && (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L))
134+
+// // warning: generic selections are a C11-specific feature
135+
+// // ignoring warnings thrown at vec_ctf in Altivec/PacketMath.h
136+
+// #if __has_warning("-Wc11-extensions")
137+
+// #pragma clang diagnostic ignored "-Wc11-extensions"
138+
+// #endif
139+
+// #endif
140+
+// #endif
141+
142+
#elif defined __GNUC__ && !defined(__FUJITSU)
143+
144+
-#if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
145+
-#pragma GCC diagnostic push
146+
-#endif
147+
-// g++ warns about local variables shadowing member functions, which is too strict
148+
-#pragma GCC diagnostic ignored "-Wshadow"
149+
-#if __GNUC__ == 4 && __GNUC_MINOR__ < 8
150+
-// Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
151+
-#pragma GCC diagnostic ignored "-Wtype-limits"
152+
-#endif
153+
-#if __GNUC__ >= 6
154+
-#pragma GCC diagnostic ignored "-Wignored-attributes"
155+
-#endif
156+
-#if __GNUC__ == 7
157+
-// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
158+
-#pragma GCC diagnostic ignored "-Wattributes"
159+
-#endif
160+
+// #if (!defined(EIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS)) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
161+
+// #pragma GCC diagnostic push
162+
+// #endif
163+
+// // g++ warns about local variables shadowing member functions, which is too strict
164+
+// #pragma GCC diagnostic ignored "-Wshadow"
165+
+// #if __GNUC__ == 4 && __GNUC_MINOR__ < 8
166+
+// // Until g++-4.7 there are warnings when comparing unsigned int vs 0, even in templated functions:
167+
+// #pragma GCC diagnostic ignored "-Wtype-limits"
168+
+// #endif
169+
+// #if __GNUC__ >= 6
170+
+// #pragma GCC diagnostic ignored "-Wignored-attributes"
171+
+// #endif
172+
+// #if __GNUC__ == 7
173+
+// // See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89325
174+
+// #pragma GCC diagnostic ignored "-Wattributes"
175+
+// #endif
176+
#endif
177+
178+
#if defined __NVCC__ && defined __CUDACC__
179+
diff --git c/inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h i/inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h
180+
index 15d7fb2..0ccb566 100644
181+
--- c/inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h
182+
+++ i/inst/include/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h
183+
@@ -170,7 +170,9 @@ class MatrixMarketIterator {
184+
m_isvalid = false;
185+
std::string curfile;
186+
curfile = m_folder + "/" + m_curs_id->d_name;
187+
+#if !(defined(__sun) || defined(_AIX) || defined(__hpux) || defined(__sgi) || defined(__HAIKU__))
188+
// Discard if it is a folder
189+
+#endif
190+
if (m_curs_id->d_type == DT_DIR) continue; // FIXME This may not be available on non BSD systems
191+
// struct stat st_buf;
192+
// stat (curfile.c_str(), &st_buf);

0 commit comments

Comments
 (0)