ruby-eigen 0.0.11.pre1 → 0.0.11.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/eigen/eigen3/Eigen/src/Core/util/Memory.h +3 -2
- data/ext/eigen/eigen3/Eigen/src/SparseCore/SparseMatrix.h +4 -0
- data/ext/eigen/eigen_wrap.cxx +11338 -3570
- data/ext/eigen/rubyeigen_algo.h +13 -0
- data/ext/eigen/rubyeigen_algo_base.h +7 -0
- data/ext/eigen/rubyeigen_base.h +34 -0
- data/ext/eigen/rubyeigen_except.h +15 -0
- data/ext/eigen/rubyeigen_gc.h +5 -0
- data/ext/eigen/rubyeigen_gc.hpp +26 -0
- data/lib/eigen.rb +17 -0
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71cf8652431e0c12cbc9dca81d95bad6910bcbcd
|
4
|
+
data.tar.gz: faeef922a3c18a650dca92cdfa9666ccf67d883f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ad2d2cc715c66939ae5b41b8bd908bb7858a1b0c3026725b73ae3bba3d8b122f229bf15f19b8af116a68bf08e900c6884e568baaf485b3a873ba6469a86b059
|
7
|
+
data.tar.gz: 791be254a5cddba6c7d83750849d2921dbe380b3e28d5ccd4e1ee4ef34ee7b7576bee185334ab8690789c3f456924ed01f708be566543ad8ec6943429ea80d46
|
@@ -103,6 +103,7 @@ inline void throw_std_bad_alloc()
|
|
103
103
|
*/
|
104
104
|
inline void* handmade_aligned_malloc(std::size_t size)
|
105
105
|
{
|
106
|
+
rubyeigen_gc_add_count(size);
|
106
107
|
void *original = std::malloc(size+16);
|
107
108
|
if (original == 0) return 0;
|
108
109
|
void *aligned = reinterpret_cast<void*>((reinterpret_cast<std::size_t>(original) & ~(std::size_t(15))) + 16);
|
@@ -212,7 +213,7 @@ inline void check_that_malloc_is_allowed()
|
|
212
213
|
inline void* aligned_malloc(size_t size)
|
213
214
|
{
|
214
215
|
check_that_malloc_is_allowed();
|
215
|
-
|
216
|
+
rubyeigen_gc_add_count(size);
|
216
217
|
void *result;
|
217
218
|
#if !EIGEN_ALIGN
|
218
219
|
result = std::malloc(size);
|
@@ -304,7 +305,7 @@ template<bool Align> inline void* conditional_aligned_malloc(size_t size)
|
|
304
305
|
template<> inline void* conditional_aligned_malloc<false>(size_t size)
|
305
306
|
{
|
306
307
|
check_that_malloc_is_allowed();
|
307
|
-
|
308
|
+
rubyeigen_gc_add_count(size);
|
308
309
|
void *result = std::malloc(size);
|
309
310
|
if(!result && size)
|
310
311
|
throw_std_bad_alloc();
|
@@ -287,6 +287,7 @@ class SparseMatrix
|
|
287
287
|
template<class SizesType>
|
288
288
|
inline void reserveInnerVectors(const SizesType& reserveSizes)
|
289
289
|
{
|
290
|
+
rubyeigen_gc_add_count(m_outerSize * sizeof(Index));
|
290
291
|
if(isCompressed())
|
291
292
|
{
|
292
293
|
std::size_t totalReserveSize = 0;
|
@@ -479,6 +480,7 @@ class SparseMatrix
|
|
479
480
|
{
|
480
481
|
if(m_innerNonZeros != 0)
|
481
482
|
return;
|
483
|
+
rubyeigen_gc_add_count(m_outerSize * sizeof(Index));
|
482
484
|
m_innerNonZeros = static_cast<Index*>(std::malloc(m_outerSize * sizeof(Index)));
|
483
485
|
for (Index i = 0; i < m_outerSize; i++)
|
484
486
|
{
|
@@ -555,6 +557,7 @@ class SparseMatrix
|
|
555
557
|
else if (innerChange < 0)
|
556
558
|
{
|
557
559
|
// Inner size decreased: allocate a new m_innerNonZeros
|
560
|
+
rubyeigen_gc_add_count(m_outerSize * sizeof(Index));
|
558
561
|
m_innerNonZeros = static_cast<Index*>(std::malloc((m_outerSize+outerChange+1) * sizeof(Index)));
|
559
562
|
if (!m_innerNonZeros) internal::throw_std_bad_alloc();
|
560
563
|
for(Index i = 0; i < m_outerSize; i++)
|
@@ -601,6 +604,7 @@ class SparseMatrix
|
|
601
604
|
if (m_outerSize != outerSize || m_outerSize==0)
|
602
605
|
{
|
603
606
|
std::free(m_outerIndex);
|
607
|
+
rubyeigen_gc_add_count(outerSize * sizeof(Index));
|
604
608
|
m_outerIndex = static_cast<Index*>(std::malloc((outerSize + 1) * sizeof(Index)));
|
605
609
|
if (!m_outerIndex) internal::throw_std_bad_alloc();
|
606
610
|
|