Macaulay2 Engine
Loading...
Searching...
No Matches

◆ start_computation()

enum ComputationStatusCode F4GB::start_computation ( StopConditions & stop_)

Definition at line 1130 of file f4.cpp.

1131{
1133 clock_gauss = 0;
1135 int npairs = 0;
1136
1137 // test_spair_code();
1138
1140
1141 for (;;)
1142 {
1143 if (system_interrupted())
1144 {
1145 is_done = COMP_INTERRUPTED;
1146 break;
1147 }
1148
1149 is_done = computation_is_complete(stop_);
1150 if (is_done != COMP_COMPUTING) break;
1151
1152 //this_degree = mSPairSet.prepare_next_degree(-1, npairs);
1153 auto thisDegInfo = mSPairSet.setThisDegree();
1154
1155 if (not thisDegInfo.first)
1156 {
1157 is_done = COMP_DONE;
1158 break;
1159 }
1160
1161 this_degree = thisDegInfo.second;
1162
1163 if (stop_.stop_after_degree && this_degree > stop_.degree_limit->array[0])
1164 {
1165 is_done = COMP_DONE_DEGREE_LIMIT;
1166 break;
1167 }
1168
1169 if (hilbert)
1170 {
1171 if (!hilbert->setDegree(this_degree))
1172 {
1173 if (error())
1174 is_done = COMP_ERROR;
1175 else
1176 is_done = COMP_INTERRUPTED;
1177 break;
1178 }
1179 }
1180
1181 if (M2_gbTrace >= 1)
1182 {
1183 if (hilbert)
1184 fprintf(stderr,
1185 "DEGREE %d (nexpected %d npairs %d)\n",
1187 hilbert->nRemainingExpected(),
1188 npairs);
1189 else
1190 fprintf(stderr, "DEGREE %d (npairs %d)\n", this_degree, npairs);
1191 }
1192 do_spairs();
1194 }
1195
1196 if (M2_gbTrace >= 2)
1197 {
1198 // fprintf(stderr,
1199 // "number of calls to cancel row : %ld\n",
1200 // mGausser->n_dense_row_cancel);
1201 // fprintf(stderr,
1202 // "number of calls to subtract_multiple: %ld\n",
1203 // mGausser->n_subtract_multiple);
1204 fprintf(
1205 stderr, "total time for sorting columns: %f\n", clock_sort_columns);
1206 fprintf(stderr,
1207 "total time for making matrix (includes sort): %f\n",
1208 ((double)clock_make_matrix) / CLOCKS_PER_SEC);
1209 fprintf(stderr,
1210 "total time for gauss: %f\n",
1211 ((double)clock_gauss) / CLOCKS_PER_SEC);
1212 fprintf(stderr,
1213 "parallel tbb time for gauss: %g\n",
1215 fprintf(stderr,
1216 "serial tbb time for gauss: %g\n",
1218 fprintf(stderr,
1219 "total time for finding new spairs: %g\n",
1221 fprintf(stderr,
1222 "total time for creating pre spairs: %g\n",
1223 mSPairSet.secondsToCreatePrePairs());
1224 fprintf(stderr,
1225 "total time for minimizing new spairs: %g\n",
1226 mSPairSet.secondsToMinimizePairs());
1227 fprintf(stderr,
1228 "total time for inserting new gb elements: %g\n",
1230 fprintf(stderr,
1231 "number of spairs computed : %ld\n",
1233 fprintf(stderr,
1234 "number of reduction steps : %ld\n",
1236 if (M2_gbTrace >= 3)
1237 {
1238 fprintf(stderr,
1239 "number of spairs removed by criterion = %ld\n",
1240 mSPairSet.n_unneeded_pairs());
1241 mMonomialInfo->show();
1242 }
1243 }
1244
1245 return is_done;
1246}
double mNewSPairTime
Definition f4.hpp:200
double mSerialGaussTime
Definition f4.hpp:198
clock_t clock_gauss
Definition f4.hpp:195
int complete_thru_this_degree
Definition f4.hpp:170
F4SPairSet mSPairSet
Definition f4.hpp:249
clock_t clock_make_matrix
Definition f4.hpp:202
HilbertController * hilbert
Definition f4.hpp:175
long n_pairs_computed
Definition f4.hpp:166
void do_spairs()
Definition f4.cpp:1008
const MonomialInfo * mMonomialInfo
Definition f4.hpp:157
double mInsertGBTime
Definition f4.hpp:201
enum ComputationStatusCode computation_is_complete(StopConditions &stop_)
Definition f4.cpp:1092
int this_degree
Definition f4.hpp:171
double clock_sort_columns
Definition f4.hpp:194
double mParallelGaussTime
Definition f4.hpp:197
long n_reduction_steps
Definition f4.hpp:167
ComputationStatusCode
Definition computation.h:53
@ COMP_DONE
Definition computation.h:60
@ COMP_ERROR
Definition computation.h:56
@ COMP_DONE_DEGREE_LIMIT
Definition computation.h:61
@ COMP_COMPUTING
Definition computation.h:71
@ COMP_INTERRUPTED
Definition computation.h:57
int error()
Definition error.c:48
bool system_interrupted()
int M2_gbTrace
Definition m2-types.cpp:52
M2_bool stop_after_degree
Definition computation.h:92
M2_arrayint degree_limit
Definition computation.h:93

References clock_gauss, clock_make_matrix, clock_sort_columns, COMP_COMPUTING, COMP_DONE, COMP_DONE_DEGREE_LIMIT, COMP_ERROR, COMP_INTERRUPTED, complete_thru_this_degree, computation_is_complete(), StopConditions::degree_limit, do_spairs(), error(), hilbert, M2_gbTrace, mInsertGBTime, mMonomialInfo, mNewSPairTime, mParallelGaussTime, mSerialGaussTime, mSPairSet, n_pairs_computed, n_reduction_steps, StopConditions::stop_after_degree, system_interrupted(), and this_degree.