11#undef BASE_SETTYPE_VERBOSE
16namespace layer2_discreta {
63 cout <<
"freeself() not implemented for class ";
106 default: cout <<
"discreta_base::freeself_kind(), unknown kind: k= " <<
kind_ascii(
k) <<
"\n";
112#ifdef BASE_SETTYPE_VERBOSE
114 cout <<
"warning: base::settype_base converting from "
127 cout <<
"discreta_base::s_kind "
128 "kind != virtual kind\n";
130 <<
", virtual kind = " <<
kind_ascii(kv) << endl;
171 default: cout <<
"discreta_base::c_kind(), k= " <<
kind_ascii(
k) <<
" unknown\n";
174 cout <<
"discreta_base::c_kind() did not work\n";
208 cout <<
"error: discreta_base::copyobject_to "
212 cout <<
"warning: discreta_base::copyobject_to "
213 "for object: " << *
this <<
"\n";
221 ost <<
"object of kind BASE";
238 l = (int) s.str().length();
239 p =
new char [l + 1];
240 s.str().copy(p, l, 0);
261 cout <<
"discreta_base::s_i_i not an integer, objectkind=";
277 cout <<
"compare_with() not implemented for class ";
385 cout <<
"mult_to() not implemented for class ";
539 cout <<
"l=" << l <<
" digits=" << d << endl;
572 cout <<
"l=" << l <<
" digits=" << d << endl;
648 cout <<
"discreta_base::order b^" << i <<
"=" << b << endl;
654 cout <<
"discreta_base::order b^" << i <<
"=" << b <<
" is one " << endl;
714 cout <<
"negate_to() not implemented for class ";
735 cout <<
"normalize() not implemented for class ";
916 cout <<
"integral_division_exact "
917 "remainder not zero" << endl;
918 cout <<
"this=" << *
this <<
" divided by "
919 << x <<
" gives remainder " << r << endl;
976 int f_v = (verbose_level >= 1);
982 cout <<
"discreta_base::extended_gcd "
983 "m=" << *
this <<
" n=" << n << endl;
991 cout <<
"discreta_base::extended_gcd "
1030 u1 = *
this; u1.
one();
1031 u2 = *
this; u2.
zero();
1036 cout <<
"loop:" << endl;
1039 cout <<
"before integral_division" << endl;
1043 cout <<
"after integral_division" << endl;
1044 cout <<
"Q=" << Q <<
" R=" << R << endl;
1098 cout <<
"g=" << g <<
" =" << u <<
" * "
1099 << *
this <<
" + " << v <<
" * " << n << endl;
1113 cout <<
"write_memory(): kind not 1 char" << endl;
1117 if (debug_depth > 0) {
1118 cout <<
"discreta_base::write_memory "
1141 cout <<
"discreta_base::write_mem "
1142 "no write_mem for LONGINTEGER" << endl;
1179 as_action().write_mem(m, debug_depth);
1182 as_geometry().write_mem(m, debug_depth);
1184 case GROUP_SELECTION:
1185 as_group_selection().write_mem(m, debug_depth);
1195 cout <<
"discreta_base::write_memory "
1231 cout <<
"discreta_base::read_mem "
1232 "no read_mem for LONGINTEGER" << endl;
1269 as_action().read_mem(m, debug_depth);
1272 as_geometry().read_mem(m, debug_depth);
1274 case GROUP_SELECTION:
1275 as_group_selection().read_mem(m, debug_depth);
1285 cout <<
"discreta_base::read_memory "
1301 cout <<
"write_memory "
1302 "kind not 1 char" << endl;
1326 cout <<
"discreta_base::write_mem "
1327 "no csf for LONGINTEGER" << endl;
1364 size += as_action().csf();
1367 size += as_geometry().csf();
1369 case GROUP_SELECTION:
1370 size += as_group_selection().csf();
1380 cout <<
"discreta_base::calc_size_on_file "
1391 int f_v = (verbose_level >= 1);
1395 cout <<
"discreta_base::pack "
1396 "calculating memory size" << endl;
1401 cout <<
"discreta_base::pack "
1402 "allocating memory of size " << size0 << endl;
1407 cout <<
"discreta_base::pack calling write_memory" << endl;
1411 if (size != size0) {
1412 cout <<
"discreta_base::pack "
1413 "WARNING!!!: size = " << size
1414 <<
" != size0 = " << size0 << endl;
1430 int size, debug_depth;
1432 unsigned int a, a1, a2;
1436 cout <<
"discreta_base::save_ascii "
1437 "calculating memory size" << endl;
1444 cout <<
"discreta_base::save_ascii "
1445 "packing object" << endl;
1447 pack(M, f_v, debug_depth);
1448#ifdef SAVE_ASCII_USE_COMPRESS
1450 cout <<
"discreta_base::save_ascii "
1451 "compressing object" << endl;
1456 cout <<
"discreta_base::save_ascii "
1457 "saving data" << endl;
1462 f <<
"ASCII " << size << endl;
1463 for (i = 0; i < size; i++) {
1464 a = (
unsigned int) pc[i];
1465 a1 = a % (
unsigned int) 16;
1470 if ((i + 1) % 40 == 0)
1473 f << endl <<
"ASCIIEND" << endl;
1486 int size, i, debug_depth;
1490 unsigned int a1, a2;
1494 f.getline(buf,
sizeof(buf));
1497 if (strcmp(str,
"ASCII") != 0) {
1498 cout <<
"discreta_base::load_ascii "
1499 "error reading header: ASCII keyword not found" << endl;
1504 cout <<
"discreta_base::load_ascii "
1505 "reading ASCII file of size " << size << endl;
1509 for (i = 0; i < size; i++) {
1512 cout <<
"discreta_base::load_ascii "
1513 "primature EOF" << endl;
1521 a1 = (
unsigned int) cc;
1523 cout <<
"discreta_base::load_ascii "
1524 "primature EOF" << endl;
1528 a2 = (
unsigned int) cc;
1538 f.getline(buf,
sizeof(buf));
1548 if (strcmp(str,
"ASCIIEND") != 0) {
1549 cout <<
"discreta_base::load_ascii "
1550 "error reading footer: ASCIIEND keyword not found" << endl;
1557 cout <<
"file read." << endl;
1560#ifdef SAVE_ASCII_USE_COMPRESS
1568 unpack(M, f_v, debug_depth);
void write_mem(memory &m, int debug_depth)
void read_mem(memory &m, int debug_depth)
void freeself_design_parameter_source()
void settype_design_parameter_source()
void settype_design_parameter()
void freeself_design_parameter()
DISCRETA base class. All DISCRETA classes are derived from this class.
design_parameter_source & as_design_parameter_source()
void integral_division_exact(discreta_base &x, discreta_base &q)
longinteger & as_longinteger()
integer & change_to_integer()
virtual void normalize(discreta_base &p)
discreta_base & divide_by(discreta_base &x)
virtual void integral_division(discreta_base &x, discreta_base &q, discreta_base &r, int verbose_level)
int invert_mod(discreta_base &p)
void add_apply(discreta_base &x)
std::ostream & printobjectkind(std::ostream &)
int neq(discreta_base &a)
void integral_division_by_integer_exact_apply(int x)
virtual std::ostream & print(std::ostream &)
void integral_division_by_integer_exact(int x, discreta_base &q)
virtual int compare_with_euclidean(discreta_base &a)
int is_divisor(discreta_base &y)
discreta_matrix & as_matrix()
void add(discreta_base &x, discreta_base &y)
virtual kind s_virtual_kind()
discreta_base & i_power_j(int i, int j)
void save_ascii(std::ostream &f)
void integral_division_by_integer(int x, discreta_base &q, discreta_base &r)
void pack(memory &M, int verbose_level, int debug_depth)
discreta_base & factorial(int z)
discreta_base & power_longinteger_mod(longinteger &l, discreta_base &p)
virtual void negate_to(discreta_base &x)
void save_file(const char *fname)
virtual void add_to(discreta_base &x, discreta_base &y)
void mult(discreta_base &x, discreta_base &y)
virtual int compare_with(discreta_base &a)
virtual void mult_to(discreta_base &x, discreta_base &y)
discreta_base & power_int_mod(int l, discreta_base &p)
void add_mod(discreta_base &x, discreta_base &y, discreta_base &p)
void freeself_discreta_base()
hollerith & as_hollerith()
void unpack(memory &M, int verbose_level, int debug_depth)
void read_memory(memory &m, int debug_depth)
void swap(discreta_base &a)
discreta_base & divide_by_exact(discreta_base &x)
std::ostream & println(std::ostream &)
number_partition & as_number_partition()
void modulo(discreta_base &p)
discreta_base & operator=(const discreta_base &x)
void copyobject(discreta_base &x)
void mult_mod(discreta_base &x, discreta_base &y, discreta_base &p)
void load_file(const char *fname)
discreta_base & conjugate(discreta_base &x, discreta_base &y)
void print_to_hollerith(hollerith &h)
discreta_base & power_int(int l)
virtual int invert_to(discreta_base &x)
permutation & as_permutation()
design_parameter & as_design_parameter()
void write_memory(memory &m, int debug_depth)
void mult_apply(discreta_base &x)
discreta_base & power_longinteger(longinteger &l)
virtual void homo_z(int z)
int order_mod(discreta_base &p)
virtual void copyobject_to(discreta_base &x)
std::ostream & printobjectkindln(std::ostream &)
void load_ascii(std::istream &f)
void extended_gcd(discreta_base &n, discreta_base &u, discreta_base &v, discreta_base &g, int verbose_level)
discreta_base & commutator(discreta_base &x, discreta_base &y)
void freeself_kind(kind k)
void read_mem(memory &M, int debug_depth)
void write_mem(memory &m, int debug_depth)
void read_mem(memory &m, int debug_depth)
void freeself_hollerith()
void write_mem(memory &m, int debug_depth)
DISCRETA class for integers of arbitrary magnitude.
void divide_out_int(int d)
void freeself_longinteger()
void settype_longinteger()
DISCRETA class to serialize data structures.
void read_mem(memory &M, int debug_depth)
void write_mem(memory &M, int debug_depth)
void settype_number_partition()
void freeself_number_partition()
void read_mem(memory &m, int debug_depth)
void freeself_permutation()
void write_mem(memory &m, int debug_depth)
void settype_permutation()
#define NOT_EXISTING_FUNCTION(s)
void freeobject(discreta_base *p)
discreta_base * callocobject(kind k)
void printobjectkind(std::ostream &ost, kind k)
const char * kind_ascii(kind k)
@ PERMUTATION
PERMUTATION.
@ DESIGN_PARAMETER
DESIGN_PARAMETER.
@ NUMBER_PARTITION
NUMBER_PARTITION.
@ LONGINTEGER
LONGINTEGER.
@ DESIGN_PARAMETER_SOURCE
DESIGN_PARAMETER_SOURCE.
the orbiter library for the classification of combinatorial objects