@@ -55,7 +55,7 @@ void HybridHybridFormatHandler::assembleFrontal(Int i, Int j, double val) {
5555 frontal_[diag_start_[block] + ii + ldb * jj] = val;
5656}
5757
58- void HybridHybridFormatHandler::assembleFrontalMultiple (Int num,
58+ void HybridHybridFormatHandler::assembleFrontalMultiple (Int& num,
5959 const double * child,
6060 Int nc, Int child_sn,
6161 Int row, Int col, Int i,
@@ -71,8 +71,14 @@ void HybridHybridFormatHandler::assembleFrontalMultiple(Int num,
7171 Int ii = i - block * nb_;
7272 Int jj = j - block * nb_;
7373
74- callAndTime_daxpy (num, 1.0 , &child[start_block + col_ + jb * row_], jb,
75- &frontal_[diag_start_[block] + ii + ldb * jj], 1 , data_);
74+ if (num > kMinConsecutiveSums )
75+ callAndTime_daxpy (num, 1.0 , &child[start_block + col_ + jb * row_], jb,
76+ &frontal_[diag_start_[block] + ii + ldb * jj], 1 , data_);
77+ else {
78+ frontal_[diag_start_[block] + ii + ldb * jj] +=
79+ child[start_block + col_ + jb * row_];
80+ num = 1 ;
81+ }
7682}
7783
7884Int HybridHybridFormatHandler::denseFactorise (double reg_thresh) {
@@ -138,7 +144,8 @@ void HybridHybridFormatHandler::assembleClique(const double* child, Int nc,
138144
139145 // sun consecutive entries in a row.
140146 // consecutive need to be reduced, to account for edge of the block
141- const Int zeros_stored_row = std::max ((Int)0 , jb_c - (row - row_start) - 1 );
147+ const Int zeros_stored_row =
148+ std::max ((Int)0 , jb_c - (row - row_start) - 1 );
142149 Int consecutive = S_->consecutiveSums (child_sn, col);
143150 const Int left_in_child = col_end - col - zeros_stored_row;
144151 consecutive = std::min (consecutive, left_in_child);
@@ -159,11 +166,18 @@ void HybridHybridFormatHandler::assembleClique(const double* child, Int nc,
159166 const Int j_ = j - jblock * nb_;
160167 const Int64 start_block = S_->cliqueBlockStart (sn_, jblock);
161168
162- callAndTime_daxpy (consecutive, 1.0 ,
163- &child[start_block_c + col_ + jb_c * row_], 1 ,
164- &clique_ptr_[start_block + j_ + jb * i_], 1 , data_);
169+ if (consecutive > kMinConsecutiveSums ) {
170+ callAndTime_daxpy (consecutive, 1.0 ,
171+ &child[start_block_c + col_ + jb_c * row_], 1 ,
172+ &clique_ptr_[start_block + j_ + jb * i_], 1 , data_);
173+
174+ col += consecutive;
175+ } else {
176+ clique_ptr_[start_block + j_ + jb * i_] +=
177+ child[start_block_c + col_ + jb_c * row_];
165178
166- col += consecutive;
179+ col++;
180+ }
167181 }
168182 }
169183
0 commit comments