47 if (t_ < parent_->
t_) {
66 for (
i = 0;
i < level; ++
i) {
92 tpool_ =
new TQItemPool(1000);
97 #if COLLECT_TQueue_STATISTICS
142 #if !FAST_LEAST || DOCHECK
146 for (; b->left_; b = b->left_) {
192 double tmin = -1e9, tmax = 1e9;
195 }
else if (
i->parent_ &&
i->parent_->right_ ==
i) {
196 tmin =
i->parent_->t_;
199 tmax =
i->right_->t_;
200 }
else if (
i->parent_ &&
i->parent_->left_ ==
i) {
201 tmax =
i->parent_->t_;
203 if ( tmin <= tnew && tnew < tmax) {
220 for (b =
root_; b;) {
226 }
else if (t < b->t_) {
232 Printf(
"couldn't find %g\n",
t);
254 check(
"begin remove1");
262 bool doweight =
true;
311 }
else if (
i->right_) {
317 (*child)->parent_ =
p;
340 check(
"end remove1");
348 if (!
p->parent_->check())
349 Printf(
"p->parent failed start\n");
352 Printf(
"p failed at start\n");
354 Printf(
"b failed at start\n");
357 if (
p->parent_->left_ ==
p) {
358 p->parent_->left_ = b;
360 p->parent_->right_ = b;
373 p->left_->parent_ =
p;
379 p->right_->parent_ =
p;
382 p->w_ =
p->wleft() +
p->wright() + 1;
385 Printf(
"b->parent failed end\n");
388 Printf(
"p failed at end\n");
390 Printf(
"b failed at end\n");
405 check(
"begin insert1");
408 if (!
least_ || t < least_->t_) {
445 for (
p =
i->parent_;
p;
p =
p->parent_) {
448 for (
p =
i->parent_;
p;) {
449 if (
p->unbalanced()) {
455 check(
"end insert1");
459 int balance, dbalance;
463 if (balance < -(
wright() + 1)) {
468 if (balance >
wleft() + 1) {
478 #if COLLECT_TQueue_STATISTICS
479 Printf(
"insertions=%lu moves=%lu fastmoves=%lu removals=%lu calls to least=%lu\n",
488 Printf(
"Turn on COLLECT_TQueue_STATISTICS_ in tqueue.h\n");
static void deleteitem(TQItem *i)
static void prnt(const TQItem *b, int level)
static void chk(TQItem *b, int level)
void t_iterate(void(*)(const TQItem *, int), int)
void deleteitem(TQItem *)
void insert1(double t, TQItem *)
void check(const char *errmess)
void move(TQItem *, double tnew)
void forall_callback(void(*)(const TQItem *, int))
TQItem * insert(double t, void *data_)
void move_least(double tnew)
void hoc_execerror(const char *, const char *)
static const char * errmess_