16namespace layer1_foundations {
17namespace data_structures {
73 int data_length,
int f_second,
int verbose_level)
75 int f_v = (verbose_level >= 1);
78 cout <<
"tally::init" << endl;
119 cout <<
"tally::init done" << endl;
124 int data_length,
int f_second,
int verbose_level)
126 int f_v = (verbose_level >= 1);
131 cout <<
"tally::init_lint" << endl;
135 data_int[i] = (int)
data[i];
138 if (data_int[i] !=
data[i]) {
139 cout <<
"tally::init_lint data loss" << endl;
140 cout <<
"i=" << i << endl;
141 cout <<
"data[i]=" <<
data[i] << endl;
142 cout <<
"data_int[i]=" << data_int[i] << endl;
187 cout <<
"tally::init_lint done" << endl;
241 cout <<
"tally::class_of cannot find the class "
242 "containing " << pt_idx << endl;
428 ostream &ost,
int f_backwards,
int *the_vec_sorted,
429 int nb_types,
int *type_first,
int *type_len)
434 for (i =
nb_types - 1; i >= 0; i--) {
437 a = the_vec_sorted[f];
441 ost <<
"^{" << l <<
"}";
455 a = the_vec_sorted[f];
459 ost <<
"^{" << l <<
"}";
475 ost <<
"\\begin{array}{|r|r|l|}" << endl;
477 for (i =
nb_types - 1; i >= 0; i--) {
481 ost <<
"\\hline" << endl;
482 ost << l <<
" & " << a <<
" & ";
483 ost <<
"\\begin{array}{l}" << endl;
484 for (j = 0; j < l; j++) {
489 if (((j + 1) % 10) == 0) {
490 ost <<
"\\\\" << endl;
493 ost <<
"\\end{array}" << endl;
494 ost <<
"\\\\" << endl;
495 ost <<
"\\hline" << endl;
503 ost <<
"\\hline" << endl;
504 ost << l <<
" & " << a <<
" & ";
505 ost <<
"\\begin{array}{l}" << endl;
506 for (j = 0; j < l; j++) {
511 if (((j + 1) % 10) == 0) {
512 ost <<
"\\\\" << endl;
515 ost <<
"\\end{array}" << endl;
516 ost <<
"\\\\" << endl;
517 ost <<
"\\hline" << endl;
520 ost <<
"\\end{array}" << endl;
525 int i, f, l, L, a, s;
536 return s / (double) L;
541 int i, f, l, L, a, s;
554 return s / (double) L;
558 int *&Pts,
int &nb_pts,
int multiplicity,
int verbose_level)
560 int f_v = (verbose_level >= 1);
563 cout <<
"tally::get_data_by_multiplicity" << endl;
570 if (l == multiplicity) {
578 if (l == multiplicity) {
586 long int *&Pts,
int &nb_pts,
int multiplicity,
int verbose_level)
588 int f_v = (verbose_level >= 1);
591 cout <<
"tally::get_data_by_multiplicity" << endl;
598 if (l == multiplicity) {
606 if (l == multiplicity) {
645 int *&Pts,
int &nb_pts,
int value,
int verbose_level)
647 int f_v = (verbose_level >= 1);
650 cout <<
"tally::get_class_by_value" << endl;
660 for (j = 0; j < l; j++) {
674 long int *&Pts,
int &nb_pts,
int value,
int verbose_level)
676 int f_v = (verbose_level >= 1);
679 cout <<
"tally::get_class_by_value_lint" << endl;
689 for (j = 0; j < l; j++) {
703 int *&types,
int &nb_types,
int verbose_level)
705 int f_v = (verbose_level >= 1);
710 cout <<
"tally::get_set_partition_and_types" << endl;
722 for (j = 0; j < l; j++) {
728 cout <<
"tally::get_set_partition_and_types done" << endl;
748 fname2.assign(fname);
749 sprintf(str,
"%d", t);
751 fname2.append(
".csv");
755 cout <<
"Written file " << fname2 <<
" of size " << Fio.
file_size(fname2) << endl;
void init_basic_with_Sz_in_int(int underlying_set_size, int nb_sets, int *Sz, int verbose_level)
a collection of functions related to sorted vectors
void int_vec_sorting_permutation(int *v, int len, int *perm, int *perm_inv, int f_increasingly)
void int_vec_print_types_naked_tex_we_are_in_math_mode(std::ostream &ost, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void int_vec_print_types_naked_stringstream(std::stringstream &sstr, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void int_vec_print_types(std::ostream &ost, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void int_vec_print_types_naked_tex(std::ostream &ost, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void int_vec_print_types_naked(std::ostream &ost, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void int_vec_sorted_collect_types(int length, int *the_vec_sorted, int &nb_types, int *type_first, int *type_len)
void print_file_tex(std::ostream &ost, int f_backwards)
void sort_and_classify_second()
void init(int *data, int data_length, int f_second, int verbose_level)
data_structures::set_of_sets * get_set_partition_and_types(int *&types, int &nb_types, int verbose_level)
int * second_sorting_perm
void print_no_lf(int f_backwards)
int determine_class_by_value(int value)
void save_classes_individually(std::string &fname)
void print_file_tex_we_are_in_math_mode(std::ostream &ost, int f_backwards)
void print(int f_backwards)
void init_lint(long int *data, int data_length, int f_second, int verbose_level)
int get_value_of_class(int class_idx)
void get_data_by_multiplicity_as_lint(long int *&Pts, int &nb_pts, int multiplicity, int verbose_level)
void print_file(std::ostream &ost, int f_backwards)
void print_naked_tex(std::ostream &ost, int f_backwards)
void print_tex_no_lf(int f_backwards)
void print_first_tex(int f_backwards)
void print_first(int f_backwards)
void print_array_tex(std::ostream &ost, int f_backwards)
void print_types_naked_tex(std::ostream &ost, int f_backwards, int *the_vec_sorted, int nb_types, int *type_first, int *type_len)
void print_second_tex(int f_backwards)
void get_data_by_multiplicity(int *&Pts, int &nb_pts, int multiplicity, int verbose_level)
void print_naked_stringstream(std::stringstream &sstr, int f_backwards)
double average_of_non_zero_values()
void print_naked(int f_backwards)
void print_second(int f_backwards)
void get_class_by_value(int *&Pts, int &nb_pts, int value, int verbose_level)
int * second_sorting_perm_inv
void get_class_by_value_lint(long int *&Pts, int &nb_pts, int value, int verbose_level)
a collection of functions related to file io
void int_vec_write_csv(int *v, int len, std::string &fname, const char *label)
long int file_size(std::string &fname)
the orbiter library for the classification of combinatorial objects