43inline Index LUnumTempV(Index& m, Index& w, Index& t, Index& b) {
return (std::max)(m, (t + b) * w); }
56 Index& num_expansions) {
60 if (num_expansions == 0 || keep_prev)
63 new_len = (std::max)(length + 1, Index(alpha * length));
66 if (nbElts > 0) old_vec = vec.segment(0, nbElts);
69#ifdef EIGEN_EXCEPTIONS
75#ifdef EIGEN_EXCEPTIONS
76 catch (std::bad_alloc&)
81 if (!num_expansions) {
93 alpha = (alpha + 1) / 2;
94 new_len = (std::max)(length + 1, Index(alpha * length));
95#ifdef EIGEN_EXCEPTIONS
101#ifdef EIGEN_EXCEPTIONS
102 catch (std::bad_alloc&)
108 if (tries > 10)
return new_len;
110 }
while (!vec.size());
114 if (nbElts > 0) vec.segment(0, nbElts) = old_vec;
117 if (num_expansions) ++num_expansions;
136 Index panel_size, GlobalLU_t& glu) {
137 Index& num_expansions = glu.num_expansions;
141 glu.nzumax = glu.nzlumax = n == 0 ? Index(1) : (std::max)(Index(1), (std::min)(fillratio * (annz + 1) / n, m) * n);
142 glu.nzlmax = (std::max)(Index(4), fillratio) * (annz + 1) / 4;
145 tempSpace = (2 * panel_size + 4 + LUNoMarker) * m *
sizeof(Index) + (panel_size + 1) * m *
sizeof(Scalar);
146 if (lwork == emptyIdxLU) {
147 Index estimated_size;
148 estimated_size = (5 * n + 5) *
sizeof(Index) + tempSpace + (glu.nzlmax + glu.nzumax) *
sizeof(Index) +
149 (glu.nzlumax + glu.nzumax) *
sizeof(Scalar) + n;
150 return estimated_size;
156 glu.xsup.resize(n + 1);
157 glu.supno.resize(n + 1);
158 glu.xlsub.resize(n + 1);
159 glu.xlusup.resize(n + 1);
160 glu.xusub.resize(n + 1);
172 if (glu.nzlumax < annz)
return glu.nzlumax;
174 }
while (!glu.lusup.size() || !glu.ucol.size() || !glu.lsub.size() || !glu.usub.size());
193 Index& num_expansions) {
200 if (failed_size)
return failed_size;