CRelation Class Reference

#include <qsieve.H>

Inheritance diagram for CRelation:

Inheritance graph
[legend]
Collaboration diagram for CRelation:

Collaboration graph
[legend]

List of all members.

Public Types

typedef unsigned short int TExponentArrayElement
 compute union with GL2 and remove intersection (-> compute symmetric difference)

Public Member Functions

 CRelation ()
 ~CRelation ()
 CRelation (const signed int SievePos, short int HitCount=0)
int largest_factor_in_Relation () const
int second_largest_factor_in_Relation () const
unsigned int SizeOfRelation () const
void optisize (void)
void convert_Relation_to_dense ()
void convert_Relation_to_sparse ()
bool empty () const
 returns, whether relation is empty
void combine (const CRelation &GL2)
void set_MulticombineData (SMulticombineData *Data)
void invalidate_MulticombineData ()
void dispose_MulticombineData ()
void use_MulticombineData_from (const CRelation &GL)
void multi_combine_init ()
void multi_combine_main (const CRelation &GL2)
void multi_combine_exit ()
bool ComputeQuadraticCongruence () const
bool is_valid () const
void SanityCheck () const
bool operator< (const CRelation &GL2) const
streampos save (ostream &out, const CmpqsFactor factor, const short int HitCount=0) const
streampos save (ostream &out, const int i=1, const short int HitCount=0) const
CmpqsFactor combine (istream &in, const streampos pos)
CmpqsFactor multi_combine_main (istream &in, const streampos pos)
CmpqsFactor combine (istream &in)
CmpqsFactor multi_combine_main (istream &in)

Static Public Member Functions

static void seek_emergency_default_handler (istream &, const streampos)
 default action, when an invalid seek occurs in one of the combine methods
static bool is_valid (istream &in)
static void SanityCheck (istream &in)
static void SanityCheckRelationsFile (const std::string FileName)

Public Attributes

int relevant_factor

Static Public Attributes

static const int no_factor = -1
static const int dynamic_factor = -2
static const int special_factor = -3
static void(* seek_emergency_handler )(istream &, const streampos) = CRelation::seek_emergency_default_handler
 a function pointer, that gets called whenever combine tries to seek to an invalid position

Protected Member Functions

void adjust_multi_combine ()

Protected Attributes

SMulticombineDatapMulticombineData

Private Member Functions

void swap (CRelation &GL2)

Private Attributes

CTinyFBsizetypeVectorRelation_sparse
myBitStringRelation_dense
mpz_t Delta
std::istreampDynamicRelations_from_file

Friends

class StaticRelations
class SpecialRelations
class Cprocess_clients
ostreamoperator<< (ostream &ostr, const CRelation &GL)
 stream output function for relations

Classes

class  ProvideDynamicRelationsStream
struct  SMulticombineData


Detailed Description

Definition at line 69 of file qsieve.H.


Member Typedef Documentation

typedef unsigned short int CRelation::TExponentArrayElement

compute union with GL2 and remove intersection (-> compute symmetric difference)

Definition at line 246 of file qsieve.H.


Constructor & Destructor Documentation

CRelation::CRelation (  )  [inline]

Definition at line 120 of file qsieve.H.

References Delta, and mpz_init_set_ui().

Here is the call graph for this function:

CRelation::~CRelation (  )  [inline]

Definition at line 128 of file qsieve.H.

References Delta, mpz_clear(), no_factor, Relation_dense, Relation_sparse, and relevant_factor.

Here is the call graph for this function:

CRelation::CRelation ( const signed int  SievePos,
short int  HitCount = 0 
) [explicit]


Member Function Documentation

void CRelation::seek_emergency_default_handler ( istream ,
const   streampos 
) [static]

default action, when an invalid seek occurs in one of the combine methods

Definition at line 422 of file CRelation.cc.

int CRelation::largest_factor_in_Relation (  )  const [inline]

Definition at line 149 of file qsieve.H.

