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;
139 glu.nzumax = glu.nzlumax = (std::min)(fillratio * (annz + 1) / n, m) * n;
140 glu.nzlmax = (std::max)(Index(4), fillratio) * (annz + 1) / 4;
143 tempSpace = (2 * panel_size + 4 + LUNoMarker) * m *
sizeof(Index) + (panel_size + 1) * m *
sizeof(Scalar);
144 if (lwork == emptyIdxLU) {
145 Index estimated_size;
146 estimated_size = (5 * n + 5) *
sizeof(Index) + tempSpace + (glu.nzlmax + glu.nzumax) *
sizeof(Index) +
147 (glu.nzlumax + glu.nzumax) *
sizeof(Scalar) + n;
148 return estimated_size;
154 glu.xsup.resize(n + 1);
155 glu.supno.resize(n + 1);
156 glu.xlsub.resize(n + 1);
157 glu.xlusup.resize(n + 1);
158 glu.xusub.resize(n + 1);
170 if (glu.nzlumax < annz)
return glu.nzlumax;
172 }
while (!glu.lusup.size() || !glu.ucol.size() || !glu.lsub.size() || !glu.usub.size());
191 Index& num_expansions) {
198 if (failed_size)
return failed_size;