31#ifndef EIGEN_SPARSELU_MEMORY
32#define EIGEN_SPARSELU_MEMORY
37enum { LUNoMarker = 3 };
38enum {emptyIdxLU = -1};
39inline Index LUnumTempV(Index& m, Index& w, Index& t, Index& b)
41 return (std::max)(m, (t+b)*w);
44template<
typename Scalar>
45inline Index LUTempSpace(Index&m, Index& w)
47 return (2*w + 4 + LUNoMarker) * m *
sizeof(Index) + (w + 1) * m *
sizeof(Scalar);
61template <
typename Scalar,
typename StorageIndex>
62template <
typename VectorType>
72 new_len = (std::max)(length+1,Index(alpha * length));
79#ifdef EIGEN_EXCEPTIONS
85#ifdef EIGEN_EXCEPTIONS
86 catch(std::bad_alloc& )
108 alpha = (alpha + 1)/2;
109 new_len = (std::max)(length+1,Index(alpha * length));
110#ifdef EIGEN_EXCEPTIONS
116#ifdef EIGEN_EXCEPTIONS
117 catch(std::bad_alloc& )
125 }
while (!vec.size());
134 if(num_expansions) ++num_expansions;
150template <
typename Scalar,
typename StorageIndex>
153 Index& num_expansions =
glu.num_expansions;
159 tempSpace = (2*panel_size + 4 + LUNoMarker) * m *
sizeof(Index) + (panel_size + 1) * m *
sizeof(Scalar);
160 if (
lwork == emptyIdxLU)
162 Index estimated_size;
163 estimated_size = (5 * n + 5) *
sizeof(Index) +
tempSpace
164 + (
glu.nzlmax +
glu.nzumax) *
sizeof(Index) + (
glu.nzlumax+
glu.nzumax) *
sizeof(Scalar) + n;
165 return estimated_size;
171 glu.xsup.resize(n+1);
172 glu.supno.resize(n+1);
173 glu.xlsub.resize(n+1);
174 glu.xlusup.resize(n+1);
175 glu.xusub.resize(n+1);
191 }
while (!
glu.lusup.size() || !
glu.ucol.size() || !
glu.lsub.size() || !
glu.usub.size());
207template <
typename Scalar,
typename StorageIndex>
208template <
typename VectorType>
Pseudo expression representing a solving operation.
Definition Solve.h:63
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 accomodate more fill-ins.
Definition SparseLU_Memory.h:63
Definition SparseLU_Structs.h:77