Clear GCC unknown pragma warning
parent
d112d4d1b0
commit
fc13431939
18
nbtheory.cpp
18
nbtheory.cpp
|
|
@ -646,6 +646,7 @@ bool SolveModularQuadraticEquation(Integer &r1, Integer &r2, const Integer &a, c
|
|||
Integer ModularRoot(const Integer &a, const Integer &dp, const Integer &dq,
|
||||
const Integer &p, const Integer &q, const Integer &u)
|
||||
{
|
||||
#ifdef _OPENMP
|
||||
Integer p2, q2;
|
||||
#pragma omp parallel
|
||||
#pragma omp sections
|
||||
|
|
@ -655,6 +656,11 @@ Integer ModularRoot(const Integer &a, const Integer &dp, const Integer &dq,
|
|||
#pragma omp section
|
||||
q2 = ModularExponentiation((a % q), dq, q);
|
||||
}
|
||||
#else
|
||||
const Integer p2 = ModularExponentiation((a % p), dp, p);
|
||||
const Integer q2 = ModularExponentiation((a % q), dq, q);
|
||||
#endif
|
||||
|
||||
return CRT(p2, p, q2, q, u);
|
||||
}
|
||||
|
||||
|
|
@ -997,7 +1003,9 @@ Integer Lucas(const Integer &n, const Integer &P, const Integer &modulus)
|
|||
|
||||
Integer InverseLucas(const Integer &e, const Integer &m, const Integer &p, const Integer &q, const Integer &u)
|
||||
{
|
||||
Integer d = (m*m-4);
|
||||
const Integer d = (m*m-4);
|
||||
|
||||
#ifdef _OPENMP
|
||||
Integer p2, q2;
|
||||
#pragma omp parallel
|
||||
#pragma omp sections
|
||||
|
|
@ -1013,6 +1021,14 @@ Integer InverseLucas(const Integer &e, const Integer &m, const Integer &p, const
|
|||
q2 = Lucas(EuclideanMultiplicativeInverse(e,q2), m, q);
|
||||
}
|
||||
}
|
||||
#else
|
||||
const Integer t1 = p-Jacobi(d,p);
|
||||
const Integer p2 = Lucas(EuclideanMultiplicativeInverse(e,t1), m, p);
|
||||
|
||||
const Integer t2 = q-Jacobi(d,q);
|
||||
const Integer q2 = Lucas(EuclideanMultiplicativeInverse(e,t2), m, q);
|
||||
#endif
|
||||
|
||||
return CRT(p2, p, q2, q, u);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue