当前位置: 首页>>代码示例>>C++>>正文


C++ KINProcessError函数代码示例

本文整理汇总了C++中KINProcessError函数的典型用法代码示例。如果您正苦于以下问题:C++ KINProcessError函数的具体用法?C++ KINProcessError怎么用?C++ KINProcessError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了KINProcessError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: KINDlsSetBandJacFn

int KINDlsSetBandJacFn(void *kinmem, KINDlsBandJacFn jac)
{
    KINMem kin_mem;
    KINDlsMem kindls_mem;

    /* Return immediately if kinmem is NULL */
    if (kinmem == NULL)
    {
        KINProcessError(NULL, KINDLS_MEM_NULL, "KINDLS", "KINDlsSetBandJacFn", MSGD_KINMEM_NULL);
        return(KINDLS_MEM_NULL);
    }
    kin_mem = (KINMem) kinmem;

    if (lmem == NULL)
    {
        KINProcessError(kin_mem, KINDLS_LMEM_NULL, "KINDLS", "KINDlsSetBandJacFn", MSGD_LMEM_NULL);
        return(KINDLS_LMEM_NULL);
    }
    kindls_mem = (KINDlsMem) lmem;

    if (jac != NULL)
    {
        jacDQ = FALSE;
        bjac = jac;
    }
    else
    {
        jacDQ = TRUE;
    }

    return(KINDLS_SUCCESS);
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:32,代码来源:kinsol_direct.c

示例2: KINSetEtaParams

int KINSetEtaParams(void *kinmem, realtype egamma, realtype ealpha)
{
  KINMem kin_mem;

  if (kinmem == NULL) {
    KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetEtaParams", MSG_NO_MEM);
    return(KIN_MEM_NULL);
  }

  kin_mem = (KINMem) kinmem;

  if ((ealpha <= ONE) || (ealpha > TWO))
    if (ealpha != ZERO) {
      KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetEtaParams", MSG_BAD_ALPHA);
      return(KIN_ILL_INPUT);
    }
  
  if (ealpha == ZERO) 
    kin_mem->kin_eta_alpha = TWO;
  else
    kin_mem->kin_eta_alpha = ealpha;

  if ((egamma <= ZERO) || (egamma > ONE))
    if (egamma != ZERO) {
      KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetEtaParams", MSG_BAD_GAMMA);
      return(KIN_ILL_INPUT);
    }

  if (egamma == ZERO)
    kin_mem->kin_eta_gamma = POINT9;
  else
    kin_mem->kin_eta_gamma = egamma;

  return(KIN_SUCCESS);
}
开发者ID:A1kmm,项目名称:modml-solver,代码行数:35,代码来源:kinsol_io.c

示例3: KINKluSetOrderingFn

/*
 * Allow the user to specify a matrix permutation function for KLU in place
 * of, for example, AMD. 
 */
int KINKluSetOrderingFn(void *kin_memory, KINKluOrderingFn ordering_fun){
	
	//create KINSOL and KINKlu memory blocks.
	KINMem kin_mem;
	KINKluMem kin_klu_mem;
	
	//check that the KINSOL memory block is not null.
	if(!kin_memory){
		KINProcessError(NULL, KINDLS_MEM_NULL, "KINKLU", "KINKluSetOrderingFn", MSGD_KINMEM_NULL);
		return(KINDLS_MEM_NULL);
	}
	
	//cast it if it's not
	kin_mem = (KINMem) kin_memory;
	
	//check if the klu memory block is null
	if(!kin_mem->kin_lmem){
		KINProcessError(NULL, KINDLS_MEM_NULL, "KINKLU", "KINKluSetOrderingJacFn", MSGD_KINMEM_NULL);
		return(KINDLS_MEM_NULL);
	}
	
	//if not, grab it
	kin_klu_mem = (KINKluMem)kin_mem->kin_lmem;
	
	//set the klu memory block's ordering function to the one passed in
	kin_klu_mem->klu_comm.user_order = ordering_fun;
	
	//return with triumphant success
	return(KINDLS_SUCCESS);
}
开发者ID:phines,项目名称:cosmic,代码行数:34,代码来源:kin_klu.c

示例4: KINSetScaledStepTol

int KINSetScaledStepTol(void *kinmem, realtype scsteptol)
{
  KINMem kin_mem;
  realtype uround;

  if (kinmem == NULL) {
    KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetScaledStepTol", MSG_NO_MEM);
    return(KIN_MEM_NULL);
  }

  kin_mem = (KINMem) kinmem;

  if (scsteptol < ZERO) {
    KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetScaledStepTol", MSG_BAD_SCSTEPTOL);
    return(KIN_ILL_INPUT);
  }

  if (scsteptol == ZERO) {
    uround = kin_mem->kin_uround;
    kin_mem->kin_scsteptol = RPowerR(uround,TWOTHIRDS);
  } else {
    kin_mem->kin_scsteptol = scsteptol;
  }

  return(KIN_SUCCESS);
}
开发者ID:A1kmm,项目名称:modml-solver,代码行数:26,代码来源:kinsol_io.c

示例5: KINSpilsSetMaxRestarts

int KINSpilsSetMaxRestarts(void *kinmem, int maxrs)
{
  KINMem kin_mem;
  KINSpilsMem kinspils_mem;

  /* return immediately if kinmem is NULL */

  if (kinmem == NULL) {
    KINProcessError(NULL, KINSPILS_MEM_NULL, "KINSPILS", "KINSpilsSetMaxRestarts", MSGS_KINMEM_NULL);
    return(KINSPILS_MEM_NULL);
  }
  kin_mem = (KINMem) kinmem;

  if (lmem == NULL) {
    KINProcessError(kin_mem, KINSPILS_LMEM_NULL, "KINSPILS", "KINSpilsSetMaxRestarts", MSGS_LMEM_NULL);
    return(KINSPILS_LMEM_NULL);
  }
  kinspils_mem = (KINSpilsMem) lmem;

  /* check for legal maxrs */

  if (maxrs < 0) {
    KINProcessError(kin_mem, KINSPILS_ILL_INPUT, "KINSPILS", "KINSpilsSetMaxRestarts", MSGS_NEG_MAXRS);
    return(KINSPILS_ILL_INPUT);
  }
  kinspils_mem->s_maxlrst = maxrs;

  return(KINSPILS_SUCCESS);
}
开发者ID:OpenCMISS-Dependencies,项目名称:libcellml,代码行数:29,代码来源:kinsol_spils.c

示例6: KINDlsGetWorkSpace

int KINDlsGetWorkSpace(void *kinmem, long int *lenrwLS, long int *leniwLS)
{
    KINMem kin_mem;
    KINDlsMem kindls_mem;

    /* Return immediately if kinmem is NULL */
    if (kinmem == NULL)
    {
        KINProcessError(NULL, KINDLS_MEM_NULL, "KINDLS", "KINBandGetWorkSpace", MSGD_KINMEM_NULL);
        return(KINDLS_MEM_NULL);
    }
    kin_mem = (KINMem) kinmem;

    if (lmem == NULL)
    {
        KINProcessError(kin_mem, KINDLS_LMEM_NULL, "KINDLS", "KINBandGetWorkSpace", MSGD_LMEM_NULL);
        return(KINDLS_LMEM_NULL);
    }
    kindls_mem = (KINDlsMem) lmem;

    if (mtype == SUNDIALS_DENSE)
    {
        *lenrwLS = n * n;
        *leniwLS = n;
    }
    else if (mtype == SUNDIALS_BAND)
    {
        *lenrwLS = n * (smu + mu + 2 * ml + 2);
        *leniwLS = n;
    }

    return(KINDLS_SUCCESS);
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:33,代码来源:kinsol_direct.c

示例7: KINSlsGetLastFlag

/*
 * KINSlsGetLastFlag returns the last flag set in a KINSLS function.
 */
int KINSlsGetLastFlag(void *kin_mem_v, long int *flag)
{
  KINMem kin_mem;
  KINSlsMem kinsls_mem;

  kin_mem= (KINMem) kin_mem_v;

  /* Return immediately if kin_mem is NULL */
  if (kin_mem == NULL) {
    KINProcessError(NULL, KINSLS_MEM_NULL, "KINSLS", "KINSlsGetLastFlag", 
		    MSGSP_KINMEM_NULL);
    return(KINSLS_MEM_NULL);
  }

  if (kin_mem->kin_lmem == NULL) {
    KINProcessError(kin_mem, KINSLS_LMEM_NULL, "KINSLS", 
		    "KINSlsGetLastFlag", MSGSP_LMEM_NULL);
    return(KINSLS_LMEM_NULL);
  }
  kinsls_mem = (KINSlsMem) kin_mem->kin_lmem;

  *flag = kinsls_mem->s_last_flag;

  return(KINSLS_SUCCESS);
}
开发者ID:MaveriQ,项目名称:AMICI,代码行数:28,代码来源:kinsol_sparse.c

示例8: KINKluSetSparseJacFn

/*
 * Allows the user to specify a sparse Jacobian evaluation function for
 * use with KLU.
 */
int KINKluSetSparseJacFn(void *kin_memory, KINKluSparseJacFn jac_fun){
	
	//create KINSOL and KINKlu memory blocks.
	KINMem kin_mem;
	KINKluMem kin_klu_mem;
	
	//check that the KINSOL memory block is not null.
	if (!kin_memory) {
		KINProcessError(NULL, KINDLS_MEM_NULL, "KINKLU", "KINKluSetSparseJacFn", MSGD_KINMEM_NULL);
		return(KINDLS_MEM_NULL);
	}
	
	//grab it if okay
	kin_mem=(KINMem)kin_memory;
	
	//check if the klu memory block is null
	if(!kin_mem->kin_lmem){
		KINProcessError(NULL, KINDLS_MEM_NULL, "KINKLU", "KINKluSetSparseJacFn", MSGD_KINMEM_NULL);
		return(KINDLS_MEM_NULL);
	}
	
	//if not, grab it
	kin_klu_mem=(KINKluMem)kin_mem->kin_lmem;
	
	//now attach the jacobian function to the klu memory block
	kin_klu_mem->jac_fun=jac_fun;
	
	//return
	return(KINDLS_SUCCESS);
}
开发者ID:phines,项目名称:cosmic,代码行数:34,代码来源:kin_klu.c

示例9: KINSpilsSetPreconditioner

int KINSpilsSetPreconditioner(void *kinmem,
			      KINSpilsPrecSetupFn pset, KINSpilsPrecSolveFn psolve)
{
  KINMem kin_mem;
  KINSpilsMem kinspils_mem;

  /* return immediately if kinmem is NULL */

  if (kinmem == NULL) {
    KINProcessError(NULL, KINSPILS_MEM_NULL, "KINSPILS", "KINSpilsSetPreconditioner", MSGS_KINMEM_NULL);
    return(KINSPILS_MEM_NULL);
  }
  kin_mem = (KINMem) kinmem;

  if (lmem == NULL) {
    KINProcessError(kin_mem, KINSPILS_LMEM_NULL, "KINSPILS", "KINSpilsSetPreconditioner", MSGS_LMEM_NULL);
    return(KINSPILS_LMEM_NULL);
  }
  kinspils_mem = (KINSpilsMem) lmem;

  kinspils_mem->s_pset   = pset;
  kinspils_mem->s_psolve = psolve;

  return(KINSPILS_SUCCESS);
}
开发者ID:OpenCMISS-Dependencies,项目名称:libcellml,代码行数:25,代码来源:kinsol_spils.c

示例10: KINSpilsSetJacTimesVecFn

int KINSpilsSetJacTimesVecFn(void *kinmem, KINSpilsJacTimesVecFn jtv)

{
  KINMem kin_mem;
  KINSpilsMem kinspils_mem;

  /* return immediately if kinmem is NULL */

  if (kinmem == NULL) {
    KINProcessError(NULL, KINSPILS_MEM_NULL, "KINSPILS", "KINSpilsSetJacTimesVecFn", MSGS_KINMEM_NULL);
    return(KINSPILS_MEM_NULL);
  }
  kin_mem = (KINMem) kinmem;

  if (lmem == NULL) {
    KINProcessError(kin_mem, KINSPILS_LMEM_NULL, "KINSPILS", "KINSpilsSetJacTimesVecFn", MSGS_LMEM_NULL);
    return(KINSPILS_LMEM_NULL);
  }
  kinspils_mem = (KINSpilsMem) lmem;

  if (jtv != NULL) {
    jtimesDQ = FALSE;
    jtimes = jtv;
  } else {
    jtimesDQ = TRUE;
  }

  return(KINSPILS_SUCCESS);
}
开发者ID:OpenCMISS-Dependencies,项目名称:libcellml,代码行数:29,代码来源:kinsol_spils.c

示例11: KINSlsSetSparseJacFn

/*
 * KINSlsSetSparseJacFn specifies the sparse Jacobian function.
 */
int KINSlsSetSparseJacFn(void *kin_mem_v, KINSlsSparseJacFn jac)
{
  KINMem kin_mem;
  KINSlsMem kinsls_mem;

  kin_mem = (KINMem) kin_mem_v;

  /* Return immediately if kin_mem is NULL */
  if (kin_mem == NULL) {
    KINProcessError(NULL, KINSLS_MEM_NULL, "KINSLS", "KINSlsSetSparseJacFn", 
		    MSGSP_KINMEM_NULL);
    return(KINSLS_MEM_NULL);
  }

  if (kin_mem->kin_lmem == NULL) {
    KINProcessError(kin_mem, KINSLS_LMEM_NULL, "KINSLS", 
		    "KINSlsSetSparseJacFn", MSGSP_LMEM_NULL);
    return(KINSLS_LMEM_NULL);
  }
  kinsls_mem = (KINSlsMem) kin_mem->kin_lmem;

  kinsls_mem->s_jaceval = jac;

  return(KINSLS_SUCCESS);
}
开发者ID:MaveriQ,项目名称:AMICI,代码行数:28,代码来源:kinsol_sparse.c

示例12: KINBBDPrecGetWorkSpace

int KINBBDPrecGetWorkSpace(void *kinmem, long int *lenrwBBDP, long int *leniwBBDP)
{
  KINMem kin_mem;
  KINSpilsMem kinspils_mem;
  KBBDPrecData pdata;

  if (kinmem == NULL) {
    KINProcessError(NULL, KINSPILS_MEM_NULL, "KINBBDPRE", "KINBBDPrecGetWorkSpace", MSGBBD_MEM_NULL);
    return(KINSPILS_MEM_NULL);
  }
  kin_mem = (KINMem) kinmem;

  if (kin_mem->kin_lmem == NULL) {
    KINProcessError(kin_mem, KINSPILS_LMEM_NULL, "KINBBDPRE", "KINBBDPrecGetWorkSpace", MSGBBD_LMEM_NULL);
    return(KINSPILS_LMEM_NULL);
  }
  kinspils_mem = (KINSpilsMem) kin_mem->kin_lmem;

  if (kinspils_mem->s_P_data == NULL) {
    KINProcessError(kin_mem, KINSPILS_PMEM_NULL, "KINBBDPRE", "KINBBDPrecGetWorkSpace", MSGBBD_PMEM_NULL);
    return(KINSPILS_PMEM_NULL);
  } 
  pdata = (KBBDPrecData) kinspils_mem->s_P_data;

  *lenrwBBDP = pdata->rpwsize;
  *leniwBBDP = pdata->ipwsize;

  return(KINSPILS_SUCCESS);
}
开发者ID:luca-heltai,项目名称:sundials,代码行数:29,代码来源:kinsol_bbdpre.c

示例13: KINBBDPrecGetNumGfnEvals

int KINBBDPrecGetNumGfnEvals(void *kinmem, long int *ngevalsBBDP)
{
  KINMem kin_mem;
  KINSpilsMem kinspils_mem;
  KBBDPrecData pdata;

  if (kinmem == NULL) {
    KINProcessError(NULL, KINSPILS_MEM_NULL, "KINBBDPRE", "KINBBDPrecGetNumGfnEvals", MSGBBD_MEM_NULL);
    return(KINSPILS_MEM_NULL);
  }
  kin_mem = (KINMem) kinmem;

  if (kin_mem->kin_lmem == NULL) {
    KINProcessError(kin_mem, KINSPILS_LMEM_NULL, "KINBBDPRE", "KINBBDPrecGetNumGfnEvals", MSGBBD_LMEM_NULL);
    return(KINSPILS_LMEM_NULL);
  }
  kinspils_mem = (KINSpilsMem) kin_mem->kin_lmem;

  if (kinspils_mem->s_P_data == NULL) {
    KINProcessError(kin_mem, KINSPILS_PMEM_NULL, "KINBBDPRE", "KINBBDPrecGetNumGfnEvals", MSGBBD_PMEM_NULL);
    return(KINSPILS_PMEM_NULL);
  } 
  pdata = (KBBDPrecData) kinspils_mem->s_P_data;

  *ngevalsBBDP = pdata->nge;

  return(KINSPILS_SUCCESS);
}
开发者ID:luca-heltai,项目名称:sundials,代码行数:28,代码来源:kinsol_bbdpre.c

示例14: KINSetFuncNormTol

int KINSetFuncNormTol(void *kinmem, realtype fnormtol)
{
  KINMem kin_mem;
  realtype uround;

  if (kinmem == NULL) {
    KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetFuncNormTol", MSG_NO_MEM);
    return(KIN_MEM_NULL);
  }

  kin_mem = (KINMem) kinmem;

  if (fnormtol < ZERO) {
    KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetFuncNormTol", MSG_BAD_FNORMTOL);
    return(KIN_ILL_INPUT);
  }

  if (fnormtol == ZERO) {
    uround = kin_mem->kin_uround;
    kin_mem->kin_fnormtol = RPowerR(uround,ONETHIRD);
  } else {
    kin_mem->kin_fnormtol = fnormtol;
  }

  return(KIN_SUCCESS);
}
开发者ID:A1kmm,项目名称:modml-solver,代码行数:26,代码来源:kinsol_io.c

示例15: KINSetRelErrFunc

int KINSetRelErrFunc(void *kinmem, realtype relfunc)
{
  KINMem kin_mem;
  realtype uround;

  if (kinmem == NULL) {
    KINProcessError(NULL, KIN_MEM_NULL, "KINSOL", "KINSetRelErrFunc", MSG_NO_MEM);
    return(KIN_MEM_NULL);
  }

  kin_mem = (KINMem) kinmem;

  if (relfunc < ZERO) {
    KINProcessError(NULL, KIN_ILL_INPUT, "KINSOL", "KINSetRelErrFunc", MSG_BAD_RELFUNC);
    return(KIN_ILL_INPUT);
  }

  if (relfunc == ZERO) {
    uround = kin_mem->kin_uround;
    kin_mem->kin_sqrt_relfunc = RSqrt(uround);
  } else {
    kin_mem->kin_sqrt_relfunc = RSqrt(relfunc);
  }

  return(KIN_SUCCESS);
}
开发者ID:A1kmm,项目名称:modml-solver,代码行数:26,代码来源:kinsol_io.c


注:本文中的KINProcessError函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。