Func* FUNC_GEN_COST_new(REAL weight, Net* net) { Func* f = FUNC_new(weight,net); FUNC_set_func_init(f, &FUNC_GEN_COST_init); FUNC_set_func_count_step(f, &FUNC_GEN_COST_count_step); FUNC_set_func_allocate(f, &FUNC_GEN_COST_allocate); FUNC_set_func_clear(f, &FUNC_GEN_COST_clear); FUNC_set_func_analyze_step(f, &FUNC_GEN_COST_analyze_step); FUNC_set_func_eval_step(f, &FUNC_GEN_COST_eval_step); FUNC_set_func_free(f, &FUNC_GEN_COST_free); FUNC_init(f); return f; }
Scope ALGcreate( char type ) { Scope s = SCOPEcreate( type ); switch( type ) { case OBJ_PROCEDURE: s->u.proc = PROC_new(); break; case OBJ_FUNCTION: s->u.func = FUNC_new(); break; case OBJ_RULE: s->u.rule = RULE_new(); break; } return s; }