File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ MatrixXf BMP(MatrixXf A,MatrixXf B)
110
110
int i, j, k;
111
111
112
112
MatrixXf C (I,J);
113
- C.setZero ();
113
+ // C.setZero();
114
114
115
115
// cout<<"Ab.rows() = "<<Ab.rows()<<endl;
116
116
// cout<<"Ab.cols() = "<<Ab.cols()<<endl;
@@ -137,13 +137,17 @@ MatrixXf BMP(MatrixXf A,MatrixXf B)
137
137
for (j=0 ;j<J;j+=1 )
138
138
{
139
139
ptBj = ptB+j*K;
140
- Cij = ptCi[j];
140
+ // Cij = ptCi[j];
141
+ Cij = 0 .;
141
142
142
143
for (k=0 ;k<K;k+=1 )
143
144
{
144
- Cij += (float )__builtin_popcount (ptAi[k]&ptBj[k]);
145
+ // Cij += (float)__builtin_popcount(ptAi[k]&ptBj[k]);
146
+ // Cij += (float) 2.* __builtin_popcount(~(ptAi[k]^ptBj[k])) -32.;
147
+ Cij += (float )__builtin_popcount (~(ptAi[k]^ptBj[k]));
145
148
}
146
- ptCi[j] = Cij;
149
+ // ptCi[j] = 2* Cij -32*K + ptCi[j];
150
+ ptCi[j] = 2 * Cij -32 *K;
147
151
}
148
152
}
149
153
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ using namespace std;
7
7
8
8
float float_sign (float x)
9
9
{
10
- return (x>=0 );
10
+ // return (x>=0);
11
+ return 2 . * (x>=0 ) - 1 .;
11
12
}
12
13
13
14
int main (int argc, char * argv[])
You can’t perform that action at this time.
0 commit comments