References myBitString::last(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::last(), no_factor, Relation_dense, and Relation_sparse.

Referenced by combine(), multi_combine_main(), and optisize().

Here is the call graph for this function:

int CRelation::second_largest_factor_in_Relation (  )  const [inline]

Definition at line 169 of file qsieve.H.

References myBitString::last(), no_factor, myBitString::prev(), Relation_dense, and Relation_sparse.

Referenced by StaticRelations::insert().

Here is the call graph for this function:

unsigned int CRelation::SizeOfRelation (  )  const [inline]

Definition at line 187 of file qsieve.H.

References myBitString::count(), Relation_dense, and Relation_sparse.

Referenced by StaticRelations::insert(), and optisize().

Here is the call graph for this function:

void CRelation::optisize ( void   )  [inline]

optimize the size of the relation; if it is useful, then implicitly convert the relation between dense and sparse.

Definition at line 197 of file qsieve.H.

References convert_Relation_to_dense(), convert_Relation_to_sparse(), largest_factor_in_Relation(), myBitString::optisize(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::optisize(), Relation_dense, Relation_sparse, and SizeOfRelation().

Referenced by StaticRelations::Load(), and multi_combine_exit().

Here is the call graph for this function:

void CRelation::convert_Relation_to_dense (  ) 

Definition at line 47 of file CRelation.cc.

References cerr, endl(), Relation_dense, Relation_sparse, and myBitString::set().

Referenced by combine(), multi_combine_main(), and optisize().

Here is the call graph for this function:

void CRelation::convert_Relation_to_sparse (  ) 

Definition at line 59 of file CRelation.cc.

References cerr, myBitString::count(), endl(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::fast_append(), myBitString::first(), myBitString::next(), Relation_dense, and Relation_sparse.

Referenced by optisize().

Here is the call graph for this function:

bool CRelation::empty ( void   )  const [inline]

returns, whether relation is empty

Definition at line 223 of file qsieve.H.

References no_factor, and relevant_factor.

Referenced by ComputeQuadraticCongruence(), and StaticRelations::insert().

void CRelation::combine ( const CRelation GL2  ) 

Definition at line 72 of file CRelation.cc.

References convert_Relation_to_dense(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::copy_from(), Delta, CTinyVector< Datatype, Sizetype, DefaultResizeStep >::fast_append(), myBitString::invert(), largest_factor_in_Relation(), myBitString::last(), mpz_cmp(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set_ui(), n, myBitString::prev(), Relation_dense, Relation_sparse, relevant_factor, myBitString::test(), and CProvideHelperVariables::x.

Referenced by combine(), SpecialRelations::CycleSearch(), SpecialRelations::insert(), StaticRelations::Load(), and SpecialRelations::split_by_primefactor().

Here is the call graph for this function:

void CRelation::set_MulticombineData ( SMulticombineData Data  )  [inline]

Definition at line 305 of file qsieve.H.

References pMulticombineData.

Referenced by StaticRelations::insert(), and SpecialRelations::insert().

void CRelation::invalidate_MulticombineData (  )  [inline]

Definition at line 306 of file qsieve.H.

References pMulticombineData.

Referenced by dispose_MulticombineData(), and StaticRelations::insert().

void CRelation::dispose_MulticombineData (  )  [inline]

Definition at line 307 of file qsieve.H.

References invalidate_MulticombineData(), and pMulticombineData.

Referenced by StaticRelations::insert().

Here is the call graph for this function:

void CRelation::use_MulticombineData_from ( const CRelation GL  )  [inline]

Definition at line 308 of file qsieve.H.

References pMulticombineData.

Referenced by StaticRelations::insert().

void CRelation::multi_combine_init (  ) 

Definition at line 188 of file CRelation.cc.

References cerr, endl(), exit(), MARK, CRelation::SMulticombineData::multi_combine_Counter, pMulticombineData, and StaticFactorbaseSettings::Size().

Referenced by StaticRelations::insert(), and SpecialRelations::insert().

Here is the call graph for this function:

void CRelation::multi_combine_main ( const CRelation GL2  ) 

Definition at line 333 of file CRelation.cc.

References adjust_multi_combine(), convert_Relation_to_dense(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::copy_from(), Delta, CTinyVector< Datatype, Sizetype, DefaultResizeStep >::fast_append(), largest_factor_in_Relation(), mpz_mod(), mpz_mul(), n, pMulticombineData, Relation_dense, Relation_sparse, relevant_factor, myBitString::test_and_add_carry(), and myBitString::test_and_invert().

Referenced by StaticRelations::insert(), SpecialRelations::insert(), and multi_combine_main().

Here is the call graph for this function:

void CRelation::multi_combine_exit (  ) 

Definition at line 204 of file CRelation.cc.

References cerr, cout, Delta, endl(), exit(), MARK, mpz_clear(), mpz_cmp(), mpz_init_set_ui(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_powm_ui(), mpz_set_ui(), CRelation::SMulticombineData::multi_combine_Counter, n, optisize(), pMulticombineData, StaticFactorbaseSettings::Size(), and CProvideHelperVariables::y.

Referenced by adjust_multi_combine(), and StaticRelations::insert().

Here is the call graph for this function:

void CRelation::adjust_multi_combine (  )  [inline, protected]

Definition at line 314 of file qsieve.H.

References cout, endl(), CRelation::SMulticombineData::multi_combine_Counter, multi_combine_exit(), and pMulticombineData.

Referenced by multi_combine_main().

Here is the call graph for this function:

bool CRelation::ComputeQuadraticCongruence (  )  const

Definition at line 702 of file CRelation-inc.cc.

References cerr, cout, Delta, empty(), endl(), exit(), Factorization_to_file, flush(), MAL(), MARK, mpz_add_ui(), mpz_clear(), mpz_cmp(), mpz_cmp_ui(), mpz_divexact(), mpz_gcd(), mpz_init(), mpz_powm_ui(), mpz_probab_prime_p(), mpz_swap(), n, Potenztest(), my_mpz_wrapper::probab_prime_checks, statistical_data::StatusReport(), CProvideHelperVariables::x, and CProvideHelperVariables::y.

Referenced by StaticRelations::insert().

Here is the call graph for this function:

bool CRelation::is_valid (  )  const

Definition at line 521 of file CRelation.cc.

References cout, Delta, endl(), myBitString::first(), MARK, mpz_clear(), mpz_cmp(), mpz_init(), mpz_init_set_ui(), mpz_invert(), mpz_mod(), mpz_mul_si(), mpz_powm_ui(), n, myBitString::next(), Relation_dense, Relation_sparse, CProvideHelperVariables::x, and CProvideHelperVariables::y.

Referenced by Cprocess_clients::process_data_stream(), SanityCheck(), and SanityCheckRelationsFile().

Here is the call graph for this function:

bool CRelation::is_valid ( istream in  )  [static]

Definition at line 573 of file CRelation.cc.

References cerr, cout, Delta, distance(), std::set< _Key, _Compare, _Alloc >::end(), endl(), std::set< _Key, _Compare, _Alloc >::find(), CStreamDecoder::GetValue(), std::set< _Key, _Compare, _Alloc >::insert(), MARK, mpz_clear(), mpz_cmp(), mpz_init_set_ui(), mpz_invert(), mpz_mod(), mpz_mul(), mpz_mul_si(), mpz_mul_ui(), mpz_powm_ui(), mpz_set_str(), mpz_set_ui(), mpz_sizeinbase(), my_mpz_wrapper::mpzbase_f, n, CmpqsFactortypes::single_large_prime, StaticFactorbaseSettings::Size(), CProvideHelperVariables::x, and CProvideHelperVariables::y.

Here is the call graph for this function:

void CRelation::SanityCheck (  )  const [inline]

Definition at line 332 of file qsieve.H.

References exit(), and is_valid().

Referenced by SpecialRelations::CycleSearch(), and SpecialRelations::split_by_primefactor().

Here is the call graph for this function:

static void CRelation::SanityCheck ( istream in  )  [inline, static]

Definition at line 336 of file qsieve.H.

References exit(), and is_valid().

Here is the call graph for this function:

void CRelation::SanityCheckRelationsFile ( const std::string  FileName  )  [static]

Definition at line 700 of file CRelation.cc.

References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), cerr, count(), cout, endl(), exit(), flush(), and is_valid().

Referenced by main().

Here is the call graph for this function:

void CRelation::swap ( CRelation GL2  )  [inline, private]

Definition at line 343 of file qsieve.H.

References Delta, mpz_swap(), Relation_dense, Relation_sparse, relevant_factor, and std::swap().

Here is the call graph for this function:

bool CRelation::operator< ( const CRelation GL2  )  const [inline]

Definition at line 353 of file qsieve.H.

References relevant_factor.

streampos CRelation::save ( ostream out,
const CmpqsFactor  factor,
const short int  HitCount = 0 
) const

Definition at line 637 of file CRelation-inc.cc.

References Delta, endl(), myBitString::first(), hex(), mpz_get_str(), mpz_sizeinbase(), my_mpz_wrapper::mpzbase_f, myBitString::next(), CStreamEncoder::PutValue(), Relation_dense, Relation_sparse, and setprecision().

Referenced by StaticRelations::insert(), SpecialRelations::insert(), and save().

Here is the call graph for this function:

streampos CRelation::save ( ostream out,
const int  i = 1,
const short int  HitCount = 0 
) const [inline]

Definition at line 358 of file qsieve.H.

References save().

Here is the call graph for this function:

CmpqsFactor CRelation::combine ( istream in,
const streampos  pos 
)

Definition at line 430 of file CRelation.cc.

References combine(), and seek_emergency_handler.

Here is the call graph for this function:

CmpqsFactor CRelation::multi_combine_main ( istream in,
const streampos  pos 
)

Definition at line 439 of file CRelation.cc.

References multi_combine_main(), and seek_emergency_handler.

Here is the call graph for this function:

CmpqsFactor CRelation::combine ( istream in  ) 

Definition at line 381 of file CRelation-inc.cc.

References CTinyVector< Datatype, Sizetype, DefaultResizeStep >::append(), cerr, combine(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::copy_from(), Delta, distance(), CmpqsFactortypes::empty, endl(), exit(), TDynamicFactorRelation::factor, fillin_streampos(), TDynamicFactorRelation::fpos, CStreamDecoder::GetValue(), myBitString::invert(), largest_factor_in_Relation(), MARK, mpz_cmp(), mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set_str(), mpz_set_ui(), my_mpz_wrapper::mpzbase_f, n, pDynamicRelations_from_file, Relation_dense, Relation_sparse, relevant_factor, seek_emergency_handler, StaticFactorbaseSettings::Size(), myBitString::test(), and CProvideHelperVariables::x.

Here is the call graph for this function:

CmpqsFactor CRelation::multi_combine_main ( istream in  ) 

Definition at line 518 of file CRelation-inc.cc.

References adjust_multi_combine(), CTinyVector< Datatype, Sizetype, DefaultResizeStep >::append(), cerr, CTinyVector< Datatype, Sizetype, DefaultResizeStep >::copy_from(), Delta, distance(), CmpqsFactortypes::empty, endl(), exit(), TDynamicFactorRelation::factor, fillin_streampos(), TDynamicFactorRelation::fpos, CStreamDecoder::GetValue(), largest_factor_in_Relation(), MARK, mpz_mod(), mpz_mul(), mpz_mul_ui(), mpz_set_str(), my_mpz_wrapper::mpzbase_f, multi_combine_main(), n, pDynamicRelations_from_file, pMulticombineData, Relation_dense, Relation_sparse, relevant_factor, seek_emergency_handler, StaticFactorbaseSettings::Size(), myBitString::test_and_invert(), and CProvideHelperVariables::x.

Here is the call graph for this function:


Friends And Related Function Documentation

friend class StaticRelations [friend]

Definition at line 369 of file qsieve.H.

friend class SpecialRelations [friend]

Definition at line 370 of file qsieve.H.

friend class Cprocess_clients [friend]

Definition at line 371 of file qsieve.H.

ostream& operator<< ( ostream ostr,
const CRelation GL 
) [friend]

stream output function for relations

Definition at line 21 of file CRelation.cc.


Member Data Documentation

const int CRelation::no_factor = -1 [static]

Definition at line 83 of file qsieve.H.

Referenced by empty(), largest_factor_in_Relation(), second_largest_factor_in_Relation(), and ~CRelation().

const int CRelation::dynamic_factor = -2 [static]

Definition at line 84 of file qsieve.H.

Referenced by StaticRelations::insert().

const int CRelation::special_factor = -3 [static]

Definition at line 85 of file qsieve.H.

Referenced by StaticRelations::insert().

int CRelation::relevant_factor

Definition at line 86 of file qsieve.H.

Referenced by combine(), empty(), StaticRelations::insert(), StaticRelations::Load(), multi_combine_main(), operator<(), swap(), and ~CRelation().

CTinyFBsizetypeVector* CRelation::Relation_sparse [private]

Definition at line 91 of file qsieve.H.

Referenced by combine(), convert_Relation_to_dense(), convert_Relation_to_sparse(), StaticRelations::insert(), is_valid(), largest_factor_in_Relation(), multi_combine_main(), operator<<(), optisize(), save(), second_largest_factor_in_Relation(), SizeOfRelation(), swap(), and ~CRelation().

myBitString* CRelation::Relation_dense [private]

Definition at line 92 of file qsieve.H.

Referenced by combine(), convert_Relation_to_dense(), convert_Relation_to_sparse(), is_valid(), largest_factor_in_Relation(), multi_combine_main(), operator<<(), optisize(), save(), second_largest_factor_in_Relation(), SizeOfRelation(), swap(), and ~CRelation().

mpz_t CRelation::Delta [private]

Definition at line 93 of file qsieve.H.

Referenced by combine(), ComputeQuadraticCongruence(), CRelation(), SpecialRelations::CycleSearch(), SpecialRelations::insert(), is_valid(), multi_combine_exit(), multi_combine_main(), operator<<(), save(), SpecialRelations::split_by_primefactor(), swap(), and ~CRelation().

std::istream* CRelation::pDynamicRelations_from_file [private]

Definition at line 94 of file qsieve.H.

Referenced by combine(), and multi_combine_main().

void(* CRelation::seek_emergency_handler)(istream &, const streampos) ( istream ,
const   streampos 
) = CRelation::seek_emergency_default_handler [static]

a function pointer, that gets called whenever combine tries to seek to an invalid position

Referenced by combine(), main(), and multi_combine_main().

SMulticombineData* CRelation::pMulticombineData [protected]

Definition at line 300 of file qsieve.H.

Referenced by adjust_multi_combine(), dispose_MulticombineData(), invalidate_MulticombineData(), multi_combine_exit(), multi_combine_init(), multi_combine_main(), set_MulticombineData(), and use_MulticombineData_from().


The documentation for this class was generated from the following files:
Generated on Wed Nov 7 23:31:23 2007 for Qsieve by  doxygen 1.5.4