File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ struct Embedding {
116
116
117
117
// / Returns true if the embedding is approximately equal to the RHS embedding
118
118
// / within the specified tolerance.
119
- bool approximatelyEquals (const Embedding &RHS, double Tolerance = 1e-6 ) const ;
119
+ bool approximatelyEquals (const Embedding &RHS, double Tolerance = 1e-4 ) const ;
120
120
121
121
void print (raw_ostream &OS) const ;
122
122
};
Original file line number Diff line number Diff line change @@ -154,14 +154,14 @@ TEST(EmbeddingTest, ApproximatelyEqual) {
154
154
EXPECT_TRUE (E1 .approximatelyEquals (E2 )); // Diff = 1e-7
155
155
156
156
Embedding E3 = {1.00002 , 2.00002 , 3.00002 }; // Diff = 2e-5
157
- EXPECT_FALSE (E1 .approximatelyEquals (E3 ));
157
+ EXPECT_FALSE (E1 .approximatelyEquals (E3 , 1e-6 ));
158
158
EXPECT_TRUE (E1 .approximatelyEquals (E3 , 3e-5 ));
159
159
160
160
Embedding E_clearly_within = {1.0000005 , 2.0000005 , 3.0000005 }; // Diff = 5e-7
161
161
EXPECT_TRUE (E1 .approximatelyEquals (E_clearly_within));
162
162
163
163
Embedding E_clearly_outside = {1.00001 , 2.00001 , 3.00001 }; // Diff = 1e-5
164
- EXPECT_FALSE (E1 .approximatelyEquals (E_clearly_outside));
164
+ EXPECT_FALSE (E1 .approximatelyEquals (E_clearly_outside, 1e-6 ));
165
165
166
166
Embedding E4 = {1.0 , 2.0 , 3.5 }; // Large diff
167
167
EXPECT_FALSE (E1 .approximatelyEquals (E4 , 0.01 ));
You can’t perform that action at this time.
0 commit comments