Skip to content

Commit 5596fb1

Browse files
committed
Remove branches in cvector init
1 parent 1e86f97 commit 5596fb1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

verify/poly/wildcard.test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,24 @@ auto is_integer(auto a) {
4545
}
4646

4747
string matches(string const& A, string const& B, char wild = '*') {
48-
static const int sigma = 26;
49-
static point project[2][sigma];
48+
static point project[2][128];
5049
static bool init = false;
5150
if(!init) {
5251
init = true;
53-
for(int i = 0; i < sigma; i++) {
52+
for(int i = 0; i < 128; i++) {
5453
project[0][i] = cp_algo::polar(1., (ftype)cp_algo::random::rng());
5554
project[1][i] = conj(project[0][i]);
5655
}
5756
}
57+
project[0][wild] = project[1][wild] = 0;
5858
vector<cvector> P;
5959
P.emplace_back(size(A));
6060
P.emplace_back(size(A));
6161
for(auto [i, c]: A | views::enumerate) {
62-
P[0].set(i, (c != wild) * project[0][c - 'a']);
62+
P[0].set(i, project[0][c]);
6363
}
6464
for(auto [i, c]: B | views::reverse | views::enumerate) {
65-
P[1].set(i, (c != wild) * project[1][c - 'a']);
65+
P[1].set(i, project[1][c]);
6666
}
6767
cp_algo::checkpoint("cvector fill");
6868
semicorr(P[0], P[1]);

0 commit comments

Comments
 (0)