- Notifications
You must be signed in to change notification settings - Fork0
A Go utility for checking and rendering sorting networks
License
NotificationsYou must be signed in to change notification settings
brianpursley/sorting-network-go
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A Go utility for checking and rendering sorting networks
Adapted fromthis Python version
You specify a comparison network as a comma-separated list of comparators, where each comparator is formated likeX:Y whereX andY are zero-based input indices. For example:0:1,2:3,0:2,1:3,1:2
$ go run cmd/sortingnetwork/sortingnetwork.go -input examples/16-input.cn -check
Output:
It is a sorting network!$echo 0:1,2:3,0:2,1:3,1:2| go run cmd/sortingnetwork/sortingnetwork.go -check
Output:
It is a sorting network!$echo 0:1,2:3,0:2,1:3| go run cmd/sortingnetwork/sortingnetwork.go -check
Output:
It is not a sorting network.$ go run cmd/sortingnetwork/sortingnetwork.go -input examples/4-input.cn -svg> examples/4-input.svgYou can use rsvg-convert to convert the output from SVG to some other format, like PNG. rsvg-convert can be installed by usingsudo apt-get install librsvg2-bin on Ubuntu.
$ go run cmd/sortingnetwork/sortingnetwork.go -input examples/4-input.cn -svg| rsvg-convert> examples/4-input.png
0:1,2:30:2,1:31:20:1,3:42:42:3,1:40:30:2,1:31:20:1,2:3,4:5,6:7,8:9,10:11,12:13,14:150:2,1:3,4:6,5:7,8:10,9:11,12:14,13:150:4,1:5,2:6,3:7,8:12,9:13,10:14,11:150:8,1:9,2:10,3:11,4:12,5:13,6:14,7:155:10,6:9,3:12,13:14,7:11,1:2,4:81:4,7:13,2:8,11:142:4,5:6,9:10,11:13,3:8,7:126:8,10:12,3:5,7:93:4,5:6,7:8,9:10,11:126:7,8:9About
A Go utility for checking and rendering sorting networks
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.


