Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
codes
codes
Commits
baafab1d
Commit
baafab1d
authored
Jun 18, 2015
by
Jonathan Jenkins
Browse files
expose the torus ID mapping functions to modelnet
parent
a57bc2d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
codes/model-net-inspect.h
View file @
baafab1d
...
...
@@ -15,6 +15,8 @@
* annotation), while ignore_annotations is a flag controlling whether
* annotations are checked for or not - if not, then */
/** TORUS FUNCTIONS **/
/* get the dimensions of a torus configuration torus network. n and dims are
* return paramters */
void
model_net_torus_get_dims
(
...
...
@@ -23,6 +25,17 @@ void model_net_torus_get_dims(
int
*
n
,
int
const
*
const
*
dims
);
/* mapping utilities to and from linearized torus node ids */
void
model_net_torus_get_dim_id
(
int
flat_id
,
int
ndims
,
const
int
*
dim_lens
,
int
*
out_dim_ids
);
int
model_net_torus_get_flat_id
(
int
ndims
,
const
int
*
dim_lens
,
const
int
*
dim_ids
);
#endif
/* end of include guard: MODEL_NET_INSPECT_H */
...
...
src/models/networks/model-net/torus.c
View file @
baafab1d
...
...
@@ -1404,6 +1404,24 @@ void model_net_torus_get_dims(
*
dims
=
p
->
dim_length
;
}
void
model_net_torus_get_dim_id
(
int
flat_id
,
int
ndims
,
const
int
*
dim_lens
,
int
*
out_dim_ids
)
{
to_dim_id
(
flat_id
,
ndims
,
dim_lens
,
out_dim_ids
);
}
int
model_net_torus_get_flat_id
(
int
ndims
,
const
int
*
dim_lens
,
const
int
*
dim_ids
)
{
return
to_flat_id
(
ndims
,
dim_lens
,
dim_ids
);
}
/*
* Local variables:
* c-indent-level: 4
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment