int main(void)
{
  REAL x, y;

  x = 0.0;
  y = x / x;

  printf("y == %lf\n", y);
  printf("isnan(&y) == %d\n", F77_FUNC_(c99_isnan,C99_ISNAN)(&y));
}
  IterativeWsmpSolverInterface::~IterativeWsmpSolverInterface()
  {
    DBG_START_METH("IterativeWsmpSolverInterface::~IterativeWsmpSolverInterface()",
                   dbg_verbosity);

    // Clear WSMP's memory
    F77_FUNC_(wsmp_clear,WSMP_CLEAR)();

    delete[] IPARM_;
    delete[] DPARM_;
    delete[] a_;
  }
Esempio n. 3
0
File: cache.cpp Progetto: Vayu/PJFry
double ICache::setMu2(const double newmu2)
{
  if (newmu2 > 0 && newmu2 != mu2) {
    MinorBase::Rescale(newmu2/mu2);
    mu2=newmu2;
#ifdef USE_ONELOOP
    double mu=sqrt(mu2);
    F77_FUNC_(avh_olo_mu_set,AVH_OLO_MU_SET)(&mu);
#endif
    ICache::Clear();
    MCache::Clear();
  }
  return mu2;
}
LIS_INT lis_precon_create_saamg(LIS_SOLVER solver, LIS_PRECON precon)
{
#if defined(USE_SAAMG)
	LIS_MATRIX	A,B;
	LIS_COMMTABLE	table;
	LIS_INT			i;
	LIS_INT			unsym,sol;
	LIS_INT			err;
	LIS_REAL                theta; 
	#ifdef USE_MPI
		LIS_MPI_Fint	comm;
	#endif

	LIS_DEBUG_FUNC_IN;

	if( solver->A->matrix_type!=LIS_MATRIX_CRS )
	{
		A = solver->A;
		err = lis_matrix_duplicate(A,&B);
		if( err ) return err;
		lis_matrix_set_type(B,LIS_MATRIX_CRS);
		err = lis_matrix_convert(A,B);
		if( err ) return err;
		solver->A = B;
		lis_matrix_destroy(B);
		solver->A = A;
	}
    precon->A       = solver->A;
    precon->is_copy = LIS_FALSE;
    A               = precon->A;
	sol             = solver->options[LIS_OPTIONS_SOLVER];
	unsym           = solver->options[LIS_OPTIONS_SAAMG_UNSYM];
	theta           = solver->params[LIS_PARAMS_SAAMG_THETA - LIS_OPTIONS_LEN];


#if 0
	if( sol!=LIS_SOLVER_CG && !unsym )
	{
		unsym = LIS_TRUE;
	}
#endif

	err = lis_vector_duplicate(A,&precon->temp);
	if( err )
	{
		return err;
	}
	F77_FUNC_(finit_data_creation,FINIT_DATA_CREATION)(c_data_creation_ptr_bar);
	F77_FUNC_(finit_data_creation_unsym,FINIT_DATA_CREATION_UNSYM)(c_data_creation_unsym_ptr_bar);
	F77_FUNC_(finit_v_cycle,FINIT_V_CYCLE)(c_v_cycle_ptr_bar);
	F77_FUNC_(finit_clear_matrix,FINIT_CLEAR_MATRIX)(c_clear_matrix_ptr_bar);
	
	lis_matrix_split(A);

	#ifdef USE_MPI
		comm = MPI_Comm_c2f(A->comm);
		lis_send_recv(A->commtable,A->D->value);
		table = A->commtable;
		if( !unsym )
		{
			(*(void (*)())f_data_creation_ptr)(&A->n,&A->np,&A->L->nnz,&A->U->nnz,
				A->D->value,A->L->value,A->L->ptr,A->L->index,
				A->U->value, A->U->ptr, A->U->index,
				&table->neibpetot, table->neibpe, table->import_ptr,
				table->import_index, table->export_ptr, table->export_index,
				&table->imnnz,&table->exnnz,
				&comm, &precon->level_num,&precon->wsize, &theta);
		}
		else
		{
			(*(void (*)())f_data_creation_unsym_ptr)(&A->n,&A->np,&A->L->nnz,&A->U->nnz,
				A->D->value,A->L->value,A->L->ptr,A->L->index,
				A->U->value, A->U->ptr, A->U->index,
				&table->neibpetot, table->neibpe, table->import_ptr,
				table->import_index, table->export_ptr, table->export_index,
				&table->imnnz,&table->exnnz,
				&comm, &precon->level_num,&precon->wsize, &theta);
		}
	#else
		if( !unsym )
		{
			(*(void (*)())f_data_creation_ptr)(&A->n,&A->L->nnz,&A->U->nnz,
				A->D->value,A->L->value,A->L->ptr,A->L->index,
				A->U->value, A->U->ptr, A->U->index, &precon->level_num, &theta);
		}
		else
		{
			(*(void (*)())f_data_creation_unsym_ptr)(&A->n,&A->L->nnz,&A->U->nnz,
				A->D->value,A->L->value,A->L->ptr,A->L->index,
				A->U->value, A->U->ptr, A->U->index, &precon->level_num, &theta);
		}
	#endif

	LIS_DEBUG_FUNC_OUT;
    return LIS_SUCCESS;
#else
	LIS_DEBUG_FUNC_IN;

    precon->A       = solver->A;
    precon->is_copy = LIS_FALSE;

	LIS_DEBUG_FUNC_OUT;
    return LIS_SUCCESS;
#endif
}