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
7f965afc
Commit
7f965afc
authored
8 years ago
by
Raphael Boucherie
Committed by
BOUCHERIE Raphael
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added test file for drawing tree, anf functions to the library
parent
ecbb5725
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Treewalk
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/libhqr.h
+10
-0
10 additions, 0 deletions
include/libhqr.h
src/treedraw.c
+13
-3
13 additions, 3 deletions
src/treedraw.c
testings/testing_treedraw.c
+33
-0
33 additions, 0 deletions
testings/testing_treedraw.c
with
56 additions
and
3 deletions
include/libhqr.h
+
10
−
0
View file @
7f965afc
...
...
@@ -195,6 +195,16 @@ void libhqr_hqr_finalize( libhqr_tree_t *qrtree );
void
libhqr_treewalk
(
const
libhqr_tree_t
*
qrtree
,
int
k
);
/*
* function for treedraw
*/
void
libhqr_writeheader
();
void
libhqr_writecss
();
void
libhqr_writeend
();
void
libhqr_drawTT
(
int
x
,
int
y
,
int
k
);
void
libhqr_drawTS
(
int
x
,
int
y
);
void
libhqr_drawline
(
int
x1
,
int
y1
,
int
x2
,
int
y2
);
/*
* Debugging functions
*/
...
...
This diff is collapsed.
Click to expand it.
src/treedraw.c
+
13
−
3
View file @
7f965afc
...
...
@@ -32,7 +32,7 @@
void
libhqr_writeheader
(){
FILE
*
tree
=
fopen
(
"
../
tree.
xml
"
,
"w+"
);
FILE
*
tree
=
fopen
(
"tree.
svg
"
,
"w+"
);
if
(
fprintf
(
tree
,
"<?xml version=
\"
1.0
\"
standalone=
\"
no
\"
?>
\n
"
)
<
0
)
return
;
if
(
fprintf
(
tree
,
"<!DOCTYPE svg PUBLIC
\"
-//W3C//DTD SVG 1.1//EN
\"
\n
\"
http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd
\"
>
\n
"
)
<
0
)
return
;
if
(
fprintf
(
tree
,
"<svg width=
\"
2000
\"
height=
\"
2000
\"
version=
\"
1.1
\"
\n
xmlns=
\"
http://www.w3.org/2000/svg
\"
>"
)
<
0
)
return
;
...
...
@@ -41,11 +41,21 @@ void libhqr_writeheader(){
void
libhqr_writecss
();
void
libhqr_drawTT
(
int
x
,
int
y
,
int
k
){
FILE
*
tree
=
fopen
(
"
../
tree.
xml
"
,
"
w
+"
);
FILE
*
tree
=
fopen
(
"tree.
svg
"
,
"
a
+"
);
if
(
fprintf
(
tree
,
"<rect x=
\"
50
\"
y=
\"
50
\"
width=
\"
50
\"
height=
\"
50
\"
fill=
\"
red
\"
/>"
)
<
0
)
return
;
}
void
libhqr_drawTS
(
int
x
,
int
y
){
FILE
*
tree
=
fopen
(
"tree.svg"
,
"a+"
);
if
(
fprintf
(
tree
,
"<rect x=
\"
40
\"
y=
\"
40
\"
width=
\"
50
\"
height=
\"
50
\"
/>"
)
<
0
)
return
;
}
void
libhqr_drawline
(
int
x1
,
int
y1
,
int
x2
,
int
y2
){
FILE
*
tree
=
fopen
(
"
../
tree.
xml
"
,
"
w
+"
);
FILE
*
tree
=
fopen
(
"tree.
svg
"
,
"
a
+"
);
if
(
fprintf
(
tree
,
"<line x1=
\"
20
\"
y1=
\"
80
\"
x2=
\"
130
\"
y2=
\"
200
\"
/>"
)
<
0
)
return
;
}
void
libhqr_writeend
(){
FILE
*
tree
=
fopen
(
"tree.svg"
,
"a+"
);
if
(
fprintf
(
tree
,
"<
\\
svg>"
)
<
0
)
return
;
}
This diff is collapsed.
Click to expand it.
testings/testing_treedraw.c
0 → 100644
+
33
−
0
View file @
7f965afc
/**
*
* @file testting_treedraw.c
*
* PaStiX symbol structure routines
*
* @copyright 2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
* Univ. Bordeaux. All rights reserved.
*
* @version 1.0.0
* @author Raphael Boucherie
* @author Matthieu Faverge
* @date 2017-04-04
*
**/
#include
"libhqr.h"
#include
<stdlib.h>
#include
<stdio.h>
#include
<string.h>
#include
<math.h>
int
main
(
int
argc
,
char
**
argv
)
{
libhqr_writeheader
();
libhqr_drawTT
(
50
,
50
,
1
);
libhqr_drawTS
(
40
,
40
);
libhqr_drawline
(
50
,
50
,
40
,
40
);
libhqr_writeend
();
}
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