carl  24.04
Computer ARithmetic Library
SPolPair.h
Go to the documentation of this file.
1 /**
2  * @file SPolPair.h
3  * @ingroup gb
4  * @author Sebastian Junges
5  */
6 #pragma once
7 
9 
10 namespace carl
11 {
12  /**
13  * Basic spol-pair. Optimizations could be deducing p2 from the structure where it is saved, and not saving the lcm.
14  * Also sugar might be added.
15  * @param p1 index of polynomial p1
16  * @param p2 index of polynomial p2
17  * @param lcm the lcm(lt(p1), lt(p2))
18  */
19  struct SPolPair
20  {
21  SPolPair( std::size_t p1, std::size_t p2, Monomial::Arg lcm ) : mP1(p1), mP2(p2), mLcm(std::move(lcm))
22  {}
23 
24  const std::size_t mP1;
25  const std::size_t mP2;
27 
28  void print(std::ostream& os = std::cout) const
29  {
30  os << "(" << mP1 << "," << mP2 << "): " << mLcm;
31  }
32  };
33 
34  template <class Compare>
36  {
37  bool operator( )(const SPolPair& s1, const SPolPair & s2 )
38  {
39  return Compare::less( s1.mLcm, s2.mLcm );
40  }
41  };
42 }
carl is the main namespace for the library.
cln::cl_I lcm(const cln::cl_I &a, const cln::cl_I &b)
Calculate the least common multiple of two integers.
Definition: operations.h:362
Basic spol-pair.
Definition: SPolPair.h:20
const Monomial::Arg mLcm
Definition: SPolPair.h:26
SPolPair(std::size_t p1, std::size_t p2, Monomial::Arg lcm)
Definition: SPolPair.h:21
void print(std::ostream &os=std::cout) const
Definition: SPolPair.h:28
const std::size_t mP2
Definition: SPolPair.h:25
const std::size_t mP1
Definition: SPolPair.h:24
std::shared_ptr< const Monomial > Arg
Definition: Monomial.h:62