5 #include <carl-arith/ran/ran.h>
14 template<
typename Number>
20 std::vector<carl::IntRepRealAlgebraicNumber<Number>>
mNumbers;
59 std::size_t
dim()
const {
68 assert(componentCount <=
mNumbers.size());
69 std::vector<carl::IntRepRealAlgebraicNumber<Number>>
copy(
88 const carl::IntRepRealAlgebraicNumber<Number>&
operator[](std::size_t index)
const {
96 carl::IntRepRealAlgebraicNumber<Number>&
operator[](std::size_t index) {
105 template<
typename Number>
107 if (lhs.
dim() != rhs.
dim())
return false;
108 std::not_equal_to<Number> neq;
109 for (std::size_t i = 0; i < lhs.
dim(); ++i) {
110 if (neq(lhs[i], rhs[i]))
return false;
118 template<
typename Number>
121 for (std::size_t i = 0; i < r.
dim(); ++i) {
122 if (i > 0) os <<
", ";
Represent a multidimensional point whose components are algebraic reals.
const carl::IntRepRealAlgebraicNumber< Number > & operator[](std::size_t index) const
Retrieve the component of this point at the given index.
RealAlgebraicPoint(std::vector< carl::IntRepRealAlgebraicNumber< Number >> &&v)
Convert from a vector using its numbers in the same order as components.
RealAlgebraicPoint conjoin(const carl::IntRepRealAlgebraicNumber< Number > &r)
Create a new point with another given component added at the end of this point, thereby increasing it...
RealAlgebraicPoint prefixPoint(size_t componentCount) const
Make a (lower dimensional) copy that contains only the first 'componentCount'-many components.
RealAlgebraicPoint(const std::initializer_list< carl::IntRepRealAlgebraicNumber< Number >> &v)
Convert from a initializer_list using its numbers in the same order as components.
carl::IntRepRealAlgebraicNumber< Number > & operator[](std::size_t index)
Retrieve the component of this point at the given index.
std::size_t dim() const
Give the dimension/number of components of this point.
RealAlgebraicPoint(const std::list< carl::IntRepRealAlgebraicNumber< Number >> &v)
Convert from a list using its numbers in the same order as components.
std::vector< carl::IntRepRealAlgebraicNumber< Number > > mNumbers
Numbers of this RealAlgebraicPoint.
RealAlgebraicPoint() noexcept=default
Create an empty point of dimension 0.
static void copy(const T &from, T &to)
std::ostream & operator<<(std::ostream &os, const RealAlgebraicPoint< Number > &r)
Streaming operator for a RealAlgebraicPoint.
bool operator==(RealAlgebraicPoint< Number > &lhs, RealAlgebraicPoint< Number > &rhs)
Check if two RealAlgebraicPoints are equal.