void draw_vertex_callback_graph(tree *T, mp_graphics *G, INT *v, INT layer, tree_node *N, INT x, INT y, INT dx, INT dy) { //INT d1; //BYTE str[1000]; cout << "draw_vertex_callback_graph x=" << x << " y=" << y << " dx = " << dx << " dy=" << dy << endl; //d1 = LG->L[layer].Nodes[node].data1; //nb_V = LG->data1; //sprintf(str, "%ld", N->value); //G->aligned_text(x, y, "", str); if (f_graph_perm) { INT i, a, b, x, y, x1, y1; for (i = 0; i < layer; i++) { a = v[i]; k2ij(a, x, y, graph_nb_V); x1 = graph_perm[x]; y1 = graph_perm[y]; b = ij2k(x1, y1, graph_nb_V); v[i] = b; } } if (f_multiple_circles) { draw_graph_on_multiple_circles(G, x, y, dx, dy, graph_nb_V, v, layer, nb_circles); // in GALOIS/draw.C } else { draw_graph(G, x, y, dx, dy, graph_nb_V, v, layer); // in GALOIS/draw.C } }
void ElectrostaticSystem::setPotentialK(long k, double potential) { if(k>kMax || k<0) throw std::out_of_range("Error: Trying to set element out of range!"); int* ij = k2ij(k); potentials(ij[0]-iMin, ij[1]-jMin) = potential; }
double ElectrostaticSystem::getPotentialK(long k) const { if(k>kMax || k<0) throw std::out_of_range("Error: Trying to get element out of range!"); int* ij = k2ij(k); return potentials(ij[0]-iMin, ij[1]-jMin); }
void induced_action_element_image_of_low_level(action &A, INT *input, INT *output, void *elt, INT verbose_level) { INT *Elt = (INT *) elt; INT f_v = (verbose_level >= 1); if (f_v) { cout << "induced_action_element_image_of_low_level() computing image of "; INT_vec_print(cout, input, A.low_level_point_size); cout << " in action " << A.label << endl; } if (A.type_G == action_by_right_multiplication_t) { if (f_v) { cout << "action_by_right_multiplication_t" << endl; } cout << "induced_action_element_image_of_low_level() action_by_right_multiplication_t not yet implemented" << endl; exit(1); #if 0 action_by_right_multiplication *ABRM = A.G.ABRM; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } ABRM->compute_image(sub, Elt, a, b, verbose_level - 1); #endif } else if (A.type_G == action_by_restriction_t) { if (f_v) { cout << "action_by_restriction_t" << endl; } cout << "induced_action_element_image_of_low_level() action_by_restriction_t not yet implemented" << endl; exit(1); #if 0 action_by_right_multiplication *ABRM = A.G.ABRM; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } ABRM->compute_image(sub, Elt, a, b, verbose_level - 1); #endif } else if (A.type_G == action_by_conjugation_t) { if (f_v) { cout << "action_by_conjugation_t" << endl; } cout << "induced_action_element_image_of_low_level() action_by_conjugation_t not yet implemented" << endl; exit(1); #if 0 action_by_conjugation *ABC = A.G.ABC; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } ABC->compute_image(sub, Elt, a, b, verbose_level - 1); #endif } else if (A.type_G == action_by_representation_t) { if (f_v) { cout << "action_by_representation_t" << endl; } action_by_representation *Rep = A.G.Rep; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } Rep->compute_image_INT_low_level(*sub, Elt, input, output, verbose_level - 1); } else if (A.type_G == action_on_determinant_t) { if (f_v) { cout << "action_on_determinant_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_determinant_t not yet implemented" << endl; exit(1); #if 0 action_on_determinant *AD = A.G.AD; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } AD->compute_image(sub, Elt, a, b, verbose_level - 1); #endif } else if (A.type_G == action_on_grassmannian_t) { if (f_v) { cout << "action_on_grassmannian_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_grassmannian_t not yet implemented" << endl; exit(1); #if 0 action_on_grassmannian *AG = A.G.AG; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = AG->compute_image_INT(sub, Elt, a, verbose_level - 1); #endif } else if (A.type_G == action_on_spread_set_t) { if (f_v) { cout << "action_on_spread_set_t" << endl; } action_on_spread_set *AS = A.G.AS; AS->compute_image_low_level(Elt, input, output, verbose_level - 1); } else if (A.type_G == action_on_orthogonal_t) { if (f_v) { cout << "action_on_orthogonal_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_orthogonal_t not yet implemented" << endl; exit(1); } else if (A.type_G == action_on_wedge_product_t) { if (f_v) { cout << "action_on_wedge_product_t" << endl; } action_on_wedge_product *AW = A.G.AW; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } AW->compute_image_INT_low_level(*sub, Elt, input, output, verbose_level - 1); } else if (A.type_G == action_by_subfield_structure_t) { if (f_v) { cout << "action_by_subfield_structure_t" << endl; } action_by_subfield_structure *SubfieldStructure = A.G.SubfieldStructure; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } SubfieldStructure->compute_image_INT_low_level(*sub, Elt, input, output, verbose_level - 1); } else if (A.type_G == action_on_cosets_t) { if (f_v) { cout << "action_on_cosets_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_cosets_t not yet implemented" << endl; exit(1); } else if (A.type_G == action_on_factor_space_t) { if (f_v) { cout << "action_on_factor_space_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_factor_space_t not yet implemented" << endl; exit(1); #if 0 action_on_factor_space *AF = A.G.AF; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = AF->compute_image(sub, Elt, a, verbose_level - 1); #endif } else if (A.type_G == action_on_sets_t) { if (f_v) { cout << "action_on_sets_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_sets_t not yet implemented" << endl; exit(1); #if 0 action_on_sets *AOS = A.G.on_sets; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } AOS->compute_image(sub, Elt, a, b, verbose_level - 1); #endif } else if (A.type_G == action_on_k_subsets_t) { if (f_v) { cout << "action_on_k_subsets_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_k_subsets_t not yet implemented" << endl; exit(1); } else if (A.type_G == action_on_bricks_t) { if (f_v) { cout << "action_on_bricks_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_bricks_t not yet implemented" << endl; exit(1); } else if (A.type_G == action_on_andre_t) { if (f_v) { cout << "action_on_andre_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_andre_t not yet implemented" << endl; exit(1); } else if (A.type_G == action_on_pairs_t) { if (f_v) { cout << "action_on_pairs_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_pairs_t not yet implemented" << endl; exit(1); #if 0 action *sub; INT i, j, u, v; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction, type = action_on_pairs_t" << endl; exit(1); } k2ij(a, i, j, sub->degree); u = sub->element_image_of(i, elt, verbose_level - 1); v = sub->element_image_of(j, elt, verbose_level - 1); b = ij2k(u, v, sub->degree); #endif } else if (A.type_G == action_on_ordered_pairs_t) { if (f_v) { cout << "action_on_ordered_pairs_t" << endl; } cout << "induced_action_element_image_of_low_level() action_on_ordered_pairs_t not yet implemented" << endl; exit(1); } else if (A.type_G == base_change_t) { if (f_v) { cout << "base_change_t" << endl; } cout << "induced_action_element_image_of_low_level() base_change_t not yet implemented" << endl; exit(1); #if 0 action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction, type = base_change_t" << endl; exit(1); } b = sub->element_image_of(a, elt, verbose_level - 1); #endif } else if (A.type_G == product_action_t) { if (f_v) { cout << "product_action_t" << endl; } cout << "induced_action_element_image_of_low_level() product_action_t not yet implemented" << endl; exit(1); #if 0 product_action *PA; PA = A.G.product_action_data; b = PA->compute_image(&A, (INT *)elt, a, verbose_level - 1); } #endif }
INT induced_action_element_image_of(action &A, INT a, void *elt, INT verbose_level) { INT *Elt = (INT *) elt; INT b = 0; INT f_v = (verbose_level >= 1); if (f_v) { cout << "induced_action_element_image_of computing image of " << a << " in action " << A.label << endl; } if (A.type_G == action_by_right_multiplication_t) { if (f_v) { cout << "action_by_right_multiplication_t" << endl; } action_by_right_multiplication *ABRM = A.G.ABRM; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } ABRM->compute_image(sub, Elt, a, b, verbose_level - 1); } else if (A.type_G == action_by_restriction_t) { if (f_v) { cout << "action_by_restriction_t" << endl; } action_by_restriction *ABR = A.G.ABR; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = ABR->compute_image(sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_by_conjugation_t) { if (f_v) { cout << "action_by_conjugation_t" << endl; } action_by_conjugation *ABC = A.G.ABC; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = ABC->compute_image(sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_by_representation_t) { if (f_v) { cout << "action_by_representation_t" << endl; } action_by_representation *Rep = A.G.Rep; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = Rep->compute_image_INT(*sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_on_determinant_t) { if (f_v) { cout << "action_on_determinant_t" << endl; } action_on_determinant *AD = A.G.AD; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } AD->compute_image(sub, Elt, a, b, verbose_level - 1); } else if (A.type_G == action_on_grassmannian_t) { if (f_v) { cout << "action_on_grassmannian_t" << endl; } action_on_grassmannian *AG = A.G.AG; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = AG->compute_image_INT(sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_on_spread_set_t) { if (f_v) { cout << "action_on_spread_set_t" << endl; } action_on_spread_set *AS = A.G.AS; b = AS->compute_image_INT(Elt, a, verbose_level - 1); } else if (A.type_G == action_on_orthogonal_t) { if (f_v) { cout << "action_on_orthogonal_t" << endl; } action_on_orthogonal *AO = A.G.AO; #if 0 action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } #endif b = AO->compute_image_INT(Elt, a, verbose_level - 1); } else if (A.type_G == action_on_wedge_product_t) { if (f_v) { cout << "action_on_wedge_product_t" << endl; } action_on_wedge_product *AW = A.G.AW; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = AW->compute_image_INT(*sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_by_subfield_structure_t) { if (f_v) { cout << "action_by_subfield_structure_t" << endl; } action_by_subfield_structure *SubfieldStructure = A.G.SubfieldStructure; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = SubfieldStructure->compute_image_INT(*sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_on_cosets_t) { if (f_v) { cout << "action_on_cosets_t" << endl; } action_on_cosets *AC = A.G.OnCosets; //cout << "interface.C: action_on_cosets computing image of " << a << endl; b = AC->compute_image(Elt, a, verbose_level - 1); //cout << "interface.C: action_on_cosets image of " << a << " is " << b << endl; } else if (A.type_G == action_on_factor_space_t) { if (f_v) { cout << "action_on_factor_space_t" << endl; } action_on_factor_space *AF = A.G.AF; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } b = AF->compute_image(sub, Elt, a, verbose_level - 1); } else if (A.type_G == action_on_sets_t) { if (f_v) { cout << "action_on_sets_t" << endl; } action_on_sets *AOS = A.G.on_sets; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } AOS->compute_image(sub, Elt, a, b, verbose_level - 1); } else if (A.type_G == action_on_k_subsets_t) { if (f_v) { cout << "action_on_k_subsets_t" << endl; } action_on_k_subsets *On_k_subsets = A.G.on_k_subsets; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } On_k_subsets->compute_image(Elt, a, b, verbose_level - 1); } else if (A.type_G == action_on_bricks_t) { if (f_v) { cout << "action_on_bricks_t" << endl; } action_on_bricks *On_bricks = A.G.OnBricks; action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } On_bricks->compute_image(Elt, a, b, verbose_level - 1); } else if (A.type_G == action_on_andre_t) { if (f_v) { cout << "action_on_andre_t" << endl; } action_on_andre *On_andre = A.G.OnAndre; #if 0 action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction" << endl; exit(1); } #endif On_andre->compute_image(Elt, a, b, verbose_level - 1); } else if (A.type_G == action_on_pairs_t) { if (f_v) { cout << "action_on_pairs_t" << endl; } action *sub; INT i, j, u, v; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction, type = action_on_pairs_t" << endl; exit(1); } k2ij(a, i, j, sub->degree); u = sub->element_image_of(i, elt, verbose_level - 1); v = sub->element_image_of(j, elt, verbose_level - 1); b = ij2k(u, v, sub->degree); } else if (A.type_G == action_on_ordered_pairs_t) { if (f_v) { cout << "action_on_ordered_pairs_t" << endl; } action *sub; INT a2, b2, swap, swap2, i, j, tmp, u, v, u2, v2; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction, type = action_on_ordered_pairs_t" << endl; exit(1); } swap = a % 2; a2 = a / 2; k2ij(a2, i, j, sub->degree); if (swap) { tmp = i; i = j; j = tmp; } u = sub->element_image_of(i, elt, verbose_level - 1); v = sub->element_image_of(j, elt, verbose_level - 1); if (u > v) { v2 = u; u2 = v; swap2 = 1; } else { u2 = u; v2 = v; swap2 = 0; } b2 = ij2k(u2, v2, sub->degree); b = 2 * b2 + swap2; #if 0 cout << "induced_action_element_image_of action_on_ordered_pairs_t" << endl; cout << a << " -> " << b << endl; cout << "(" << i << "," << j << ") -> (" << u << "," << v << ")" << endl; cout << "under" << endl; sub->element_print(elt, cout); cout << endl; #endif } else if (A.type_G == base_change_t) { if (f_v) { cout << "base_change_t" << endl; } action *sub; sub = A.subaction; if (sub == NULL) { cout << "induced_action_element_image_of no subaction, type = base_change_t" << endl; exit(1); } b = sub->element_image_of(a, elt, verbose_level - 1); } else if (A.type_G == product_action_t) { if (f_v) { cout << "product_action_t" << endl; } product_action *PA; PA = A.G.product_action_data; b = PA->compute_image(&A, (INT *)elt, a, verbose_level - 1); } else { cout << "induced_action_element_image_of() type_G unknown:: type_G = " << A.type_G << endl; action_print_symmetry_group_type(cout, A.type_G); cout << "action:" << endl; A.print_info(); exit(1); } if (f_v) { cout << "induced_action_element_image_of() image of " << a << " is " << b << endl; } return b; }