912{
913
914
915
916
918 rG = rGR;
919
923
924#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
925 PrintS(
"sca_SetupQuotient(rGR, rG, bCopy)");
926
927 {
931 }
932#endif
933
934
935 if(bCopy)
936 {
937 if(
rIsSCA(rG) && (rG != rGR))
939 else
940 return false;
941 }
942
944
946
948 return false;
949
950
951
952
953
954#if OUTPUT
955 PrintS(
"sca_SetupQuotient: qring?\n");
956#endif
957
958 if(rGR->qideal ==
NULL)
959 return false;
960
961#if OUTPUT
962 PrintS(
"sca_SetupQuotient: qideal!!!\n");
963#endif
964
965
966
967
968
969 int iAltVarEnd = -1;
970 int iAltVarStart =
N+1;
971
973 const ring rBase = rG;
976
977#if OUTPUT
978 PrintS(
"sca_SetupQuotient: AltVars?!\n");
979#endif
980
981 for(
int i = 1;
i <
N;
i++)
982 {
983 for(
int j =
i + 1;
j <=
N;
j++)
984 {
986 {
987#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
988 Print(
"Nonzero D[%d, %d]\n",
i,
j);
989#endif
990 return false;
991 }
992
993
996
998 {
999 if(
i < iAltVarStart)
1001
1004 } else
1005 {
1007 {
1008#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1009 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1010#endif
1011 return false;
1012 }
1013 }
1014 }
1015 }
1016
1017#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1018 Print(
"AltVars?1: [%d, %d]\n", iAltVarStart, iAltVarEnd);
1019#endif
1020
1021
1022 if( (iAltVarEnd == -1) || (iAltVarStart == (
N+1)) )
1023 return false;
1024
1025
1026 for(
int i = 1;
i <
N;
i++)
1027 {
1028 for(
int j =
i + 1;
j <=
N;
j++)
1029 {
1032
1033 if( (iAltVarStart <=
i) && (
j <= iAltVarEnd) )
1034 {
1036 {
1037#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1038 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1039#endif
1040 return false;
1041 }
1042 }
1043 else
1044 {
1046 {
1047#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1048 Print(
"Wrong Coeff at: [%d, %d]\n",
i,
j);
1049#endif
1050 return false;
1051 }
1052 }
1053 }
1054 }
1055
1056#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1057 Print(
"AltVars!?: [%d, %d]\n", iAltVarStart, iAltVarEnd);
1058#endif
1059
1060 assume( 1 <= iAltVarStart );
1061 assume( iAltVarStart < iAltVarEnd );
1063
1064
1065
1066
1067
1070
1071
1072 const ideal idQuotient = rGR->qideal;
1073
1074
1075#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1076 PrintS(
"Analyzing quotient ideal:\n");
1078#endif
1079
1080
1081
1082
1083
1084
1086 int e = -1;
1087
1089 {
1092
1093#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1094 Print(
"AltVars!?: [%d, %d]\n",
b, e);
1095#endif
1096 }
1097
1098 for (
int i = iAltVarStart; (
i <= iAltVarEnd);
i++ )
1099 if( (
i <
b) || (
i > e) )
1100 {
1101 poly square =
p_One( rG);
1104
1105
1106
1107 square =
nc_NF(idQuotient,
NULL, square, 0, 1, rG);
1108
1109 if( square !=
NULL )
1110 {
1112 return false;
1113 }
1114 }
1115
1116#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1117 Print(
"ScaVars!: [%d, %d]\n", iAltVarStart, iAltVarEnd);
1118#endif
1119
1120
1121
1122
1123
1124 ideal tempQ =
id_KillSquares(idQuotient, iAltVarStart, iAltVarEnd, rG);
1125
1126
1127#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1130 PrintS(
"tempSCAQuotient: \n");
1132#endif
1133
1135
1137
1140
1142 rGR->GetNC()->SCAQuotient() =
NULL;
1143 else
1144 rGR->GetNC()->SCAQuotient() =
idrMoveR(tempQ, rG, rGR);
1145
1147
1148
1149#if ((defined(PDEBUG) && OUTPUT) || MYTEST)
1150 PrintS(
"SCAQuotient: \n");
1153 else
1155#endif
1156
1157 return true;
1158}
static int si_max(const int a, const int b)
static int si_min(const int a, const int b)
static FORCE_INLINE BOOLEAN n_IsMOne(number n, const coeffs r)
TRUE iff 'n' represents the additive inverse of the one element, i.e. -1.
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
bool sca_Force(ring rGR, int b, int e)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
#define MATELEM(mat, i, j)
1-based access to matrix
ideal idrMoveR(ideal &id, ring src_r, ring dest_r)
void rWrite(ring r, BOOLEAN details)