Beispiel #1
0
inline LazyInit<T>::~LazyInit ()
{
   if (_ptr != NULL) destroy();
}
Beispiel #2
0
 UpdateComponent::~UpdateComponent()
 {
     destroy();
 }
Beispiel #3
0
 void tearDown() {
   destroy();
 }
Beispiel #4
0
int main(int argc, char *argv[]) {
   char line,c;
   int i,j,e1, e2;
   edge e;
   createList(&edgeList, sizeof(edge), NULL);
   pthread_t thread_satcnf, thread_approx_1, thread_approx_2;
      
   loop:while(scanf(" %c", &line) != EOF) {
      switch(line) {
         case 'V':
            scanf(" %d", &numNodes);

            if(numNodes <= 0) {
               fprintf(stderr,"Error: Invalid number of vertices: %d!\n", numNodes);
               goto loop;
            }

            if(edgeList.length != 0) {
               destroy(&edgeList);             
            }

            break;
         case 'E':
            scanf(" %c", &c);

            while(c != '}') {
               if(!scanf(" <%d,%d>", &e1,&e2)) goto loop;

               if( (e1 >= numNodes || e1 < 0) || (e2 >= numNodes || e2 < 0)) {
                  fprintf(stderr,"Error: Invalid edge <%d,%d>!\n", e1, e2);
                  destroy(&edgeList);
                  goto loop;
               }

               e.p1 = e1;
               e.p2 = e2;
               append(&edgeList,&e);
               scanf("%c", &c); //scan ',' or '}'
            }

            thread_function_args thread_args[N];

            /*initialize parameters for each thread function*/
            for(i=0; i<N; i++) {
               thread_args[i].numNodes = numNodes;
               thread_args[i].edgeList = &edgeList;
               thread_args[i].vc = NULL;
            }

            int iter = 1;

            #ifdef DEBUG
               iter = 10;
               double ratio1,ratio2;
               double *runTimeSatCnf = (double *)malloc(iter*sizeof(double));
               double *runTimeApprox1 = (double *)malloc(iter*sizeof(double));
               double *runTimeApprox2 = (double *)malloc(iter*sizeof(double));
            #endif

            for(j=0; j<iter; j++) {
               pthread_create(&thread_satcnf, NULL, &sat_cnf, &thread_args[0]);
               pthread_create(&thread_approx_1, NULL, &approx1, &thread_args[1]);
               pthread_create(&thread_approx_2, NULL, &approx2, &thread_args[2]);

               pthread_join(thread_satcnf, NULL);
               pthread_join(thread_approx_1, NULL);
               pthread_join(thread_approx_2, NULL);   

               #ifdef DEBUG
                  runTimeSatCnf[j] = thread_args[0].cputime;
                  runTimeApprox1[j] = thread_args[1].cputime;
                  runTimeApprox2[j] = thread_args[2].cputime;
               #endif
            }

            #ifdef DEBUG
               ratio1 = thread_args[1].vcSize / (double) thread_args[0].vcSize;
               ratio2 = thread_args[2].vcSize / (double) thread_args[0].vcSize; 

               for(j=0; j<iter; j++) {
                  //printf("%f,%f\n", runTimeApprox1[j],runTimeApprox2[j]);
                  printf("%f,%f,%f\n", runTimeSatCnf[j],runTimeApprox1[j],runTimeApprox2[j]);
                  fflush(stdout);
               }
               printf("%f,%f\n", ratio1,ratio2);
               printf("%f\n", ratio);
               fflush(stdout);

               for(i=0; i<N; i++) {
                  free(thread_args[i].vc);
               }
               free(runTimeSatCnf);
               free(runTimeApprox1);
               free(runTimeApprox2);
            #else
               const char *name[N] = {"CNF-SAT-VC", "APPROX-VC-1", "APPROX-VC-2"};
                  
               for(i=0; i<N; i++) {
                  printVC(thread_args[i].vcSize, thread_args[i].vc, name[i]);
                  free(thread_args[i].vc);
               }
            #endif

            break;   
      }
   }
   destroy(&edgeList);
}
Beispiel #5
0
GBuffer::~GBuffer() { destroy(); }
Beispiel #6
0
ShaderObject::~ShaderObject()
{
    destroy();
}
void CEffectManager::Reload()
{
	destroy();
	load(m_FileName);
}
PlayActionEffectComboInstance::~PlayActionEffectComboInstance()
{
	DEC_NDOBJ_RTCLS;
	destroy( true );
}
void PlayActionEffectComboInstance::restart()
{
	destroy(false);
	start();
}
Beispiel #10
0
 ~vector() { destroy(vec_.start_, vec_.finish_); }
	TextureManager::~TextureManager()
	{
		destroy();
	}
