Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
solver
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
adc2019
solver
Commits
2df006bf
Commit
2df006bf
authored
Jul 10, 2019
by
kazushi.kawamura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update README.md
parent
73df8f12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
+58
-0
README.md
router/README.md
+58
-0
No files found.
router/README.md
View file @
2df006bf
# Basic router
*
A
*
ベースの配線プログラム
*
入力
*
盤面サイズ(size_x, size_y)
*
ライン数(line_num)
*
盤面情報(size_x$
`\times`
$size_yの盤面に整数を割り当て,自然数: ライン端点,-1: 配線禁止領域, 0: 配線領域)
*
出力
*
status(1: 配線成功,0: 配線失敗)
*
配線結果
*
routerに渡す盤面情報,routerから返される配線結果は1次元配列(入力が2次元配列の場合,変換が必要)
*
ハードウェア化に備えて余計な型やヘッダファイルを含むが,その辺はご了承願いたい...
### 関数呼び出し
*
関数routerの呼び出し方法は以下のサンプルコードの通り
*
routerの第5引数はシード値で指定は任意(default=12345)
```
short int size_x = 10, size_y = 10;
short int line_num = 6;
short int board[10][10], board_str[100];
/* ここで盤面情報を設定 */
// Transform "board" to "board_str"
for(int y = 0; y < size_y; y++) {
for(int x = 0; x < size_x; x++) {
int idx = y * size_x + x;
board_str[idx] = board[y][x];
}
}
int status = router(size_x, size_y, line_num, board_str, 1234567);
// Transform "board_str" to "board"
for(int y = 0; y < size_y; y++) {
for(int x = 0; x < size_x; x++) {
int idx = y * size_x + x;
board[y][x] = board_str[idx];
}
}
```
### 必要ファイル
*
router.cpp
*
router.hpp
*
ap_int.h
*
etc/ap_fixed_sim.h
*
etc/ap_int_sim.h
*
etc/ap_private.h
### パラメタ
*
router.hpp上部で以下を設定可能
|定数名|説明|
|:---|:---|
|ROUND_LIMIT|引きはがし再配線回数の上限(default: 32768, Max: 65534),小さいほど諦めが早い|
|PRINT_BOARD|配線前と配線後の盤面を表示(コメントアウトで非表示)|
|PRINT_SEARCH|配線の途中経過をすべて表示(コメントアウトで非表示)|
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