ADICJacobian*1†2111000802100080ADICgradientADICAIFADICJacobianADICPDEs[1]JacobianMatlabMathematicaJacobian[3][1][2]ADIC[3,4]AutomaticDifferentiationinCsystemArgonneANSI-CADICCAIFAutomaticDifferentiationIntermediateFormADICADICADICANSI-CADICAIFADICANSI-CFortran77ADIC*60503031†E-mail:onlymanes@sohu.com,Tel:010-826813821ADICADICiiiSSfT∇⋅∂∂=∇∑1T∇TiS∇iSiSf∂∂/fiSXFYX∇⋅∇=∇02mnRRF×:F0XunderlyingFunctionFX0∇0Xnm×X∇Y∇nm2ADICADICADICADICunderlyingFunctionDERIV_TYPEvaluegrad[]ad_GRAD_MAXtypedefstruct{doublevalue;doublegrad[ad_GRAD_MAX];}DERIV_TYPE;#defineDERIV_val(a)((a).value)#defineDERIV_grad(a)((a).grad)ADICad_AD_Init(ad_GRAD_MAX)ad_GRAD_MAXdoublead_grad_axpy_0(&x[i])x[i]grad[]DERIV_val(x[i])=t1x[i]valt1ad_AD_SetIndepArray(x,n)nnxad_AD_SetIndepDone()ad_function(a)ADICfunctionaad_AD_ExtractGrad(grad,r)rxgradadiCgradientJacobianADICad_grad_axpy_n#definead_grad_axpy_3(gz,ca,ga,cb,gb,cc,gc){\intg_i_;\for(g_i_=0;g_i_2ADIC2.0ROSESAGE3[4]ANSI-Cside-effectsADICADICADICAIFAIFADICAIFAutomaticDifferentiationIntermediateFormSAGE3ANSI-CADICAIFtemplateADIntrinsicssystempurse-c1ADICADICdriverADIC1AIFad_grad_axpy_32SparsLinCad_grad_axpy_33ADIntrinsicsCdriver3.2ADICADICCSideEffectsADICAIFCFORTRANADICCCADICxx∇)(&&xFx=∇F&x&x[i++]=y[i];x[i++]DERIV_val(x[i++])DERIV_grad(x[i++])(*f(x))/=y;t1=f(x);(*t1)=(*t1)/y;Cy*=x;yADICADICAIFAIFADICCFortranAIFAIFAIFNO-OPfoo>struc.zVAR_Ta|bNO-OPCFortranADICAIFderivativemoduleAIFAIFhostAIFAIFADICgradientAIFAPIhostADICAIFAST’sAIF2a=b*cAIFBIND_TAPIASSGN_TVAL_TVAR_TMUL_TVAR_TNAME_A2a=b*cAIFADICgradientAIFAIFAIFad_loc_0=DERIV_val(b)*DERIV_val(c);ad_grad_axpy_2(DERIV_val(a),DERIV_val(c),DERIV_val(b),DERIV_val(b),DERIV_val(c));DERIV_val(a)=ad_loc_0;ADICAIFAIFAIFAPIhostAIFgradientJacobianADIChessian4ADIC[3]ADICANSI-CSunSPARCstation20Solaris2.5gcc)(/)(ftimeftime∇ADIC)(/)(ADtimeCDtimeCSCMDO3-DFCAP24.1CSCMDO3-DCSCMDORAPID2-DTLNS3D3DCFDNASACSCMDO16,500ANSI-C491ADICADIC/1CSCMDO4.2FCAP2FCAPHewlett-Packard80/FCAP7,680ANSI-C16.227.521ADIC2ADIC1.62FCAP25ADICANSI-CADICADICCgradientAIFADIC/ADICADIC1.(E),2004346601-6182.ChristianH.Bischof,OntheImplementationofAutomaticDifferentiationTools,InstituteforScientificComputing,AachenUniversityofTechnology,PaulD.HovlandandBoyanaNorris,MathematicsandComputerScienceDivision,ArgonneNationalLaboratory3.PaulD.HovlandandBoyanaNorris,Users’GuidetoADIC1.1,MathematicsandComputerScienceDivision,TechnicalMemorandumANL/MCS-TM-225,July20044.ChristianBischofandLucasRoh,ADIC:AnExtensibleAutomaticDifferentiationToolforANSI-C,MathematicsandComputerScienceDivision,ArgonnePreprintANL/MCS-P626-1196(revisedMay1997)
本文标题:运用ADIC计算一阶导数及Jacobian矩阵
链接地址:https://www.777doc.com/doc-1225 .html