Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hqr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
hqr
Commits
b03c3220
Commit
b03c3220
authored
7 years ago
by
BOUCHERIE Raphael
Browse files
Options
Downloads
Patches
Plain Diff
memory error, 1 free is missing
parent
d90b2031
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Print tree
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
testings/testing_treedraw.c
+15
-14
15 additions, 14 deletions
testings/testing_treedraw.c
with
15 additions
and
14 deletions
testings/testing_treedraw.c
+
15
−
14
View file @
b03c3220
...
@@ -29,13 +29,13 @@ main(int argc, char ** argv)
...
@@ -29,13 +29,13 @@ main(int argc, char ** argv)
{
{
libhqr_tree_t
qrtree
;
libhqr_tree_t
qrtree
;
libhqr_tiledesc_t
matrix
;
libhqr_tiledesc_t
matrix
;
int
maxMN
,
x1
,
y1
,
x2
,
y
2
,
k
,
i
,
j
;
int
maxMN
,
absciss1
,
ordinate1
,
absciss2
,
ordinate
2
,
k
,
i
,
j
;
int
*
tiles
;
int
*
tiles
;
matrix
.
nodes
=
1
;
matrix
.
nodes
=
1
;
matrix
.
p
=
1
;
matrix
.
p
=
1
;
matrix
.
mt
=
16
;
matrix
.
mt
=
16
;
matrix
.
nt
=
4
;
matrix
.
nt
=
4
;
libhqr_hqr_init
(
&
qrtree
,
LIBHQR_QR
,
&
matrix
,
LIBHQR_
FLAT
_TREE
,
LIBHQR_FLAT_TREE
,
1
,
2
,
0
,
0
);
libhqr_hqr_init
(
&
qrtree
,
LIBHQR_QR
,
&
matrix
,
LIBHQR_
BINARY
_TREE
,
LIBHQR_FLAT_TREE
,
1
,
2
,
0
,
0
);
maxMN
=
libhqr_imax
(
matrix
.
mt
,
matrix
.
nt
);
maxMN
=
libhqr_imax
(
matrix
.
mt
,
matrix
.
nt
);
tiles
=
(
int
*
)
malloc
(
maxMN
*
sizeof
(
int
));
tiles
=
(
int
*
)
malloc
(
maxMN
*
sizeof
(
int
));
for
(
int
i
=
0
;
i
<
maxMN
;
i
++
){
for
(
int
i
=
0
;
i
<
maxMN
;
i
++
){
...
@@ -44,30 +44,31 @@ main(int argc, char ** argv)
...
@@ -44,30 +44,31 @@ main(int argc, char ** argv)
FILE
*
tree
=
fopen
(
"tree.svg"
,
"w+"
);
FILE
*
tree
=
fopen
(
"tree.svg"
,
"w+"
);
libhqr_writeheader
(
tree
);
libhqr_writeheader
(
tree
);
for
(
k
=
0
;
k
<
3
;
k
++
){
for
(
k
=
0
;
k
<
3
;
k
++
){
/* Drawing the horizontal lines */
libhqr_treewalk
(
&
qrtree
,
k
,
tiles
,
tree
);
libhqr_treewalk
(
&
qrtree
,
k
,
tiles
,
tree
);
/* Drawing the vertical lines */
/* Drawing the vertical lines */
for
(
i
=
k
;
i
<
maxMN
;
i
++
){
for
(
i
=
k
;
i
<
maxMN
;
i
++
){
if
(
i
>
0
){
if
(
i
>
0
){
x1
=
x
2
=
100
+
100
*
tiles
[
i
];
absciss1
=
absciss
2
=
100
+
100
*
tiles
[
i
];
y
1
=
100
+
100
*
i
;
ordinate
1
=
100
+
100
*
i
;
y
2
=
100
+
100
*
(
qrtree
.
currpiv
(
&
qrtree
,
k
,
i
));
ordinate
2
=
100
+
100
*
(
qrtree
.
currpiv
(
&
qrtree
,
k
,
i
));
libhqr_drawline
(
x1
,
y1
,
x2
,
y
2
,
k
,
tree
);
libhqr_drawline
(
absciss1
,
ordinate1
,
absciss2
,
ordinate
2
,
k
,
tree
);
}
}
}
}
/* Drawing the rectangles */
/* Drawing the rectangles */
for
(
i
=
k
+
1
;
i
<
maxMN
;
i
++
){
for
(
i
=
k
+
1
;
i
<
maxMN
;
i
++
){
x
1
=
75
+
100
*
tiles
[
i
];
absciss
1
=
75
+
100
*
tiles
[
i
];
y
1
=
75
+
100
*
i
;
ordinate
1
=
75
+
100
*
i
;
libhqr_drawTS
(
x1
,
y
1
,
WIDTH
,
HEIGHT
,
k
,
tree
);
libhqr_drawTS
(
absciss1
,
ordinate
1
,
WIDTH
,
HEIGHT
,
k
,
tree
);
j
=
qrtree
.
currpiv
(
&
qrtree
,
k
,
i
);
j
=
qrtree
.
currpiv
(
&
qrtree
,
k
,
i
);
x
1
=
75
+
100
*
tiles
[
i
];
absciss
1
=
75
+
100
*
tiles
[
i
];
y
1
=
75
+
100
*
j
;
ordinate
1
=
75
+
100
*
j
;
libhqr_drawTT
(
x1
,
y
1
,
WIDTH
,
HEIGHT
,
k
,
tree
);
libhqr_drawTT
(
absciss1
,
ordinate
1
,
WIDTH
,
HEIGHT
,
k
,
tree
);
}
}
}
}
libhqr_writeend
(
tree
);
libhqr_writeend
(
tree
);
free
(
tree
);
libhqr_hqr_finalize
(
&
qrtree
);
free
(
tiles
);
return
1
;
return
1
;
}
}
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