pbqp_matrix *old_matrix;
pbqp_matrix *new_matrix;
pbqp_node *other_node;
+ vector *other_vec;
unsigned other_len;
unsigned other_index;
unsigned tgt_index;
other_len = old_matrix->cols;
}
assert(other_node);
+ other_vec = other_node->costs;
new_matrix = pbqp_matrix_alloc(pbqp, tgt_len, other_len);
for (tgt_index = 0; tgt_index < tgt_len; ++tgt_index) {
unsigned src_index = mapping[tgt_index];
+ if (tgt_vec->entries[tgt_index].data == INF_COSTS)
+ continue;
+
for (other_index = 0; other_index < other_len; ++other_index) {
+ if (other_vec->entries[other_index].data == INF_COSTS)
+ continue;
+
new_matrix->entries[tgt_index*other_len+other_index] = old_matrix->entries[other_index*src_len+src_index];
}
}
for (tgt_index = 0; tgt_index < tgt_len; ++tgt_index) {
unsigned src_index = mapping[tgt_index];
+ if (tgt_vec->entries[tgt_index].data == INF_COSTS)
+ continue;
+
for (other_index = 0; other_index < other_len; ++other_index) {
+ if (other_vec->entries[other_index].data == INF_COSTS)
+ continue;
+
new_matrix->entries[tgt_index*other_len+other_index] = old_matrix->entries[src_index*other_len+other_index];
}
}
pbqp_matrix *old_matrix;
pbqp_matrix *new_matrix;
pbqp_node *other_node;
+ vector *other_vec;
unsigned other_len;
unsigned other_index;
unsigned src_index;
other_len = old_matrix->cols;
}
assert(other_node);
+ other_vec = other_node->costs;
new_matrix = pbqp_matrix_alloc(pbqp, src_len, other_len);
for (src_index = 0; src_index < src_len; ++src_index) {
unsigned tgt_index = mapping[src_index];
+ if (src_vec->entries[src_index].data == INF_COSTS)
+ continue;
+
for (other_index = 0; other_index < other_len; ++other_index) {
+ if (other_vec->entries[other_index].data == INF_COSTS)
+ continue;
+
new_matrix->entries[src_index*other_len+other_index] = old_matrix->entries[other_index*tgt_len+tgt_index];
}
}
for (src_index = 0; src_index < src_len; ++src_index) {
unsigned tgt_index = mapping[src_index];
+ if (src_vec->entries[src_index].data == INF_COSTS)
+ continue;
+
for (other_index = 0; other_index < other_len; ++other_index) {
+ if (other_vec->entries[other_index].data == INF_COSTS)
+ continue;
+
new_matrix->entries[src_index*other_len+other_index] = old_matrix->entries[tgt_index*other_len+other_index];
}
}