31 #ifndef EIGEN_SPARSELU_MEMORY
32 #define EIGEN_SPARSELU_MEMORY
46 template<
typename Scalar>
63 template <
typename Scalar,
typename StorageIndex>
64 template <
typename VectorType>
71 if(num_expansions == 0 || keep_prev)
78 old_vec = vec.segment(0,nbElts);
81 #ifdef EIGEN_EXCEPTIONS
87 #ifdef EIGEN_EXCEPTIONS
88 catch(std::bad_alloc& )
110 alpha = (alpha + 1)/2;
112 #ifdef EIGEN_EXCEPTIONS
118 #ifdef EIGEN_EXCEPTIONS
119 catch(std::bad_alloc& )
125 if ( tries > 10)
return new_len;
127 }
while (!vec.size());
132 vec.segment(0, nbElts) = old_vec;
136 if(num_expansions) ++num_expansions;
152 template <
typename Scalar,
typename StorageIndex>
155 Index& num_expansions = glu.num_expansions;
157 glu.nzumax = glu.nzlumax = (
std::min)(fillratio * (annz+1) /
n,
m) *
n;
161 tempSpace = (2*panel_size + 4 +
LUNoMarker) *
m *
sizeof(
Index) + (panel_size + 1) *
m *
sizeof(Scalar);
164 Index estimated_size;
165 estimated_size = (5 *
n + 5) *
sizeof(
Index) + tempSpace
166 + (glu.nzlmax + glu.nzumax) *
sizeof(
Index) + (glu.nzlumax+glu.nzumax) *
sizeof(Scalar) +
n;
167 return estimated_size;
173 glu.xsup.resize(
n+1);
174 glu.supno.resize(
n+1);
175 glu.xlsub.resize(
n+1);
176 glu.xlusup.resize(
n+1);
177 glu.xusub.resize(
n+1);
182 if( (expand<ScalarVector>(glu.lusup, glu.nzlumax, 0, 0, num_expansions)<0)
183 || (expand<ScalarVector>(glu.ucol, glu.nzumax, 0, 0, num_expansions)<0)
184 || (expand<IndexVector> (glu.lsub, glu.nzlmax, 0, 0, num_expansions)<0)
185 || (expand<IndexVector> (glu.usub, glu.nzumax, 0, 1, num_expansions)<0) )
191 if (glu.nzlumax < annz )
return glu.nzlumax;
193 }
while (!glu.lusup.size() || !glu.ucol.size() || !glu.lsub.size() || !glu.usub.size());
209 template <
typename Scalar,
typename StorageIndex>
210 template <
typename VectorType>
215 failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 1, num_expansions);
217 failed_size = this->expand<VectorType>(vec, maxlen, nbElts, 0, num_expansions);
bfloat16() max(const bfloat16 &a, const bfloat16 &b)
bfloat16() min(const bfloat16 &a, const bfloat16 &b)
Index LUnumTempV(Index &m, Index &w, Index &t, Index &b)
Index LUTempSpace(Index &m, Index &w)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.