void InlineBox::deleteLine(RenderArena* arena)
{
    if (!m_extracted && m_renderer->isBox())
        toRenderBox(m_renderer)->setInlineBoxWrapper(0);
    destroy(arena);
}
Beispiel #13
0
ofFbo::~ofFbo() {
    destroy();
}
Beispiel #14
0
int LLL::destroy(void) {
	return destroy(head);
}
void WSHttpBinding_USCOREINWNMasterServerAPIService::reset()
{	destroy();
	soap_done(this);
	soap_init(this);
	WSHttpBinding_USCOREINWNMasterServerAPIService_init(SOAP_IO_DEFAULT, SOAP_IO_DEFAULT);
}
Beispiel #16
0
	~ObjectPool()
	{
		destroy();
	}	
Beispiel #17
0
xhn::context::~context()
{
    destroy();
}
Beispiel #18
0
VirusMonitor::Gui::Window::~Window()
{
  destroy();
}
Beispiel #19
0
ShaderProgram::~ShaderProgram()
{
    destroy();
}
Beispiel #20
0
		//-----------------------------------------------------------------//
		~widget_director() { destroy(); }
Beispiel #21
0
LightPassShader::~LightPassShader()
{
	destroy();
}
/*
 *  Destroys the object and frees any allocated resources
 */
CQOptimizationWidget::~CQOptimizationWidget()
{
  destroy();
  // no need to delete child widgets, Qt does it all for us
}
void main()
{
	link_list mylist;

	init_list(&mylist);

	int select = 1;
	elem_type item;
	node *p = NULL;
	while(select)
	{
		printf("*************************************************\n");
		printf("*  [1] push_back	 [2] push_front 	*\n");
		printf("*  [3] show_list	 [4] pop_back    	*\n");
		printf("*  [5] pop_front	 [6] insert_val 	*\n");
		printf("*  [7] find 	 	 [8] get_length 	*\n");
		printf("*  [9] delete_val	 [10] sort   	 	*\n");
		printf("*  [11] resever		 [12] clear 	 	*\n");
		printf("*  [13*] destroy	 [0] quit_system 	*\n");
		printf("*  [14] prior_node 	 [15] next_node 	*\n");
		printf("*************************************************\n");

		printf("请选择操作选项:> ");
		scanf("%d", &select);

		if(select == 0)
			break;

		switch(select)
		{
			case 1:
				printf("请输入要插入的数据(-1结束):>");
				while(scanf("%d", &item), item != -1)
				{
					push_back(&mylist, item);
				}
				break;
			case 2:
				printf("请输入要插入的数据(头插法, -1结束);>");
				while(scanf("%d", &item), item != -1)
				{
					push_front(&mylist, item);
				}
				break;
			case 3:
				show_list(&mylist);
				break;
			case 4:
				pop_back(&mylist);
				break;
			case 5:
				pop_front(&mylist);
				break;
			case 6:
				printf("请输入要插入的数据:>");
				scanf("%d", &item);
				insert_val(&mylist, item);
				break;
			case 7:
				printf("请输入要查找的数据:>");
				scanf("%d", &item);
				p = find(&mylist, item);
				if (p == NULL)
				{
					printf("要查找的数据在单链表中不存在.");
				}
				else
				 	printf("在单链表查找到数据: %d\n", p->data);
				break;
			case 8:
				printf("单链表的长度为: %d\n", get_length(&mylist));
				break;
			case 9:
				printf("请输入要删除的值:> ");
				scanf("%d", &item);
				delete_val(&mylist, item);
				break;
			case 10:
				sort(&mylist);
				break;
			case 11:
				resver(&mylist);
				break;
			case 12:
				clear(&mylist);
				break;
			case 14:
				printf("请输入要查找的数据:>");
				scanf("%d", &item);
				p = prior_node(&mylist, item);
				if (p == NULL || p == (&mylist)->head)
				{
					printf("要查找的数据在单链表中不存在前驱.\n");
				}
				else
				{
			 	 	printf("要查找的数据在单链表中的前驱为:%d.\n", p->data);	
				}
				break;
 	 	 	case 15:
				printf("请输入要查找的数据:>");
				scanf("%d", &item);
				p = next_node(&mylist, item);
				if (p == NULL)
				{
					printf("要查找的数据在单链表中不存在后继.\n");
				}
				else
				{
			 	 	printf("要查找的数据在单链表中的后继为:%d.\n", p->data);	
				}
				break;

			default:
				printf("输入的选择有误,请重新输入.\n");
				break;
		}
	}
	destroy(&mylist);
}
AlignedBlockAllocator::~AlignedBlockAllocator()
{
    destroy();
    m_chunk.Close();
    delete [] m_map.bits;
}
ClConstraint::~ClConstraint()
{ 
  destroy(*cpars);
  delete cpars;
  delete cexpr;
}
	AnimationStateController::~AnimationStateController(void)
	{
		destroy();
	}
Beispiel #27
0
HuffTree::~HuffTree()
{
	destroy(root);
}
	// 创建
	void AnimationStateController::create(const String &name , AnimationState* state)
	{
		destroy();
		m_state = state;
		m_name = name;
	}
Beispiel #29
0
QEglContext::~QEglContext()
{
    destroy();
}
Beispiel #30
0
BSOCK_SCTP::~BSOCK_SCTP()
{
   destroy();
}