※ 引述《stimim (qqaa)》之銘言:
: 請問一下,Spec 上說:
: Each line represents an input pattern, where its string length should
這句話的意思是說 spec 上面那個例子的每行 "represents an input pattern",
並沒有說不能有空行。
總而言之,pattern file 的 format 與 C/C++ 一樣都不用考慮 white space or
new line. 唯三的限制是:
1. 同一 pattern 的長度必須等於 number of PIs.
2. 同一 pattern 裏頭 PI assignments 之間不能有 space.
3. Patterns 只能由 0/1 組成。
: match the number of circuit inputs. The patterns, of course, should
: contain only '0' and '1' and no space character is allowed between
: the input assignments in a pattern.
: 感覺起來好像:
: 1. 不能有空白行 (Each line represents an input pattern)
: 2. 每一行的長度一定等於 PI 的數量 (string length matchs
: the number of circuit inputs)
: 3. 每一行一定只有 '0' 或 '1' (因為 2.)
: 可是,ref prog好像是用類似 "cin >> string_var" 的方式,乎略了換行和空白
: Ex1: // #PI = 1
: --------
: 1 1
: --------
: ref prog: No error
: my prog: Pattern(1 1) length(3) does not match
: Ex2:
: --------
: 1
: --------
: ref prog: No error
: my prog: Pattern() length(0) does not match
: Ex3
: --------
: 1
: --------
: ref prog: No error
: my prog: Pattern( 1) length(2) does not match
: 可以請問一下 Pattern File 的詳細格式嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.36.62.203