Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
codes
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
38
Issues
38
List
Boards
Labels
Milestones
Merge Requests
8
Merge Requests
8
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
codes
codes
Commits
baafab1d
Commit
baafab1d
authored
Jun 18, 2015
by
Jonathan Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose the torus ID mapping functions to modelnet
parent
a57bc2d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
0 deletions
+31
-0
codes/model-net-inspect.h
codes/model-net-inspect.h
+13
-0
src/models/networks/model-net/torus.c
src/models/networks/model-net/torus.c
+18
-0
No files found.
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
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