427 {
430
431 const Index size = (std::min)(rows,cols);
432
433
434 if(size<=16)
435 {
436 return unblocked_lu(lu, row_transpositions, nb_transpositions);
437 }
438
439
440
442 {
444 blockSize = (blockSize/16)*16;
445 blockSize = (std::min)((std::max)(blockSize,
Index(8)), maxBlockSize);
446 }
447
448 nb_transpositions = 0;
449 Index first_zero_pivot = -1;
451 {
452 Index bs = (std::min)(size-k,blockSize);
455
456
457
458
459
466
467 PivIndex nb_transpositions_in_panel;
468
469
471 row_transpositions+k, nb_transpositions_in_panel, 16);
472 if(ret>=0 && first_zero_pivot==-1)
473 first_zero_pivot = k+ret;
474
475 nb_transpositions += nb_transpositions_in_panel;
476
477 for(
Index i=k; i<k+bs; ++i)
478 {
479 Index piv = (row_transpositions[i] += internal::convert_index<PivIndex>(k));
480 A_0.row(i).swap(A_0.row(piv));
481 }
482
483 if(trows)
484 {
485
486 for(
Index i=k;i<k+bs; ++i)
487 A_2.row(i).swap(A_2.row(row_transpositions[i]));
488
489
490 A11.template triangularView<UnitLower>().solveInPlace(A12);
491
492 A22.noalias() -= A21 * A12;
493 }
494 }
495 return first_zero_pivot;
496 }
@ RowMajor
Definition Constants.h:322
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
size_t cols(const T &raster)
Definition MarchingSquares.hpp:60
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55
static Index blocked_lu(Index rows, Index cols, Scalar *lu_data, Index luStride, PivIndex *row_transpositions, PivIndex &nb_transpositions, Index maxBlockSize=256)
Definition PartialPivLU.h:426
static Index unblocked_lu(MatrixType &lu, PivIndex *row_transpositions, PivIndex &nb_transpositions)
Definition PartialPivLU.h:365
Map< Matrix< Scalar, Dynamic, Dynamic, StorageOrder > > MapLU
Definition PartialPivLU.h:350
Block< MatrixType, Dynamic, Dynamic > BlockType
Definition PartialPivLU.h:352
Block< MapLU, Dynamic, Dynamic > MatrixType
Definition PartialPivLU.h:351