Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
group-connectivity-pub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
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
Radek Hušek
group-connectivity-pub
Commits
f775bba0
Commit
f775bba0
authored
9 years ago
by
Radek Hušek
Committed by
Radek Hušek
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Split ring definitions into separate file
parent
ec94a288
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
group-connectivity.h
+2
-20
2 additions, 20 deletions
group-connectivity.h
rings.h
+24
-0
24 additions, 0 deletions
rings.h
with
27 additions
and
21 deletions
Makefile
+
1
−
1
View file @
f775bba0
default
:
groupConnectivity.so clean_obj
groupConnectivity.so
:
groupConnectivity.pyx group-connectivity.h setup.py compileTimeOptions.h parmap.py
groupConnectivity.so
:
groupConnectivity.pyx group-connectivity.h setup.py compileTimeOptions.h
rings.h
parmap.py
python setup.py build_ext
cp
build/lib
*
/groupConnectivity.so .
...
...
This diff is collapsed.
Click to expand it.
group-connectivity.h
+
2
−
20
View file @
f775bba0
#ifndef __GROUP_CONNECTIVITY_H__
#define __GROUP_CONNECTIVITY_H__
#include
<vector>
#include
"compileTimeOptions.h"
#include
"rings.h"
namespace
Ring
{
#define MakeRing(Name, Size, Plus, Negate, Multiply, One) \
template < typename T_ > struct Name { \
typedef T_ T; \
enum { size = Size }; \
static T plus(T a, T b) { return Plus; } \
static T negate(T a) { return Negate; } \
static T multiply(T a, T b) { return Multiply; } \
static const T one = One; \
static const T zero = 0; \
}
MakeRing
(
Z5
,
5
,
(
a
+
b
)
%
5
,
(
5
-
a
)
%
5
,
(
a
*
b
)
%
5
,
1
);
MakeRing
(
Z4
,
4
,
(
a
+
b
)
&
3
,
(
4
-
a
)
&
3
,
(
a
*
b
)
&
3
,
1
);
MakeRing
(
Z2_2
,
4
,
a
^
b
,
a
,
a
&
b
,
3
);
}
#include
<vector>
typedef
int
EdgeId
;
typedef
int
DirectedEdgeId
;
...
...
This diff is collapsed.
Click to expand it.
rings.h
0 → 100644
+
24
−
0
View file @
f775bba0
#ifndef __RINGS_H__
#define __RINGS_H__
namespace
Ring
{
#define MakeRing(Name, Size, Plus, Negate, Multiply, One) \
template < typename T_ > struct Name { \
typedef T_ T; \
enum { size = Size }; \
static T plus(T a, T b) { return Plus; } \
static T negate(T a) { return Negate; } \
static T multiply(T a, T b) { return Multiply; } \
static const T one = One; \
static const T zero = 0; \
}
MakeRing
(
Z5
,
5
,
(
a
+
b
)
%
5
,
(
5
-
a
)
%
5
,
(
a
*
b
)
%
5
,
1
);
MakeRing
(
Z4
,
4
,
(
a
+
b
)
&
3
,
(
4
-
a
)
&
3
,
(
a
*
b
)
&
3
,
1
);
MakeRing
(
Z2_2
,
4
,
a
^
b
,
a
,
a
&
b
,
3
);
}
#endif
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