Home
last modified time | relevance | path

Searched refs:gcd (Results 1 – 25 of 115) sorted by relevance

12345

/third_party/boost/libs/integer/test/
Dgcd_noexcept_test.cpp17 …static_assert(noexcept(boost::integer::gcd(static_cast<unsigned char>(a), static_cast<unsigned cha… in test_noexcept()
20 …static_assert(noexcept(boost::integer::gcd(static_cast<char>(a), static_cast<char>(b))), "Expected… in test_noexcept()
22 …static_assert(noexcept(boost::integer::gcd(static_cast<signed char>(a), static_cast<signed char>(b… in test_noexcept()
23 …static_assert(noexcept(boost::integer::gcd(static_cast<short>(a), static_cast<short>(b))), "Expect… in test_noexcept()
24 …static_assert(noexcept(boost::integer::gcd(static_cast<unsigned short>(a), static_cast<unsigned sh… in test_noexcept()
25 …static_assert(noexcept(boost::integer::gcd(static_cast<int>(a), static_cast<int>(b))), "Expected a… in test_noexcept()
26 …static_assert(noexcept(boost::integer::gcd(static_cast<unsigned int>(a), static_cast<unsigned int>… in test_noexcept()
27 …static_assert(noexcept(boost::integer::gcd(static_cast<long>(a), static_cast<long>(b))), "Expected… in test_noexcept()
28 …static_assert(noexcept(boost::integer::gcd(static_cast<unsigned long>(a), static_cast<unsigned lon… in test_noexcept()
29 …static_assert(noexcept(boost::integer::gcd(static_cast<long long>(a), static_cast<long long>(b))),… in test_noexcept()
[all …]
Dcommon_factor_test.cpp284 using boost::integer::gcd; in gcd_int_test()
291 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(1), static_cast<T>(-1)), static_cast<T>( 1) ); in gcd_int_test()
292 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(-1), static_cast<T>(1)), static_cast<T>( 1) ); in gcd_int_test()
293 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(1), static_cast<T>(1)), static_cast<T>( 1) ); in gcd_int_test()
294 … BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(-1), static_cast<T>(-1)), static_cast<T>( 1) ); in gcd_int_test()
295 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(0), static_cast<T>(0)), static_cast<T>( 0) ); in gcd_int_test()
296 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(7), static_cast<T>(0)), static_cast<T>( 7) ); in gcd_int_test()
297 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(0), static_cast<T>(9)), static_cast<T>( 9) ); in gcd_int_test()
298 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(-7), static_cast<T>(0)), static_cast<T>( 7) ); in gcd_int_test()
299 BOOST_TEST_EQ( boost::integer::gcd(static_cast<T>(0), static_cast<T>(-9)), static_cast<T>( 9) ); in gcd_int_test()
[all …]
Dextended_euclidean_test.cpp20 using boost::integer::gcd;
33 int256_t gcdmn = gcd(m, n); in test_extended_euclidean()
36 BOOST_TEST_EQ(u.gcd, gcdmn); in test_extended_euclidean()
Dmod_inverse_test.cpp21 using boost::integer::gcd;
36 Z gcdam = gcd(a, modulus); in test_mod_inverse()
Dgcd_constexpr14_test.cpp16 constexpr const boost::int64_t k = boost::integer::gcd(i, j); in test_constexpr1()
28 constexpr const boost::uint64_t k = boost::integer::gcd(i, j); in test_constexpr2()
/third_party/boost/boost/asio/detail/
Dchrono_time_traits.hpp28 struct gcd { enum { value = gcd<v2, v1 % v2>::value }; }; argument
31 struct gcd<v1, 0> { enum { value = v1 }; }; struct
157 const int64_t num1 = period_type::num / gcd<period_type::num, Num>::value; in duration_cast()
158 const int64_t num2 = Num / gcd<period_type::num, Num>::value; in duration_cast()
160 const int64_t den1 = period_type::den / gcd<period_type::den, Den>::value; in duration_cast()
161 const int64_t den2 = Den / gcd<period_type::den, Den>::value; in duration_cast()
/third_party/boost/libs/integer/doc/modular_arithmetic/
Dextended_euclidean.qbk5 The extended Euclidean algorithm solves the integer relation /mx + ny/ = gcd(/m/, /n/) for /x/ and …
17 Z gcd;
36 int gcd = res.gcd;
39 // mx + ny = gcd(m,n) should now hold
/third_party/boost/boost/math/tools/
Dpolynomial_gcd.hpp91 using boost::integer::gcd; in reduce_to_primitive()
95 return gcd(u_cont, v_cont); in reduce_to_primitive()
171 gcd(polynomial<T> const &u, polynomial<T> const &v) in gcd() function
178 gcd(polynomial<T> const &u, polynomial<T> const &v) in gcd() function
186 gcd(polynomial<T> const &u, polynomial<T> const &v) in gcd() function
195 using boost::math::tools::gcd;
204 using boost::math::tools::gcd;
/third_party/boost/libs/multiprecision/performance/
Dperformance_test-intel-linux.log20 gmp_int 64 gcd 0.173816
40 gmp_int 128 gcd 0.43131
60 gmp_int 256 gcd 2.06855
80 gmp_int 512 gcd 4.68499
100 gmp_int 1024 gcd 10.1127
120 cpp_int 64 gcd 1.50205
140 cpp_int 128 gcd 3.36986
160 cpp_int 256 gcd 7.88882
180 cpp_int 512 gcd 19.7141
200 cpp_int 1024 gcd 53.3224
[all …]
Dperformance_test-gcc-linux.log47 gmp_int 128 gcd 0.452707
67 gmp_int 256 gcd 2.17179
87 gmp_int 512 gcd 4.86569
107 gmp_int 1024 gcd 10.2899
127 cpp_int 128 gcd 4.16823
147 cpp_int 256 gcd 8.51244
167 cpp_int 512 gcd 19.489
187 cpp_int 1024 gcd 47.7651
207 cpp_int(fixed) 128 gcd 2.87326
227 cpp_int(fixed) 256 gcd 6.68597
[all …]
/third_party/gstreamer/gstplugins_base/gst-libs/gst/video/
Dvideo.c122 int best_n, best_d, gcd; in gst_video_guess_framerate() local
173 gcd = gst_util_greatest_common_divisor (best_n, best_d); in gst_video_guess_framerate()
174 if (gcd) { in gst_video_guess_framerate()
175 best_n /= gcd; in gst_video_guess_framerate()
176 best_d /= gcd; in gst_video_guess_framerate()
/third_party/boost/libs/contract/example/features/
Dcheck_macro.cpp9 int gcd(int const a, int const b) { in gcd() function
33 BOOST_CONTRACT_CHECK(gcd(12, 28) == 4); in main()
34 BOOST_CONTRACT_CHECK(gcd(4, 14) == 2); in main()
Dcheck.cpp9 int gcd(int const a, int const b) { in gcd() function
34 BOOST_CONTRACT_ASSERT(gcd(12, 28) == 4); in main()
35 BOOST_CONTRACT_ASSERT(gcd(4, 14) == 2); in main()
/third_party/python/Lib/test/
Dtest_binop.py7 def gcd(a, b): function
45 g = gcd(den, num)
201 self.assertEqual(gcd(10, 12), 2)
202 self.assertEqual(gcd(10, 15), 5)
203 self.assertEqual(gcd(10, 11), 1)
204 self.assertEqual(gcd(100, 15), 5)
205 self.assertEqual(gcd(-10, 2), -2)
206 self.assertEqual(gcd(10, -2), 2)
207 self.assertEqual(gcd(-10, -2), -2)
210 self.assertTrue(gcd(i, j) > 0)
[all …]
/third_party/boringssl/src/crypto/fipsmodule/bn/
Dgcd_extra.c133 BIGNUM *gcd = BN_CTX_get(ctx); in bn_is_relatively_prime() local
134 if (gcd == NULL || in bn_is_relatively_prime()
135 !bn_gcd_consttime(gcd, &shift, x, y, ctx)) { in bn_is_relatively_prime()
140 if (gcd->width == 0) { in bn_is_relatively_prime()
143 BN_ULONG mask = shift | (gcd->d[0] ^ 1); in bn_is_relatively_prime()
144 for (int i = 1; i < gcd->width; i++) { in bn_is_relatively_prime()
145 mask |= gcd->d[i]; in bn_is_relatively_prime()
159 BIGNUM *gcd = BN_CTX_get(ctx); in bn_lcm_consttime() local
160 int ret = gcd != NULL && in bn_lcm_consttime()
162 bn_gcd_consttime(gcd, &shift, a, b, ctx) && in bn_lcm_consttime()
[all …]
/third_party/ffmpeg/libavutil/
Drational.c40 int64_t gcd = av_gcd(FFABS(num), FFABS(den)); in av_reduce() local
42 if (gcd) { in av_reduce()
43 num = FFABS(num) / gcd; in av_reduce()
44 den = FFABS(den) / gcd; in av_reduce()
188 int64_t gcd, lcm; in av_gcd_q() local
190 gcd = av_gcd(a.den, b.den); in av_gcd_q()
191 lcm = (a.den / gcd) * b.den; in av_gcd_q()
/third_party/boost/boost/ratio/detail/mpl/
Dgcd.hpp49 struct gcd struct
55 BOOST_MPL_AUX_LAMBDA_SUPPORT(2, gcd, (N1, N2))
58 BOOST_MPL_AUX_NA_SPEC(2, gcd)
66 : gcd<integral_c<T,n1>,integral_c<T,n2> >
/third_party/boost/libs/multiprecision/test/
Dtest_cpp_int.cpp214 BOOST_CHECK_EQUAL(mpz_int(gcd(a, b)).str(), test_type(gcd(a1, b1)).str()); in t2()
216 BOOST_CHECK_EQUAL(mpz_int(gcd(-a, b)).str(), test_type(gcd(-a1, b1)).str()); in t2()
218 BOOST_CHECK_EQUAL(mpz_int(gcd(-a, -b)).str(), test_type(gcd(-a1, -b1)).str()); in t2()
220 BOOST_CHECK_EQUAL(mpz_int(gcd(a, -b)).str(), test_type(gcd(a1, -b1)).str()); in t2()
283 BOOST_CHECK_EQUAL(mpz_int(gcd(a, si)).str(), test_type(gcd(a1, si)).str()); in t3()
284 BOOST_CHECK_EQUAL(mpz_int(gcd(si, b)).str(), test_type(gcd(si, b1)).str()); in t3()
287 BOOST_CHECK_EQUAL(mpz_int(gcd(-a, si)).str(), test_type(gcd(-a1, si)).str()); in t3()
288 BOOST_CHECK_EQUAL(mpz_int(gcd(-si, b)).str(), test_type(gcd(-si, b1)).str()); in t3()
291 BOOST_CHECK_EQUAL(mpz_int(gcd(-a, -si)).str(), test_type(gcd(-a1, -si)).str()); in t3()
292 BOOST_CHECK_EQUAL(mpz_int(gcd(-si, -b)).str(), test_type(gcd(-si, -b1)).str()); in t3()
[all …]
/third_party/boost/boost/
Drational.hpp101 IntType gcd(IntType n, IntType m) in gcd() function
104 return integer::gcd( n, m ); in gcd()
308 IntType gcd = integer::gcd(static_cast<IntType>(i), den); in operator *=() local
309 num *= i / gcd; in operator *=()
310 den /= gcd; in operator *=()
323 IntType const gcd = integer::gcd(num, static_cast<IntType>(i)); in operator /=() local
324 num /= gcd; in operator /=()
325 den *= i / gcd; in operator /=()
541 IntType g = integer::gcd(den, r_den); in operator +=()
544 g = integer::gcd(num, g); in operator +=()
[all …]
/third_party/boost/boost/integer/
Dcommon_factor_rt.hpp445 inline BOOST_CXX14_CONSTEXPR Integer gcd(Integer const &a, Integer const &b) BOOST_GCD_NOEXCEPT(Int… in gcd() function
448 …st<Integer>(0) ? gcd_detail::gcd_traits<Integer>::abs(b) : boost::integer::gcd(static_cast<Integer… in gcd()
450 …st<Integer>(0) ? gcd_detail::gcd_traits<Integer>::abs(a) : boost::integer::gcd(a, static_cast<Inte… in gcd()
465 inline BOOST_CXX14_CONSTEXPR Integer gcd(Integer const &a, Integer const &b, const Integer& c, Args… in gcd() function
467 Integer t = gcd(b, c, args...); in gcd()
468 return t == 1 ? 1 : gcd(a, t); in gcd()
481 …:numeric_limits<Integer>::is_specialized, boost::rational<Integer> >::type gcd(boost::rational<Int… in gcd() function
483 …return boost::rational<Integer>(static_cast<Integer>(gcd(a.numerator(), b.numerator())), static_ca… in gcd()
489 …tic_cast<Integer>(lcm(a.numerator(), b.numerator())), static_cast<Integer>(gcd(a.denominator(), b.… in lcm()
515 d = gcd(d, *first); in gcd_range()
[all …]
Dextended_euclidean.hpp23 Z gcd; member
67 result.gcd = u0; in extended_euclidean()
/third_party/boost/libs/integer/doc/gcd/
Dmath-gcd.qbk27 constexpr IntegerType gcd( IntegerType const &a, IntegerType const &b );
31 constexpr IntegerType gcd( IntegerType const &a, IntegerType const &b, Args const&... );
132 constexpr IntegerType boost::integer::gcd( IntegerType const &a, IntegerType const &b );
138 constexpr IntegerType gcd( IntegerType const &a, IntegerType const &b, Args const&... );
151 The boost::integer::gcd function template returns the greatest common
153 `boost::integer::gcd_range` is the iteration of the above gcd algorithm over a
155 terminates when the gcd reaches unity or the end of the range. Thus it also
157 equal to the end of the range. The variadic version of `gcd` behaves similarly
158 but does not indicate which input value caused the gcd to reach unity.
162 As with gcd, there are range and variadic versions of the function for
[all …]
/third_party/gstreamer/gstreamer/gst/
Dgstutils.c3669 gint gcd; in gst_util_double_to_fraction() local
3733 gcd = gst_util_greatest_common_divisor (N, D); in gst_util_double_to_fraction()
3734 if (gcd) { in gst_util_double_to_fraction()
3735 N /= gcd; in gst_util_double_to_fraction()
3736 D /= gcd; in gst_util_double_to_fraction()
3762 gint gcd; in gst_util_fraction_multiply() local
3776 gcd = gst_util_greatest_common_divisor (a_n, a_d); in gst_util_fraction_multiply()
3777 a_n /= gcd; in gst_util_fraction_multiply()
3778 a_d /= gcd; in gst_util_fraction_multiply()
3780 gcd = gst_util_greatest_common_divisor (b_n, b_d); in gst_util_fraction_multiply()
[all …]
/third_party/boost/boost/interprocess/detail/
Dmath_functions.hpp43 inline Integer gcd(Integer A, Integer B) in gcd() function
65 ret /= gcd(A, B); in lcm()
/third_party/boost/libs/rational/test/
Drational_test.cpp461 BOOST_CHECK_EQUAL( boost::gcd<T>( 1, -1), static_cast<T>( 1) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
462 BOOST_CHECK_EQUAL( boost::gcd<T>( -1, 1), static_cast<T>( 1) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
463 BOOST_CHECK_EQUAL( boost::gcd<T>( 1, 1), static_cast<T>( 1) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
464 BOOST_CHECK_EQUAL( boost::gcd<T>( -1, -1), static_cast<T>( 1) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
465 BOOST_CHECK_EQUAL( boost::gcd<T>( 0, 0), static_cast<T>( 0) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
466 BOOST_CHECK_EQUAL( boost::gcd<T>( 7, 0), static_cast<T>( 7) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
467 BOOST_CHECK_EQUAL( boost::gcd<T>( 0, 9), static_cast<T>( 9) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
468 BOOST_CHECK_EQUAL( boost::gcd<T>( -7, 0), static_cast<T>( 7) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
469 BOOST_CHECK_EQUAL( boost::gcd<T>( 0, -9), static_cast<T>( 9) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
470 BOOST_CHECK_EQUAL( boost::gcd<T>( 42, 30), static_cast<T>( 6) ); in BOOST_AUTO_TEST_CASE_TEMPLATE()
[all …]

12345