1975{
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993 int trInd;
1996 {
1997 PrintS(
"Hilbert Series:\n 0\n");
1998 return;
1999 }
2000 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
2001 if(trunDegHs != 0)
2002 {
2003 Print(
"\nTruncation degree = %d\n",trunDegHs);
2005 }
2006 else
2007 {
2008 if(IG_CASE)
2009 {
2011 {
2012 WerrorS(
"wrong input: it is not an infinitely gen. case");
2013 return;
2014 }
2017 }
2018 else
2020 }
2021 std::vector<ideal > idorb;
2022 std::vector< poly > polist;
2023
2024 ideal orb_init =
idInit(1, 1);
2025 idorb.push_back(orb_init);
2026
2028
2029 std::vector< std::vector<int> > posMat;
2030 std::vector<int> posRow(lV,0);
2031 std::vector<int> C;
2032
2033 int ds, is, ps;
2034 unsigned long lpcnt = 0;
2035
2037 ideal Jwi;
2038
2039 while(lpcnt < idorb.size())
2040 {
2043 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
2044 {
2046 {
2047 C.push_back(1);
2048 }
2049 else
2050 C.push_back(0);
2051 }
2052 else
2053 {
2054 C.push_back(1);
2055 }
2056
2058 lpcnt++;
2059
2060 for(is = 1; is <= lV; is++)
2061 {
2063
2064
2065
2066
2067
2068
2073
2074
2075
2076
2077
2079
2081 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
2082
2083 if(ps == 0)
2084 {
2085 posRow[is-1] = idorb.size();
2086
2087 idorb.push_back(Jwi);
2088 polist.push_back(wi);
2089 }
2090 else
2091 {
2092 posRow[is-1]=ps-1;
2095 }
2096 }
2097 posMat.push_back(posRow);
2098 posRow.resize(lV,0);
2099 }
2100 int lO = C.size();
2103 Print(
"\nlength of the Orbit = %d", lO);
2105
2106 if(odp)
2107 {
2108 Print(
"words description of the Orbit: \n");
2109 for(is = 0; is < lO; is++)
2110 {
2113 }
2115 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
2117 for(is = 0; is < lO; is++)
2118 {
2119 if(
idIs0(idorb[is]))
2120 {
2122 }
2123 else
2124 {
2126 }
2127 }
2128 }
2129
2130 for(is = idorb.size()-1; is >= 0; is--)
2131 {
2133 }
2134 for(is = polist.size()-1; is >= 0; is--)
2135 {
2137 }
2138
2139 idorb.resize(0);
2140 polist.resize(0);
2141
2142 int adjMatrix[lO][lO];
2143 memset(adjMatrix, 0, lO*lO*sizeof(int));
2144 int rowCount, colCount;
2145 int tm = 0;
2146 if(!mgrad)
2147 {
2148 for(rowCount = 0; rowCount < lO; rowCount++)
2149 {
2150 for(colCount = 0; colCount < lV; colCount++)
2151 {
2152 tm = posMat[rowCount][colCount];
2153 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
2154 }
2155 }
2156 }
2157
2159 int npar;
2160 char** tt;
2162 if(!mgrad)
2163 {
2164 tt=(
char**)
omAlloc(
sizeof(
char*));
2166 npar = 1;
2167 }
2168 else
2169 {
2170 tt=(
char**)
omalloc(lV*
sizeof(
char*));
2171 for(is = 0; is < lV; is++)
2172 {
2173 tt[is] = (
char*)
omAlloc(7*
sizeof(
char));
2174 sprintf (tt[is], "t%d", is+1);
2175 }
2176 npar = lV;
2177 }
2178
2181 char** xx = (
char**)
omAlloc(
sizeof(
char*));
2185
2186
2187
2190 poly rc;
2191
2192 if(!mgrad)
2193 {
2194 for(rowCount = 0; rowCount < lO; rowCount++)
2195 {
2196 for(colCount = 0; colCount < lO; colCount++)
2197 {
2198 if(adjMatrix[rowCount][colCount] != 0)
2199 {
2200 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
2202 }
2203 }
2204 }
2205 }
2206 else
2207 {
2208 for(rowCount = 0; rowCount < lO; rowCount++)
2209 {
2210 for(colCount = 0; colCount < lV; colCount++)
2211 {
2215 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
2216 }
2217 }
2218 }
2219
2220 for(rowCount = 0; rowCount < lO; rowCount++)
2221 {
2222 if(C[rowCount] != 0)
2223 {
2225 }
2226 }
2227
2231
2233
2234 if(odp)
2235 {
2236 PrintS(
"\nlinear system:\n");
2237 if(!mgrad)
2238 {
2239 for(rowCount = 0; rowCount < lO; rowCount++)
2240 {
2241 Print(
"H(%d) = ", rowCount+1);
2242 for(colCount = 0; colCount < lV; colCount++)
2243 {
2247 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
2248 }
2249 Print(
" %d\n", C[rowCount] );
2250 }
2251 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
2252 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
2253 PrintS(
"to the right colon map corresp. to the i^th variable\n");
2254 }
2255 else
2256 {
2257 for(rowCount = 0; rowCount < lO; rowCount++)
2258 {
2259 Print(
"H(%d) = ", rowCount+1);
2260 for(colCount = 0; colCount < lV; colCount++)
2261 {
2265 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
2266 }
2267 Print(
" %d\n", C[rowCount] );
2268 }
2269 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
2270 }
2271 }
2273 posMat.resize(0);
2274 C.resize(0);
2280
2281
2282
2283
2286
2287
2288
2289
2290
2299
2301 Print(
"Hilbert series:");
2304 if(!mgrad)
2305 {
2307 }
2308 else
2309 {
2310 for(is = lV-1; is >= 0; is--)
2311
2313 }
2319}
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
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 trunDegHs)
#define idDelete(H)
delete an 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.
static poly p_Add_q(poly p, poly q, const ring r)
static number p_SetCoeff(poly p, number n, 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)
struct for passing initialization parameters to naInitChar