⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rifo.h

📁 intel ipp4.1性能库的一些例子。
💻 H
字号:
/* (C) Copyright 1997 Albert Ludwigs University Freiburg *     Institute of Computer Science * * All rights reserved. Use of this software is permitted for  * non-commercial research purposes, and it may be copied only  * for that use.  All copies must include this copyright message. * This software is made available AS IS, and neither the authors * nor the  Albert Ludwigs University Freiburg make any warranty * about the software or its performance.  *//*  ************************************************************** * RIFO - Remove Irrelevants in Plan Generation                * ************************************************************** */#include<stdlib.h>#include<stdio.h>#include<ctype.h>#include<strings.h>#include <sys/time.h>#include <sys/types.h>#include <sys/resource.h>#include "ipp.h"/*** limits ***/#define MAXSTRLEN 256/* since sets store numbers of facts (pos+neg) and constants, we need   MAXSETSIZE > 2*gnum_relevant_facts+gconstants_table_size */#define MAXSETSIZE 4096 #define SETARSIZE 8*4*4   /* SETARSIZE = MAXSETSIZE div sizeof(long):  */#define MAX_OPS 15000/*** defines ***/#define NOELEMENT (-1) #define SAME 0/*** macros ***/#define MAX(x,y) ((x) > (y) ? (x) : (y))#define MIN(x,y) ((x) > (y) ? (y) : (x))#define equal_tokens(x,y) (!strcmp((x),(y))) /*** structures used ***//* If a bit b in members[i] is set, element no. 32*i+b is in the set */typedef struct SETTYPE {  int memcount;  unsigned long members[SETARSIZE];} settype, *settype_t;/* used to store sets of sets */typedef struct SETLIST {  settype_t item;  struct SETLIST *next;} set_elt, *set_list;/* Array element to store operator info while backchaining */typedef struct rifo_relevant_op{  char *name;  int was_selected;  int lastdepth;  short int inst_table[MAX_VARS];  short int num_vars;  set_list used_facts;  BitOperator *opnode;} *rifo_relevant_op, rifo_op_array[MAX_OPS];/* Array element to store facts and operators and relevance information */typedef struct rifo_relevant_fact{  int is_relevant;      /* 1 = relevant */  int is_initial;       /* 1 = contained in initial state */  int memcode;          /* -1 = new Fact */  int lastdepth;  set_list used_facts;} *rifo_relevant_fact, rifo_fact_array[2*MAX_RELEVANT_FACTS+MAX_CONSTANTS_TABLE];/* Array element to store indices of operators that generate a fact *//**** extern variables: *****/ extern int rifo_display_info; /* 0: RIFO turned off, 				>0: how much information about RIFO is printed out */extern int mindepth, maxdepth; /* for iterative depth-first search */extern int setlistthres; /* max no. of elements in one set */extern int unionstrategy; /* how to get one set out of a set of sets */extern int opslevel, factlevel; /* describe the different heuristics */extern rifo_op_array rel_op_array;extern rifo_fact_array rel_fct_array;/*relevant facts */extern Integers_ptr *op_lookup_table; /* operator lookup table */extern long nodes_visited;extern long memused; /* current memory usage of rifo *//* first and second part of relevant initial facts */extern settype *primary_fact_set;extern settype *secondary_fact_set; /* store loaded operators when running RIFO */extern BitOperator *save_BitOperators;extern FactInfoPair *save_initial_state;extern FactInfoPair *save_goal_state; /* prototypes *//***** prototypes: rifobackchain.c *****/void init_op_array( void );void init_fct_array( void );void init_lookup_table( void );set_list fbackchain_one_goal( int depth, int index );set_list check_constants( int depth, short int objects[MAX_VARS], short int num_objects );set_list fbackchain_goals( int depth, FactInfoPair *goals, 			   short int objects_used[MAX_VARS], short int num_objects );set_list cond_fbackchain_ops( int depth, int op_number, Effect *eff );set_list fbackchain_ops( int depth, int index );void add_relevant_objects( settype *in_set );void add_relevant_facts( settype *in_set );settype* rec_get_facts_from_eff_conds( Effect *eff ); BitOperator* find_useful_ground_ops( settype *inifactset, int *newcountp );BitOperator* rec_find_possible_ground_ops( BitOperator *current_old, int *newcountp );void find_relevant_initial_facts( void );/***** prototypes: rifoutils.c *****/void print_set_list( set_list sl, char *prefix );void FREE(int size, void *ptr); void * MALLOC(int size);void * CALLOC(int size1, int size2);BitVector * New_bit_vector(int length);FactInfoPair * New_fact_info_pair(FactInfo * pos, FactInfo * neg);FactInfo *New_FactInfo( void );Integers * New_integers(int i);BitOperator *New_BitOperator( char *name );Effect *New_Effect( void );void Free_integers( Integers *l );void Free_bit_vector(BitVector * bvec);void Free_fact_info(FactInfo * info);void Free_fact_info_pair( FactInfoPair *p );void Free_effect(Effect * effect);void Free_BitOperator( BitOperator *op );void Free_lookup_table( void );void Copy_contents_of_FactInfo( FactInfo **dst, FactInfo *src );Integers *Copy_Integers( Integers *i );Effect *Copy_effects( Effect *e );void fatal_error(char *str);BitVector * or(BitVector * a, BitVector * b);int equal_facts(FactInfoPair* f1, FactInfoPair* f2);int really_is_var(char *str);FactInfo * merge_FactInfo( FactInfo* facts1, FactInfo* facts2 );int op_list_length( BitOperator* fl);void print_op( BitOperator* op );void print_Fact_Info( FactInfoPair *facts );void save_original_ipp_information( void );void reset_original_ipp_information( void );void print_one_set(settype *set, char *prefix, int donewline);/***** prototypes: rifosets.c */settype* make_set( int member );set_list make_set_list( int member );int set_empty( settype_t s );int set_empty_list( set_list sl );settype * set_copy( settype *result, settype *set );settype * set_union( settype *result, settype *set1, settype *set2, int docount );settype * set_union_list( set_list sl, int maxsets );settype * set_insert_el( settype *result, int member );int set_member( int member, settype *set );int set_subseteq( settype *set1, settype *set2 );int set_eq( settype *set1, settype *set2 );int set_list_length( set_list sl );set_list set_copy_list( set_list list );void set_free_list( set_list list );void set_merge_into_list( set_list *sl, int *length, 			  settype *newset, int newmem );set_list rec_set_merge_lists( set_list s1, set_list s2 );set_list set_merge_lists( set_list s1, set_list s2 );set_list set_multiply_lists( set_list s1, set_list s2 );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -