#include <qsieve.H>
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 | |
SMulticombineData * | pMulticombineData |
Private Member Functions | |
void | swap (CRelation &GL2) |
Private Attributes | |
CTinyFBsizetypeVector * | Relation_sparse |
myBitString * | Relation_dense |
mpz_t | Delta |
std::istream * | pDynamicRelations_from_file |
Friends | |
class | StaticRelations |
class | SpecialRelations |
class | Cprocess_clients |
ostream & | operator<< (ostream &ostr, const CRelation &GL) |
stream output function for relations | |
Classes | |
class | ProvideDynamicRelationsStream |
struct | SMulticombineData |
Definition at line 69 of file qsieve.H.
typedef unsigned short int CRelation::TExponentArrayElement |
CRelation::CRelation | ( | ) | [inline] |
Definition at line 120 of file qsieve.H.
References Delta, and mpz_init_set_ui().
CRelation::~CRelation | ( | ) | [inline] |
Definition at line 128 of file qsieve.H.
References Delta, mpz_clear(), no_factor, Relation_dense, Relation_sparse, and relevant_factor.
CRelation::CRelation | ( | const signed int | SievePos, | |
short int | HitCount = 0 | |||
) | [explicit] |
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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.
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().
static void CRelation::SanityCheck | ( | istream & | in | ) | [inline, static] |
Definition at line 336 of file qsieve.H.
References exit(), and is_valid().
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().
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().
bool CRelation::operator< | ( | const CRelation & | GL2 | ) | const [inline] |
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().
streampos CRelation::save | ( | ostream & | out, | |
const int | i = 1 , |
|||
const short int | HitCount = 0 | |||
) | const [inline] |
CmpqsFactor CRelation::combine | ( | istream & | in, | |
const streampos | pos | |||
) |
Definition at line 430 of file CRelation.cc.
References combine(), and seek_emergency_handler.
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.
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.
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.
friend class StaticRelations [friend] |
friend class SpecialRelations [friend] |
friend class Cprocess_clients [friend] |
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] |
const int CRelation::special_factor = -3 [static] |
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().
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().