설명
선택한 입력 세트에서 부호 있는 거듭제곱 함수를 테스트합니다. signpower 함수의 실제 구현 x**c 함수 위에 있으므로 부호만 얻으면 됩니다. 맞습니다. 나머지 테스트는 vcpower에 대해 수행됩니다. 기여자: Steve Dirkse
소형 모델 유형 :메가 슬롯
카테고리 : 메가 슬롯 테스트 라이브러리
메인 파일 : fnspowx.gms 포함: fnset_xy.inc[html] fntest_xy.inc[html]
$title '부호력 내장의 정확성 테스트' (FNSPOWX,SEQ=530)
$onText
선택한 입력 세트에서 부호 있는 전력 함수를 테스트합니다.
signpower 함수의 실제 구현
x**c 함수 위에 있으므로 부호만 얻으면 됩니다.
맞습니다. 나머지 테스트는 vcpower에 대해 수행됩니다.
기여자: Steve Dirkse
$offText
$include fnset_xy.inc
담당자 = 2e-13;
relToInput = 0;
T / t1 * t11, t20*t25, t30*t35 / 설정;
TA(T) / t1*t11 / 설정;
TB(T) / t20*t25 / 설정;
TC(T) / t30*t35 / 설정;
$onText
참고:
RCOK 0
RCFUNC 1
RCGRAD 2
RCHESS 3
RC시스템 4
에코OK 0
ECDOMAIN 1
특별 2
에코오버플로우 3
엑시글로스 4
$offText
테이블 데이터(T,V)
x y f_ fx_ fxx_ rc_ ec_
t1 0 0 1
t2 0 0.5 1e10 -1e299 2 2
t3 0 1 1 3 2
t4 0 1.5 1e299 3 2
t5 0 2 2
t6 0 2.5
t7 0 -0.5 1 1
t8 0 -1 1 1
t9 0 -1.5 1 1
t10 0 -2 1 1
t11 0 -2.5 1 1
t20 0.5 0
t21 0.5 0.5
t22 0.5 1
t23 0.5 1.5
t24 0.5 2
t25 0.5 2.5
t30 -0.5 0
t31 -0.5 0.5
t32 -0.5 1
t33 -0.5 1.5
t34 -0.5 2
t35 -0.5 2.5
;
data(TB(T), 'f_' ) = vcpower.value( data(T,'x'),data(T,'y'));
data(TB(T), 'fx_' ) = vcpower.grad(1: data(T,'x'),data(T,'y'));
data(TB(T), 'fxx_') = vcpower.hess(1:1:data(T,'x'),data(T,'y'));
data(TC(T), 'f_' ) = -vcpower.value( -data(T,'x'),data(T,'y'));
data(TC(T), 'fx_' ) = vcpower.grad(1: -data(T,'x'),data(T,'y'));
data(TC(T), 'fxx_') = -vcpower.hess(1:1:-data(T,'x'),data(T,'y'));
루프 T,
data(T, 'f') = signpower.value( data(T,'x'),data(T,'y'));
data(T, 'fx') = signpower.grad(1: data(T,'x'),data(T,'y'));
data(T, 'fy') = signpower.grad(2: data(T,'x'),data(T,'y'));
data(T,'fxx') = signpower.hess(1:1:data(T,'x'),data(T,'y'));
data(T,'fxy') = signpower.hess(1:2:data(T,'x'),data(T,'y'));
data(T,'fyx') = signpower.hess(2:1:data(T,'x'),data(T,'y'));
data(T,'fyy') = signpower.hess(2:2:data(T,'x'),data(T,'y'));
data(T, 'rc') = mathlastrc;
data(T, 'ec') = mathlastec;
;
중단$(실행 오류 lt 10)
'signpower(x,y)의 func/grad/hess를 가져오면 실행 오류가 발생해야 합니다.';
실행 오류 = 0;
$include fntest_xy.inc