Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
How Approximation Affects Parallelization
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nathanael Sandy
How Approximation Affects Parallelization
Commits
e8f98305
Commit
e8f98305
authored
6 years ago
by
Daniel Maier
Browse files
Options
Downloads
Patches
Plain Diff
new perforation function
parent
ea982ded
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.cpp
+17
-22
17 additions, 22 deletions
main.cpp
with
17 additions
and
22 deletions
main.cpp
+
17
−
22
View file @
e8f98305
#include
<iostream>
#include
<osl/osl.h>
osl_relation_p
perforate
(
osl_relation_p
r
)
{
/* first: add one dimension */
std
::
cout
<<
"extending to "
<<
r
->
nb_output_dims
+
1
<<
"
\n
"
;
auto
n
=
osl_relation_extend_output
(
r
,
r
->
nb_output_dims
+
1
);
/* second: find new colum */
auto
row
=
n
->
m
[
n
->
nb_rows
-
1
];
int
col
=
0
;
for
(;
osl_int_get_si
(
n
->
precision
,
row
[
col
])
==
0
&&
col
<
n
->
nb_rows
;
col
++
)
{
}
/* third: set equal, iterator -1, new thing 2 */
osl_int_set_si
(
n
->
precision
,
&
row
[
col
],
2
);
osl_int_set_si
(
n
->
precision
,
&
row
[
1
],
-
1
);
osl_relation_dump
(
stdout
,
n
);
int
x
=
osl_int_get_si
(
r
->
precision
,
row
[
col
]);
std
::
cout
<<
"here is x: "
<<
x
<<
"
\n
"
;
return
n
;
void
perforate
(
osl_relation_p
rel
)
{
int
r
=
rel
->
nb_rows
;
int
c
=
rel
->
nb_columns
-
2
;
osl_relation_insert_blank_row
(
rel
,
r
);
osl_relation_insert_blank_column
(
rel
,
c
);
rel
->
nb_local_dims
++
;
auto
row
=
rel
->
m
[
r
];
osl_int_set_si
(
rel
->
precision
,
&
row
[
c
],
2
);
osl_int_set_si
(
rel
->
precision
,
&
row
[
1
],
-
1
);
osl_relation_dump
(
stdout
,
rel
);
}
int
main
()
{
...
...
@@ -38,10 +33,10 @@ int main() {
auto
d
=
s
->
domain
;
osl_relation_dump
(
stdout
,
s
->
domain
);
auto
n
=
perforate
(
d
);
s
->
domain
=
n
;
perforate
(
d
);
//
s->domain = n;
osl_relation_free
(
d
);
//
osl_relation_free(d);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment