Skip to content

Commit 7407a5f

Browse files
committed
Patches for RcppEigen applied to Eigen 5.0.0 files
1 parent 913f4f8 commit 7407a5f

File tree

4 files changed

+57
-67
lines changed

4 files changed

+57
-67
lines changed

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: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -170,24 +170,12 @@ namespace internal {
170170
// template specializations for int and long that call the correct cholmod method
171171

172172
#define EIGEN_CHOLMOD_SPECIALIZE0(ret, name) \
173-
template <typename StorageIndex_> \
174-
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); \
180-
}
173+
template<typename _StorageIndex> inline ret cm_ ## name \
174+
(cholmod_common &Common) { return cholmod_ ## name (&Common); }
181175

182176
#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); \
190-
}
177+
template<typename _StorageIndex> inline ret cm_ ## name \
178+
(t1& a1, cholmod_common &Common) { return cholmod_ ## name (&a1, &Common); }
191179

192180
EIGEN_CHOLMOD_SPECIALIZE0(int, start)
193181
EIGEN_CHOLMOD_SPECIALIZE0(int, finish)
@@ -203,31 +191,31 @@ template <typename StorageIndex_>
203191
inline cholmod_dense* cm_solve(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
204192
return cholmod_solve(sys, &L, &B, &Common);
205193
}
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);
209-
}
194+
//template <>
195+
//inline cholmod_dense* cm_solve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_dense& B, cholmod_common& Common) {
196+
// return cholmod_l_solve(sys, &L, &B, &Common);
197+
//}
210198

211199
template <typename StorageIndex_>
212200
inline cholmod_sparse* cm_spsolve(int sys, cholmod_factor& L, cholmod_sparse& B, cholmod_common& Common) {
213201
return cholmod_spsolve(sys, &L, &B, &Common);
214202
}
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);
219-
}
203+
//template <>
204+
//inline cholmod_sparse* cm_spsolve<SuiteSparse_long>(int sys, cholmod_factor& L, cholmod_sparse& B,
205+
// cholmod_common& Common) {
206+
// return cholmod_l_spsolve(sys, &L, &B, &Common);
207+
//}
220208

221209
template <typename StorageIndex_>
222210
inline int cm_factorize_p(cholmod_sparse* A, double beta[2], StorageIndex_* fset, std::size_t fsize, cholmod_factor* L,
223211
cholmod_common& Common) {
224212
return cholmod_factorize_p(A, beta, fset, fsize, L, &Common);
225213
}
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);
230-
}
214+
//template <>
215+
//inline int cm_factorize_p<SuiteSparse_long>(cholmod_sparse* A, double beta[2], SuiteSparse_long* fset,
216+
// std::size_t fsize, cholmod_factor* L, cholmod_common& Common) {
217+
// return cholmod_l_factorize_p(A, beta, fset, fsize, L, &Common);
218+
//}
231219

232220
#undef EIGEN_CHOLMOD_SPECIALIZE0
233221
#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
@@ -170,7 +170,9 @@ class MatrixMarketIterator {
170170
m_isvalid = false;
171171
std::string curfile;
172172
curfile = m_folder + "/" + m_curs_id->d_name;
173+
#if !(defined(__sun) || defined(_AIX) || defined(__hpux) || defined(__sgi) || defined(__HAIKU__))
173174
// Discard if it is a folder
175+
#endif
174176
if (m_curs_id->d_type == DT_DIR) continue; // FIXME This may not be available on non BSD systems
175177
// struct stat st_buf;
176178
// stat (curfile.c_str(), &st_buf);

0 commit comments

Comments
 (0)