void WarmCallInfo::print() const { tty->print("%s : C=%6.1f P=%6.1f W=%6.1f S=%6.1f H=%6.1f -> %p", is_cold() ? "cold" : is_hot() ? "hot " : "warm", count(), profit(), work(), size(), compute_heat(), next()); tty->cr(); if (call() != NULL) call()->dump(); }
int is_safe_to_fly(int v,int temp) { if(is_cold(temp) && is_stormy(v)) return TRUE; else return FALSE; }
// is_hot: Return true if the node should be inlined immediately. // This is true if any of the key metrics are extreme. bool WarmCallInfo::is_hot() const { assert(!is_cold(), "eliminate is_cold cases before testing is_hot"); if (count() >= HotCallCountThreshold) return true; if (profit() >= HotCallProfitThreshold) return true; if (work() <= HotCallTrivialWork) return true; if (size() <= HotCallTrivialSize) return true; return false; }
// compute_heat: float WarmCallInfo::compute_heat() const { assert(!is_cold(), "compute heat only on warm nodes"); assert(!is_hot(), "compute heat only on warm nodes"); int min_size = MAX2(0, (int)HotCallTrivialSize); int max_size = MIN2(500, (int)WarmCallMaxSize); float method_size = (size() - min_size) / MAX2(1, max_size - min_size); float size_factor; if (method_size < 0.05) size_factor = 4; // 2 sigmas better than avg. else if (method_size < 0.15) size_factor = 2; // 1 sigma better than avg. else if (method_size < 0.5) size_factor = 1; // better than avg. else size_factor = 0.5; // worse than avg. return (count() * profit() * size_factor); }
void main() { FILE *input; input=fopen("input.txt","r"); int v,temp,day; fscanf(input,"%d %d %d",&day,&v,&temp); if(is_windless(v)) printf("%dth of the month: is Windless and ",day); else if(is_windy(v)) printf("%dth of the month: is Windy and ",day); else if(is_stormy(v)) printf("%dth of the month: is a Stormy and ",day); else printf("Error in Reading File\n"); if(is_cold(temp)) printf("Cold day\n"); else if(is_warm(temp)) printf("Warm day\n"); else if(is_hot(temp)) printf("Hot day\n"); else printf("Error in Reading File!\n"); if(is_safe_to_fly) printf("Safe For Flight\n"); else printf("Dangerous For Flight\n"); }