File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ struct Embedding {
117117
118118 // / Returns true if the embedding is approximately equal to the RHS embedding
119119 // / within the specified tolerance.
120- bool approximatelyEquals (const Embedding &RHS, double Tolerance = 1e-6 ) const ;
120+ LLVM_ABI bool approximatelyEquals (const Embedding &RHS,
121+ double Tolerance = 1e-4 ) const ;
121122
122123 void print (raw_ostream &OS) const ;
123124};
Original file line number Diff line number Diff line change @@ -154,14 +154,14 @@ TEST(EmbeddingTest, ApproximatelyEqual) {
154154 EXPECT_TRUE (E1 .approximatelyEquals (E2 )); // Diff = 1e-7
155155
156156 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 ));
158158 EXPECT_TRUE (E1 .approximatelyEquals (E3 , 3e-5 ));
159159
160160 Embedding E_clearly_within = {1.0000005 , 2.0000005 , 3.0000005 }; // Diff = 5e-7
161161 EXPECT_TRUE (E1 .approximatelyEquals (E_clearly_within));
162162
163163 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 ));
165165
166166 Embedding E4 = {1.0 , 2.0 , 3.5 }; // Large diff
167167 EXPECT_FALSE (E1 .approximatelyEquals (E4 , 0.01 ));
You can’t perform that action at this time.
0 commit comments