Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
e2136f1e
Commit
e2136f1e
authored
Jul 15, 2011
by
Matthias Braun
Browse files
consistently give all lpp functions an lpp_ prefix
parent
99d05747
Changes
7
Hide whitespace changes
Inline
Side-by-side
ir/be/beblocksched.c
View file @
e2136f1e
...
...
@@ -687,7 +687,7 @@ static ir_node **create_block_schedule_ilp(ir_graph *irg, ir_exec_freq *execfreq
env
.
env
.
blockcount
=
0
;
env
.
ilpedges
=
NEW_ARR_F
(
ilp_edge_t
,
0
);
env
.
lpp
=
new_lpp
(
"blockschedule"
,
lpp_minimize
);
env
.
lpp
=
lpp_new
(
"blockschedule"
,
lpp_minimize
);
lpp_set_time_limit
(
env
.
lpp
,
20
);
lpp_set_log
(
env
.
lpp
,
stdout
);
...
...
@@ -702,7 +702,7 @@ static ir_node **create_block_schedule_ilp(ir_graph *irg, ir_exec_freq *execfreq
be_get_be_obst
(
irg
));
DEL_ARR_F
(
env
.
ilpedges
);
free
_lpp
(
env
.
lpp
);
lpp_
free
(
env
.
lpp
);
obstack_free
(
&
obst
,
NULL
);
return
block_list
;
...
...
ir/be/becopyilp.c
View file @
e2136f1e
...
...
@@ -262,6 +262,6 @@ lpp_sol_state_t ilp_go(ilp_env_t *ienv)
void
free_ilp_env
(
ilp_env_t
*
ienv
)
{
free_size_red
(
ienv
->
sr
);
free
_lpp
(
ienv
->
lp
);
lpp_
free
(
ienv
->
lp
);
free
(
ienv
);
}
ir/be/becopyilp2.c
View file @
e2136f1e
...
...
@@ -492,7 +492,7 @@ static void ilp2_build(ilp_env_t *ienv)
local_env_t
*
lenv
=
ienv
->
env
;
int
lower_bound
;
ienv
->
lp
=
new_lpp
(
ienv
->
co
->
name
,
lpp_minimize
);
ienv
->
lp
=
lpp_new
(
ienv
->
co
->
name
,
lpp_minimize
);
build_coloring_cstr
(
ienv
);
build_interference_cstr
(
ienv
);
build_affinity_cstr
(
ienv
);
...
...
ir/lpp/lpp.c
View file @
e2136f1e
...
...
@@ -67,13 +67,14 @@ static void update_stats(lpp_t *lpp)
lpp
->
density
=
(
double
)
lpp
->
n_elems
/
(
double
)(
lpp
->
cst_next
*
lpp
->
var_next
)
*
100
.
0
;
}
lpp_t
*
new_lpp
(
const
char
*
name
,
lpp_opt_t
opt_type
)
lpp_t
*
lpp_new
(
const
char
*
name
,
lpp_opt_t
opt_type
)
{
return
new_lpp
_userdef
(
name
,
opt_type
,
64
,
64
,
2
.
0
);
return
lpp_new
_userdef
(
name
,
opt_type
,
64
,
64
,
2
.
0
);
}
lpp_t
*
new_lpp_userdef
(
const
char
*
name
,
lpp_opt_t
opt_type
,
int
estimated_vars
,
int
estimated_csts
,
double
grow_factor
)
lpp_t
*
lpp_new_userdef
(
const
char
*
name
,
lpp_opt_t
opt_type
,
int
estimated_vars
,
int
estimated_csts
,
double
grow_factor
)
{
lpp_t
*
lpp
;
int
idx
;
...
...
@@ -101,13 +102,13 @@ lpp_t *new_lpp_userdef(const char *name, lpp_opt_t opt_type,
return
lpp
;
}
void
free
_lpp
_matrix
(
lpp_t
*
lpp
)
void
lpp_
free_matrix
(
lpp_t
*
lpp
)
{
del_matrix
(
lpp
->
m
);
lpp
->
m
=
NULL
;
}
void
free
_lpp
(
lpp_t
*
lpp
)
void
lpp_
free
(
lpp_t
*
lpp
)
{
obstack_free
(
&
lpp
->
obst
,
NULL
);
...
...
ir/lpp/lpp.h
View file @
e2136f1e
...
...
@@ -136,7 +136,7 @@ typedef struct _lpp_t {
* Implicit row with name "obj" is inserted.
* Implicit col with name "rhs" is inserted.
*/
lpp_t
*
new_lpp
(
const
char
*
name
,
lpp_opt_t
opt_type
);
lpp_t
*
lpp_new
(
const
char
*
name
,
lpp_opt_t
opt_type
);
/**
* Creates a new problem. Optimization type is minimize or maximize.
...
...
@@ -147,18 +147,19 @@ lpp_t *new_lpp(const char *name, lpp_opt_t opt_type);
* @param grow_factor By which factor should the problem grow, if there are
* more variables or constraints than estimated.
*/
lpp_t
*
new_lpp_userdef
(
const
char
*
name
,
lpp_opt_t
opt_type
,
int
estimated_vars
,
int
estimated_csts
,
double
grow_factor
);
lpp_t
*
lpp_new_userdef
(
const
char
*
name
,
lpp_opt_t
opt_type
,
int
estimated_vars
,
int
estimated_csts
,
double
grow_factor
);
/**
* Frees the matrix embedded in the LPP.
*/
void
free
_lpp
_matrix
(
lpp_t
*
lpp
);
void
lpp_
free_matrix
(
lpp_t
*
lpp
);
/**
* Frees all memory allocated for LPP data structure.
*/
void
free
_lpp
(
lpp_t
*
lpp
);
void
lpp_
free
(
lpp_t
*
lpp
);
/**
* @return The constant term in the objective function
...
...
ir/lpp/lpp_cplex.c
View file @
e2136f1e
...
...
@@ -169,7 +169,7 @@ static void cpx_construct(cpx_t *cpx)
chk_cpx_err
(
cpx
);
obstack_free
(
&
obst
,
NULL
);
free
_lpp
_matrix
(
lpp
);
lpp_
free_matrix
(
lpp
);
}
static
void
cpx_solve
(
cpx_t
*
cpx
)
...
...
ir/lpp/lpp_gurobi.c
View file @
e2136f1e
...
...
@@ -159,7 +159,7 @@ static void gurobi_construct(gurobi_t *grb)
check_gurobi_error
(
grb
,
error
);
obstack_free
(
&
obst
,
NULL
);
free
_lpp
_matrix
(
lpp
);
lpp_
free_matrix
(
lpp
);
}
static
void
gurobi_solve
(
gurobi_t
*
grb
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment