Skip to content
Snippets Groups Projects
Commit e8f98305 authored by Daniel Maier's avatar Daniel Maier
Browse files

new perforation function

parent ea982ded
No related branches found
No related tags found
No related merge requests found
#include <iostream> #include <iostream>
#include <osl/osl.h> #include <osl/osl.h>
osl_relation_p void
perforate(osl_relation_p r) { perforate(osl_relation_p rel) {
/* first: add one dimension */ int r = rel->nb_rows;
std::cout << "extending to " << r->nb_output_dims+1 << "\n"; int c = rel->nb_columns-2;
auto n = osl_relation_extend_output(r, r->nb_output_dims+1);
osl_relation_insert_blank_row(rel, r);
/* second: find new colum */ osl_relation_insert_blank_column(rel, c);
auto row = n->m[n->nb_rows-1]; rel->nb_local_dims++;
int col = 0;
for(; osl_int_get_si(n->precision, row[col]) == 0 && col < n->nb_rows; col++) { } auto row = rel->m[r];
osl_int_set_si(rel->precision, &row[c], 2);
/* third: set equal, iterator -1, new thing 2 */ osl_int_set_si(rel->precision, &row[1], -1);
osl_int_set_si(n->precision, &row[col], 2);
osl_int_set_si(n->precision, &row[1], -1); osl_relation_dump(stdout, rel);
osl_relation_dump(stdout, n);
int x = osl_int_get_si(r->precision, row[col]);
std::cout << "here is x: " << x << "\n";
return n;
} }
int main() { int main() {
...@@ -38,10 +33,10 @@ int main() { ...@@ -38,10 +33,10 @@ int main() {
auto d = s->domain; auto d = s->domain;
osl_relation_dump(stdout, s->domain); osl_relation_dump(stdout, s->domain);
auto n = perforate(d); perforate(d);
s->domain = n; //s->domain = n;
osl_relation_free(d); //osl_relation_free(d);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment