@@ -41,10 +41,10 @@ std::ostream& operator<<(std::ostream& out, const row_cell<T>& rc) {
41
41
}
42
42
struct empty_struct {};
43
43
typedef row_cell<empty_struct> column_cell;
44
- typedef vector <column_cell> column_strip;
44
+ typedef std_vector <column_cell> column_strip;
45
45
46
46
template <typename T>
47
- using row_strip = vector <row_cell<T>>;
47
+ using row_strip = std_vector <row_cell<T>>;
48
48
template <typename K> mpq get_denominators_lcm (const K & row) {
49
49
SASSERT (row.size () > 0 );
50
50
mpq r = mpq (1 );
@@ -79,8 +79,8 @@ class static_matrix
79
79
80
80
vector<int > m_work_vector_of_row_offsets;
81
81
indexed_vector<T> m_work_vector;
82
- vector <row_strip<T>> m_rows;
83
- vector <column_strip> m_columns;
82
+ std_vector <row_strip<T>> m_rows;
83
+ std_vector <column_strip> m_columns;
84
84
// starting inner classes
85
85
class ref {
86
86
static_matrix & m_matrix;
@@ -153,7 +153,7 @@ class static_matrix
153
153
154
154
void remove_last_column (unsigned j);
155
155
156
- void remove_element (vector <row_cell<T>> & row, row_cell<T> & elem_to_remove);
156
+ void remove_element (std_vector <row_cell<T>> & row, row_cell<T> & elem_to_remove);
157
157
158
158
void multiply_column (unsigned column, T const & alpha) {
159
159
for (auto & t : m_columns[column]) {
@@ -245,7 +245,7 @@ class static_matrix
245
245
m_stack.push (d);
246
246
}
247
247
248
- void pop_row_columns (const vector <row_cell<T>> & row) {
248
+ void pop_row_columns (const std_vector <row_cell<T>> & row) {
249
249
for (auto & c : row) {
250
250
unsigned j = c.var ();
251
251
auto & col = m_columns[j];
@@ -291,7 +291,7 @@ class static_matrix
291
291
}
292
292
}
293
293
294
- T dot_product_with_column (const vector <T> & y, unsigned j) const {
294
+ T dot_product_with_column (const std_vector <T> & y, unsigned j) const {
295
295
lp_assert (j < column_count ());
296
296
T ret = numeric_traits<T>::zero ();
297
297
for (auto & it : m_columns[j]) {
@@ -320,7 +320,7 @@ class static_matrix
320
320
}
321
321
322
322
}
323
- void fill_last_row_with_pivoting_loop_block (unsigned j, const vector <int > & basis_heading) {
323
+ void fill_last_row_with_pivoting_loop_block (unsigned j, const std_vector <int > & basis_heading) {
324
324
int row_index = basis_heading[j];
325
325
if (row_index < 0 )
326
326
return ;
@@ -352,7 +352,7 @@ class static_matrix
352
352
template <typename term>
353
353
void fill_last_row_with_pivoting (const term& row,
354
354
unsigned bj, // the index of the basis column
355
- const vector <int > & basis_heading) {
355
+ const std_vector <int > & basis_heading) {
356
356
lp_assert (row_count () > 0 );
357
357
m_work_vector.resize (column_count ());
358
358
T a;
@@ -377,7 +377,7 @@ class static_matrix
377
377
set (last_row, column_count () - 1 , one_of_type<T>());
378
378
}
379
379
380
- void copy_column_to_vector (unsigned j, vector <T> & v) const {
380
+ void copy_column_to_vector (unsigned j, std_vector <T> & v) const {
381
381
v.resize (row_count (), numeric_traits<T>::zero ());
382
382
for (auto & it : m_columns[j]) {
383
383
const T& val = get_val (it);
@@ -387,7 +387,7 @@ class static_matrix
387
387
}
388
388
389
389
template <typename L>
390
- L dot_product_with_row (unsigned row, const vector <L> & w) const {
390
+ L dot_product_with_row (unsigned row, const std_vector <L> & w) const {
391
391
L ret = zero_of_type<L>();
392
392
lp_assert (row < m_rows.size ());
393
393
for (auto & it : m_rows[row]) {
@@ -444,11 +444,12 @@ class static_matrix
444
444
};
445
445
446
446
const_iterator begin () const {
447
- return const_iterator (m_A.m_columns [m_j].begin (), m_A);
447
+ return const_iterator (m_A.m_columns [m_j].data (), m_A);
448
448
}
449
449
450
450
const_iterator end () const {
451
- return const_iterator (m_A.m_columns [m_j].end (), m_A);
451
+ const auto & column = m_A.m_columns [m_j];
452
+ return const_iterator (column.data () + column.size (), m_A);
452
453
}
453
454
};
454
455
0 commit comments