Orbiter 2022
Combinatorial Objects
partial_derivative.cpp
Go to the documentation of this file.
1/*
2 * partial_derivative.cpp
3 *
4 * Created on: Mar 12, 2019
5 * Author: betten
6 */
7
8
9
10
11
12#include "foundations.h"
13
14
15using namespace std;
16
17
18namespace orbiter {
19namespace layer1_foundations {
20namespace ring_theory {
21
22
24{
25 H = NULL;
26 Hd = NULL;
27 v = NULL;
28 variable_idx = 0;
29 mapping = NULL;
30 null();
31}
32
34{
35 freeself();
36}
37
39{
40 if (mapping) {
42 }
43 if (v) {
44 FREE_int(v);
45 }
46 null();
47}
48
50{
51}
52
55 int variable_idx,
56 int verbose_level)
57{
58 int f_v = (verbose_level >= 1);
59 int i, j, c;
60
61 if (f_v) {
62 cout << "partial_derivative::init" << endl;
63 }
70 if (Hd->degree != H->degree - 1) {
71 cout << "partial_derivative::init Hd->degree != H->degree - 1" << endl;
72 exit(1);
73 }
74 if (Hd->nb_variables != H->nb_variables) {
75 cout << "partial_derivative::init Hd->nb_variables != H->nb_variables" << endl;
76 exit(1);
77 }
78 if (Hd->q != H->q) {
79 cout << "partial_derivative::init Hd->q != H->q" << endl;
80 exit(1);
81 }
82 if (variable_idx >= H->nb_variables) {
83 cout << "partial_derivative::init variable_idx >= H->nb_variables" << endl;
84 exit(1);
85 }
86 for (i = 0; i < H->get_nb_monomials(); i++) {
87 for (j = 0; j < H->nb_variables; j++) {
88 v[j] = H->get_monomial(i, j);
89 }
90 //int_vec_copy(H->Monomials + i * H->nb_variables, H->v, H->nb_variables);
91 if (v[variable_idx] == 0) {
92 continue;
93 }
95 v[variable_idx]--;
97 mapping[i * Hd->get_nb_monomials() + j] = c;
98 }
99
100 if (f_v) {
101 cout << "partial_derivative::init done" << endl;
102 }
103
104}
105
107 int *eqn_out,
108 int verbose_level)
109{
110 int f_v = (verbose_level >= 1);
111
112 if (f_v) {
113 cout << "partial_derivative::apply" << endl;
114 }
115
117 eqn_out, H->get_nb_monomials(), Hd->get_nb_monomials());
118
119 if (f_v) {
120 cout << "partial_derivative::apply done" << endl;
121 }
122}
123
124
125}}}
126
void mult_vector_from_the_left(int *v, int *A, int *vA, int m, int n)
homogeneous polynomials of a given degree in a given number of variables over a finite field GF(q)
Definition: ring_theory.h:88
void apply(int *eqn_in, int *eqn_out, int verbose_level)
void init(homogeneous_polynomial_domain *H, homogeneous_polynomial_domain *Hd, int variable_idx, int verbose_level)
#define FREE_int(p)
Definition: foundations.h:640
#define Int_vec_zero(A, B)
Definition: foundations.h:713
#define NEW_int(n)
Definition: foundations.h:625
the orbiter library for the classification of combinatorial objects