31#ifndef EIGEN_SPARSELU_MEMORY
32#define EIGEN_SPARSELU_MEMORY
44template<
typename Scalar>
47 return (2*w + 4 +
LUNoMarker) * m *
sizeof(
Index) + (w + 1) * m *
sizeof(Scalar);
61template <
typename Scalar,
typename StorageIndex>
62template <
typename VectorType>
69 if(num_expansions == 0 || keep_prev)
76 old_vec = vec.segment(0,nbElts);
79#ifdef EIGEN_EXCEPTIONS
85#ifdef EIGEN_EXCEPTIONS
86 catch(std::bad_alloc& )
108 alpha = (alpha + 1)/2;
110#ifdef EIGEN_EXCEPTIONS
116#ifdef EIGEN_EXCEPTIONS
117 catch(std::bad_alloc& )
123 if ( tries > 10)
return new_len;
125 }
while (!vec.size());
130 vec.segment(0, nbElts) = old_vec;
134 if(num_expansions) ++num_expansions;
150template <
typename Scalar,
typename StorageIndex>
159 tempSpace = (2*panel_size + 4 +
LUNoMarker) * m *
sizeof(
Index) + (panel_size + 1) * m *
sizeof(Scalar);
162 Index estimated_size;
163 estimated_size = (5 * n + 5) *
sizeof(
Index) + tempSpace
165 return estimated_size;
171 glu.
xsup.resize(n+1);
172 glu.
supno.resize(n+1);
173 glu.
xlsub.resize(n+1);
175 glu.
xusub.resize(n+1);
180 if( (expand<ScalarVector>(glu.
lusup, glu.
nzlumax, 0, 0, num_expansions)<0)
181 || (expand<ScalarVector>(glu.
ucol, glu.
nzumax, 0, 0, num_expansions)<0)
182 || (expand<IndexVector> (glu.
lsub, glu.
nzlmax, 0, 0, num_expansions)<0)
183 || (expand<IndexVector> (glu.
usub, glu.
nzumax, 0, 1, num_expansions)<0) )
191 }
while (!glu.
lusup.size() || !glu.
ucol.size() || !glu.
lsub.size() || !glu.
usub.size());
207template <
typename Scalar,
typename StorageIndex>
208template <
typename VectorType>
213 failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 1, num_expansions);
215 failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 0, num_expansions);
Index memXpand(VectorType &vec, Index &maxlen, Index nbElts, MemType memtype, Index &num_expansions)
Expand the existing storage.
Definition: SparseLU_Memory.h:209
Index memInit(Index m, Index n, Index annz, Index lwork, Index fillratio, Index panel_size, GlobalLU_t &glu)
Allocate various working space for the numerical factorization phase.
Definition: SparseLU_Memory.h:151
Index expand(VectorType &vec, Index &length, Index nbElts, Index keep_prev, Index &num_expansions)
Expand the existing storage to accommodate more fill-ins.
Definition: SparseLU_Memory.h:63
constexpr common_t< T1, T2 > max(const T1 x, const T2 y) noexcept
Compile-time pairwise maximum function.
Definition: max.hpp:35
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
Index LUnumTempV(Index &m, Index &w, Index &t, Index &b)
Definition: SparseLU_Memory.h:39
Index LUTempSpace(Index &m, Index &w)
Definition: SparseLU_Memory.h:45
@ emptyIdxLU
Definition: SparseLU_Memory.h:38
MemType
Definition: SparseLU_Structs.h:74
@ USUB
Definition: SparseLU_Structs.h:74
@ LUNoMarker
Definition: SparseLU_Memory.h:37
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50
Definition: SparseLU_Structs.h:77
IndexVector usub
Definition: SparseLU_Structs.h:88
Index nzlmax
Definition: SparseLU_Structs.h:85
IndexVector xsup
Definition: SparseLU_Structs.h:79
Index nzumax
Definition: SparseLU_Structs.h:90
Index num_expansions
Definition: SparseLU_Structs.h:92
IndexVector xlusup
Definition: SparseLU_Structs.h:83
IndexVector supno
Definition: SparseLU_Structs.h:80
IndexVector lsub
Definition: SparseLU_Structs.h:82
IndexVector xusub
Definition: SparseLU_Structs.h:89
Index nzlumax
Definition: SparseLU_Structs.h:86
IndexVector xlsub
Definition: SparseLU_Structs.h:84
ScalarVector lusup
Definition: SparseLU_Structs.h:81
ScalarVector ucol
Definition: SparseLU_Structs.h:87