linbox
VectorFraction< Domain > Class Template Reference

VectorFraction<Domain> is a vector of rational elements with common reduced denominator. More...

#include <vector-fraction.h>

Public Types

typedef Domain::Element Element
 
typedef std::pair< Element, ElementFraction
 
typedef std::vector< FractionFVector
 
typedef DenseVector< DomainVector
 

Public Member Functions

 VectorFraction (const Domain &D, FVector &frac)
 constructor from vector of rational numbers reduces individual pairs in-place first unless alreadyReduced=true
 
 VectorFraction (const Domain &D, size_t n)
 allocating constructor, returns [0, 0, ... 0]/1
 
 VectorFraction (const VectorFraction< Domain > &VF)
 copy constructor
 
size_t size () const
 
void copy (const VectorFraction< Domain > &VF)
 copy without construction
 
void clearAndResize (size_t size)
 clear and resize without construction
 
bool combineSolution (const VectorFraction< Domain > &other)
 Replaces *this with a linear combination of *this and other such that the result has denominator == gcd(this->denom, other.denom) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 2.1 return value of true means that there was some improvement (ie denom was reduced)
 
bool boundedCombineSolution (const VectorFraction< Domain > &other, const Element &denBound, Element &g)
 Adds in-place to *this a multiple of other such that the result has gcd(denominator, denBound) == gcd(this->denom, other.denom, denBound) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 6.1 return value of true means that there was some improvement (ie gcd(denom, denBound) was reduced) g is gcd(denom, denBound), and is updated by this function when there is improvement.
 
bool combineCertificate (const VectorFraction< Domain > &other, Element &n1, Element &d1, const Element &n2, const Element d2)
 Adds in-place to *this a multiple of other to create an improved certificate ("z") n1/d1 = *this .
 
VectorFraction< Domain > & axpyin (Element &a, const VectorFraction< Domain > &x)
 this += a * x.
 
std::ostream & write (std::ostream &os) const
 write to a stream
 
std::ostream & operator<< (std::ostream &os) const
 
FVectortoFVector (FVector &result) const
 convert to 'answer' type of lifting container
 
VectorFraction< Domain > & simplify ()
 reduces to simplest form, returns (*this)
 

Data Fields

Vector numer
 
Element denom
 
const Domain_domain
 

Detailed Description

template<class Domain>
class LinBox::VectorFraction< Domain >

VectorFraction<Domain> is a vector of rational elements with common reduced denominator.

Here Domain is a ring supporting the gcd, eg NTL_ZZ or Givaro::ZRing<Integer> For compatability with the return type of rationalSolver, it allows conversion from/to std::vector<std::pair<Domain::Element> >. All functions will return the fraction in reduced form, calling reduce() if necessary.

Member Typedef Documentation

◆ Element

template<class Domain>
typedef Domain::Element Element

◆ Fraction

template<class Domain>
typedef std::pair<Element, Element> Fraction

◆ FVector

template<class Domain>
typedef std::vector<Fraction> FVector

◆ Vector

template<class Domain>
typedef DenseVector<Domain> Vector

Constructor & Destructor Documentation

◆ VectorFraction() [1/3]

template<class Domain>
VectorFraction ( const Domain & D,
FVector & frac )
inline

constructor from vector of rational numbers reduces individual pairs in-place first unless alreadyReduced=true

◆ VectorFraction() [2/3]

template<class Domain>
VectorFraction ( const Domain & D,
size_t n )
inline

allocating constructor, returns [0, 0, ... 0]/1

◆ VectorFraction() [3/3]

template<class Domain>
VectorFraction ( const VectorFraction< Domain > & VF)
inline

copy constructor

Member Function Documentation

◆ size()

template<class Domain>
size_t size ( ) const
inline

◆ copy()

template<class Domain>
void copy ( const VectorFraction< Domain > & VF)
inline

copy without construction

◆ clearAndResize()

template<class Domain>
void clearAndResize ( size_t size)
inline

clear and resize without construction

◆ combineSolution()

template<class Domain>
bool combineSolution ( const VectorFraction< Domain > & other)
inline

Replaces *this with a linear combination of *this and other such that the result has denominator == gcd(this->denom, other.denom) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 2.1 return value of true means that there was some improvement (ie denom was reduced)

◆ boundedCombineSolution()

template<class Domain>
bool boundedCombineSolution ( const VectorFraction< Domain > & other,
const Element & denBound,
Element & g )
inline

Adds in-place to *this a multiple of other such that the result has gcd(denominator, denBound) == gcd(this->denom, other.denom, denBound) see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 6.1 return value of true means that there was some improvement (ie gcd(denom, denBound) was reduced) g is gcd(denom, denBound), and is updated by this function when there is improvement.

◆ combineCertificate()

template<class Domain>
bool combineCertificate ( const VectorFraction< Domain > & other,
Element & n1,
Element & d1,
const Element & n2,
const Element d2 )
inline

Adds in-place to *this a multiple of other to create an improved certificate ("z") n1/d1 = *this .

b, n2/d2 = other . b in reduced form n1/d1 are updated so that new denominator is lcm(d1, d2); see Mulders+Storjohann : 'Certified Dense Linear System Solving' Lemma 6.2 return value of true means that there was some improvement (ie d1 was increased)

◆ axpyin()

template<class Domain>
VectorFraction< Domain > & axpyin ( Element & a,
const VectorFraction< Domain > & x )
inline

this += a * x.

performs a rational axpy with an integer multiplier returns (*this)

◆ write()

template<class Domain>
std::ostream & write ( std::ostream & os) const
inline

write to a stream

◆ operator<<()

template<class Domain>
std::ostream & operator<< ( std::ostream & os) const
inline

◆ toFVector()

template<class Domain>
FVector & toFVector ( FVector & result) const
inline

convert to 'answer' type of lifting container

◆ simplify()

template<class Domain>
VectorFraction< Domain > & simplify ( )
inline

reduces to simplest form, returns (*this)

Field Documentation

◆ numer

template<class Domain>
Vector numer

◆ denom

template<class Domain>
Element denom

◆ _domain

template<class Domain>
const Domain& _domain

The documentation for this class was generated from the following file: