@@ -65,7 +65,9 @@ class FHsolver {
6565 const Int nb_; // block size
6666 static const Int default_nb_ = 128 ;
6767
68- // columns of factorisation, stored by supernode
68+ // Columns of factorisation, stored by supernode.
69+ // This memory is allocated the first time that it is used. Subsequent
70+ // factorisations reuse the same memory.
6971 std::vector<std::vector<double >> sn_columns_;
7072
7173 public:
@@ -107,34 +109,6 @@ class FHsolver {
107109 void setRegularisation (double reg_p, double reg_d);
108110};
109111
110- /* To do
111-
112- - At the moment, the format handler allocates new space for frontal each time,
113- and then moves the values into sn_columns_, with the previous space being
114- deallocated. This is very inefficient, because it causes many memory
115- allocation/deallocation. It may also cause fragmentation.
116- - Have sn_columns_ outside of factorise, into FHsolver. Then, pass it into
117- Factorise and assemble the contributions directly in place. Numeric then
118- receives a pointer to the data, so that it can access the data in the same way
119- as now. Format handler needs to assign zeros during initialization each time.
120- - In this way, the space for the columns of the factor is persistent throughout
121- the ipm iterations, no extra allocation/deallocation is needed, no copies are
122- needed. Potentially, there may be more contention of the cache lines, but this
123- is to be seen.
124-
125- - For the moment, the same can be done with cliques. No need to
126- allocate/deallocate them. They can stay allocated and be reused. This would
127- probably considerably increase the memory usage though and the stack approach
128- is to be preferred. However, the latter requires a different parallelisation.
129-
130-
131- - at the moment, I managed to keep the same interface to Numeric, but it's a bit
132- ugly. Maybe Numeric should be an object that is crested by Factorise, which
133- only contains pointers to data. Then I can just copy into the general numeric
134- object within FactorHiGHSSolver and include the pointers to the most up to
135- date data.
136- */
137-
138112} // namespace hipo
139113
140114#endif
0 commit comments