Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xin Wang
codes-dev
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 @@
...
@@ -15,6 +15,8 @@
* annotation), while ignore_annotations is a flag controlling whether
* annotation), while ignore_annotations is a flag controlling whether
* annotations are checked for or not - if not, then */
* annotations are checked for or not - if not, then */
/** TORUS FUNCTIONS **/
/* get the dimensions of a torus configuration torus network. n and dims are
/* get the dimensions of a torus configuration torus network. n and dims are
* return paramters */
* return paramters */
void
model_net_torus_get_dims
(
void
model_net_torus_get_dims
(
...
@@ -23,6 +25,17 @@ void model_net_torus_get_dims(
...
@@ -23,6 +25,17 @@ void model_net_torus_get_dims(
int
*
n
,
int
*
n
,
int
const
*
const
*
dims
);
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 */
#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(
...
@@ -1404,6 +1404,24 @@ void model_net_torus_get_dims(
*
dims
=
p
->
dim_length
;
*
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:
* Local variables:
* c-indent-level: 4
* c-indent-level: 4
...
...
Write
Preview
Markdown
is supported
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