771{
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789 int trInd;
792 {
793 PrintS(
"Hilbert Series:\n 0\n");
794 return;
795 }
796 int (*POS)(ideal, poly, std::vector<ideal>, std::vector<poly>, int, int);
797 if(trunDegHs != 0)
798 {
799 Print(
"\nTruncation degree = %d\n",trunDegHs);
801 }
802 else
803 {
804 if(IG_CASE)
805 {
807 {
808 WerrorS(
"wrong input: it is not an infinitely gen. case");
809 return;
810 }
813 }
814 else
816 }
817 std::vector<ideal > idorb;
818 std::vector< poly > polist;
819
820 ideal orb_init =
idInit(1, 1);
821 idorb.push_back(orb_init);
822
824
825 std::vector< std::vector<int> > posMat;
826 std::vector<int> posRow(lV,0);
827 std::vector<int> C;
828
829 int ds, is, ps;
830 unsigned long lpcnt = 0;
831
833 ideal Jwi;
834
835 while(lpcnt < idorb.size())
836 {
839 if(lpcnt >= 1 &&
idIs0(idorb[lpcnt]) ==
FALSE)
840 {
842 {
843 C.push_back(1);
844 }
845 else
846 C.push_back(0);
847 }
848 else
849 {
850 C.push_back(1);
851 }
852
854 lpcnt++;
855
856 for(is = 1; is <= lV; is++)
857 {
859
860
861
862
863
864
869
870
871
872
873
875
877 ps = (*POS)(Jwi, wi, idorb, polist, trInd, trunDegHs);
878
879 if(ps == 0)
880 {
881 posRow[is-1] = idorb.size();
882
883 idorb.push_back(Jwi);
884 polist.push_back(wi);
885 }
886 else
887 {
888 posRow[is-1]=ps-1;
891 }
892 }
893 posMat.push_back(posRow);
894 posRow.resize(lV,0);
895 }
896 int lO = C.size();
899 Print(
"\nlength of the Orbit = %d", lO);
901
902 if(odp)
903 {
904 Print(
"words description of the Orbit: \n");
905 for(is = 0; is < lO; is++)
906 {
909 }
911 PrintS(
"\nmaximal degree, #(sum_j R(w,w_j))");
913 for(is = 0; is < lO; is++)
914 {
916 {
918 }
919 else
920 {
922 }
923 }
924 }
925
926 for(is = idorb.size()-1; is >= 0; is--)
927 {
929 }
930 for(is = polist.size()-1; is >= 0; is--)
931 {
933 }
934
935 idorb.resize(0);
936 polist.resize(0);
937
938 int adjMatrix[lO][lO];
939 memset(adjMatrix, 0, lO*lO*sizeof(int));
940 int rowCount, colCount;
941 int tm = 0;
942 if(!mgrad)
943 {
944 for(rowCount = 0; rowCount < lO; rowCount++)
945 {
946 for(colCount = 0; colCount < lV; colCount++)
947 {
948 tm = posMat[rowCount][colCount];
949 adjMatrix[rowCount][tm] = adjMatrix[rowCount][tm] + 1;
950 }
951 }
952 }
953
955 int npar;
956 char** tt;
958 if(!mgrad)
959 {
960 tt=(
char**)
omAlloc(2*
sizeof(
char*));
962 npar = 1;
963 }
964 else
965 {
966 tt=(
char**)
omalloc(lV*
sizeof(
char*));
967 for(is = 0; is < lV; is++)
968 {
969 tt[is] = (
char*)
omAlloc(12*
sizeof(
char));
970 snprintf (tt[is],12, "t%d", is+1);
971 }
972 npar = lV;
973 }
974
977 char** xx = (
char**)
omAlloc(
sizeof(
char*));
981
982
983
986 poly rc;
987
988 if(!mgrad)
989 {
990 for(rowCount = 0; rowCount < lO; rowCount++)
991 {
992 for(colCount = 0; colCount < lO; colCount++)
993 {
994 if(adjMatrix[rowCount][colCount] != 0)
995 {
996 MATELEM(mR, rowCount + 1, colCount + 1) =
p_ISet(adjMatrix[rowCount][colCount],
R);
998 }
999 }
1000 }
1001 }
1002 else
1003 {
1004 for(rowCount = 0; rowCount < lO; rowCount++)
1005 {
1006 for(colCount = 0; colCount < lV; colCount++)
1007 {
1011 MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1)=
p_Add_q(rc,
MATELEM(mR, rowCount +1, posMat[rowCount][colCount]+1),
R);
1012 }
1013 }
1014 }
1015
1016 for(rowCount = 0; rowCount < lO; rowCount++)
1017 {
1018 if(C[rowCount] != 0)
1019 {
1021 }
1022 }
1023
1027
1029
1030 if(odp)
1031 {
1032 PrintS(
"\nlinear system:\n");
1033 if(!mgrad)
1034 {
1035 for(rowCount = 0; rowCount < lO; rowCount++)
1036 {
1037 Print(
"H(%d) = ", rowCount+1);
1038 for(colCount = 0; colCount < lV; colCount++)
1039 {
1043 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1044 }
1045 Print(
" %d\n", C[rowCount] );
1046 }
1047 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1048 PrintS(
"and i^th summand in the rhs of an eqn. is according\n");
1049 PrintS(
"to the right colon map corresp. to the i^th variable\n");
1050 }
1051 else
1052 {
1053 for(rowCount = 0; rowCount < lO; rowCount++)
1054 {
1055 Print(
"H(%d) = ", rowCount+1);
1056 for(colCount = 0; colCount < lV; colCount++)
1057 {
1061 Print(
"H(%d) + ", posMat[rowCount][colCount] + 1);
1062 }
1063 Print(
" %d\n", C[rowCount] );
1064 }
1065 PrintS(
"where H(1) represents the series corresp. to input ideal\n");
1066 }
1067 }
1069 posMat.resize(0);
1070 C.resize(0);
1076
1077
1078
1079
1082
1083
1084
1085
1086
1095
1097 Print(
"Hilbert series:");
1100 if(!mgrad)
1101 {
1103 }
1104 else
1105 {
1106 for(is = lV-1; is >= 0; is--)
1107
1109 }
1115}
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