2013{
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031 int trInd;
2034 {
2035 PrintS(
"Hilbert Series:\n 0\n");
2036 return;
2037 }
2038 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
2039 if(trunDegHs != 0)
2040 {
2041 Print(
"\nTruncation degree = %d\n",trunDegHs);
2043 }
2044 else
2045 {
2046 if(IG_CASE)
2047 {
2049 {
2050 WerrorS(
"wrong input: it is not an infinitely gen. case");
2051 return;
2052 }
2055 }
2056 else
2058 }
2059 std::vector<ideal > idorb;
2060 std::vector< poly > polist;
2061
2062 ideal orb_init =
idInit(1, 1);
2063 idorb.push_back(orb_init);
2064
2066
2067 std::vector< std::vector<int> > posMat;
2068 std::vector<int> posRow(lV,0);
2069 std::vector<int> C;
2070
2071 int ds, is, ps;
2072 unsigned long lpcnt = 0;
2073
2075 ideal Jwi;
2076
2077 while(lpcnt < idorb.size())
2078 {
2081 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
2082 {
2084 {
2085 C.push_back(1);
2086 }
2087 else
2088 C.push_back(0);
2089 }
2090 else
2091 {
2092 C.push_back(1);
2093 }
2094
2096 lpcnt++;
2097
2098 for(is = 1; is <= lV; is++)
2099 {
2101
2102
2103
2104
2105
2106
2111
2112
2113
2114
2115
2117
2119 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
2120
2121 if(ps == 0)
2122 {
2123 posRow[is-1] = idorb.size();
2124
2125 idorb.push_back(Jwi);
2126 polist.push_back(wi);
2127 }
2128 else
2129 {
2130 posRow[is-1]=ps-1;
2133 }
2134 }
2135 posMat.push_back(posRow);
2136 posRow.resize(lV,0);
2137 }
2138 int lO = C.size();
2141 Print(
"\nlength of the Orbit = %d", lO);
2143
2144 if(odp)
2145 {
2146 Print(
"words description of the Orbit: \n");
2147 for(is = 0; is < lO; is++)
2148 {
2151 }
2153 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
2155 for(is = 0; is < lO; is++)
2156 {
2157 if(
idIs0(idorb[is]))
2158 {
2160 }
2161 else
2162 {
2164 }
2165 }
2166 }
2167
2168 for(is = idorb.size()-1; is >= 0; is--)
2169 {
2171 }
2172 for(is = polist.size()-1; is >= 0; is--)
2173 {
2175 }
2176
2177 idorb.resize(0);
2178 polist.resize(0);
2179
2180 int adjMatrix[lO][lO];
2181 memset(adjMatrix, 0, lO*lO*sizeof(int));
2182 int rowCount, colCount;
2183 int tm = 0;
2184 if(!mgrad)
2185 {
2186 for(rowCount = 0; rowCount < lO; rowCount++)
2187 {
2188 for(colCount = 0; colCount < lV; colCount++)
2189 {
2190 tm = posMat[rowCount][colCount];
2191 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
2192 }
2193 }
2194 }
2195
2197 int npar;
2198 char** tt;
2200 if(!mgrad)
2201 {
2202 tt=(
char**)
omAlloc(
sizeof(
char*));
2204 npar = 1;
2205 }
2206 else
2207 {
2208 tt=(
char**)
omalloc(lV*
sizeof(
char*));
2209 for(is = 0; is < lV; is++)
2210 {
2211 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
2212 sprintf (tt[is], "t%d", is+1);
2213 }
2214 npar = lV;
2215 }
2216
2219 char** xx = (
char**)
omAlloc(
sizeof(
char*));
2223
2224
2225
2228 poly rc;
2229
2230 if(!mgrad)
2231 {
2232 for(rowCount = 0; rowCount < lO; rowCount++)
2233 {
2234 for(colCount = 0; colCount < lO; colCount++)
2235 {
2236 if(adjMatrix[rowCount][colCount] != 0)
2237 {
2238 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
2240 }
2241 }
2242 }
2243 }
2244 else
2245 {
2246 for(rowCount = 0; rowCount < lO; rowCount++)
2247 {
2248 for(colCount = 0; colCount < lV; colCount++)
2249 {
2253 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
2254 }
2255 }
2256 }
2257
2258 for(rowCount = 0; rowCount < lO; rowCount++)
2259 {
2260 if(C[rowCount] != 0)
2261 {
2263 }
2264 }
2265
2269
2271
2272 if(odp)
2273 {
2274 PrintS(
"\nlinear system:\n");
2275 if(!mgrad)
2276 {
2277 for(rowCount = 0; rowCount < lO; rowCount++)
2278 {
2279 Print(
"H(%d) = ", rowCount+1);
2280 for(colCount = 0; colCount < lV; colCount++)
2281 {
2285 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
2286 }
2287 Print(
" %d\n", C[rowCount] );
2288 }
2289 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
2290 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
2291 PrintS(
"to the right colon map corresp. to the i^th variable\n");
2292 }
2293 else
2294 {
2295 for(rowCount = 0; rowCount < lO; rowCount++)
2296 {
2297 Print(
"H(%d) = ", rowCount+1);
2298 for(colCount = 0; colCount < lV; colCount++)
2299 {
2303 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
2304 }
2305 Print(
" %d\n", C[rowCount] );
2306 }
2307 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
2308 }
2309 }
2311 posMat.resize(0);
2312 C.resize(0);
2318
2319
2320
2321
2324
2325
2326
2327
2328
2337
2339 Print(
"Hilbert series:");
2342 if(!mgrad)
2343 {
2345 }
2346 else
2347 {
2348 for(is = lV-1; is >= 0; is--)
2349
2351 }
2357}
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
@ n_transExt
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
const CanonicalForm int s
void WerrorS(const char *s)
static int positionInOrbitTruncationCase(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int, int trunDegHs)
static ideal colonIdeal(ideal S, poly w, int lV, ideal Jwi, int trunDegHs)
static int positionInOrbit_FG_Case(ideal I, poly, std::vector< ideal > idorb, std::vector< poly >, int, int)
static int positionInOrbit_IG_Case(ideal I, poly w, std::vector< ideal > idorb, std::vector< poly > polist, int trInd, int)
static ideal minimalMonomialGenSet(ideal I)
#define idDelete(H)
delete an ideal
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
bool unitMatrix(const int n, matrix &unitMat, const ring R)
Creates a new matrix which is the (nxn) unit matrix, and returns true in case of success.
void luDecomp(const matrix aMat, matrix &pMat, matrix &lMat, matrix &uMat, const ring R)
LU-decomposition of a given (m x n)-matrix.
bool luSolveViaLUDecomp(const matrix pMat, const matrix lMat, const matrix uMat, const matrix bVec, matrix &xVec, matrix &H)
Solves the linear system A * x = b, where A is an (m x n)-matrix which is given by its LU-decompositi...
void mp_Delete(matrix *a, const ring r)
matrix mp_Sub(matrix a, matrix b, const ring R)
matrix mpNew(int r, int c)
create a r x c zero-matrix
#define MATELEM(mat, i, j)
1-based access to matrix
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
The main handler for Singular numbers which are suitable for Singular polynomials.
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
static poly p_Add_q(poly p, poly q, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void p_Setm(poly p, const ring r)
static number p_SetCoeff(poly p, number n, ring r)
static long p_Totaldegree(poly p, const ring r)
void rChangeCurrRing(ring r)
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void PrintS(const char *s)
ring rDefault(const coeffs cf, int N, char **n, int ord_size, rRingOrder_t *ord, int *block0, int *block1, int **wvhdl, unsigned long bitmask)
ideal idInit(int idsize, int rank)
initialise an ideal / module
struct for passing initialization parameters to naInitChar