Rev 5763 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2071 | zjchen | 1 | !set methtit=不等式加权相加 |
2 | !set methenv=ZZ QQ RR |
||
3 | !set methparmtype=parm inequality >,parm inequality >,\ |
||
4 | number, number |
||
5 | !set methhelp=此方法利用加权相加从假设中两个已知不等式导出新的不等式,\ |
||
6 | 新的不等式再被加到假设中. |
||
7 | |||
8 | !if $wims_read_parm iswordof form check |
||
9 | !goto $wims_read_parm |
||
10 | !endif |
||
11 | |||
12 | !exit |
||
13 | :form |
||
17234 | bpr | 14 | 引入新的不等式, 它是 <br> |
2071 | zjchen | 15 | !default methparm3=1 |
16 | !default methparm4=1 |
||
17 | !read deduc/methparm.phtml 3,5 |
||
18 | 乘不等式 |
||
19 | !read deduc/methparm.phtml 1 |
||
17234 | bpr | 20 | <br>加上 |
2071 | zjchen | 21 | !read deduc/methparm.phtml 4,5 |
22 | 乘不等式 |
||
23 | !read deduc/methparm.phtml 2 |
||
24 | |||
25 | !exit |
||
26 | :check |
||
27 | !ifval $methparm3=0 and $methparm4=0 |
||
28 | error=加上零! |
||
29 | !exit |
||
30 | !endif |
||
31 | !distribute items $methparmobj1 into data1,left1,sign1,right1 |
||
32 | !distribute items $methparmobj2 into data2,left2,sign2,right2 |
||
33 | !if $data1 issametext $data2 |
||
34 | error=此方法禁止不等式与自己相加. |
||
35 | !exit |
||
36 | !endif |
||
37 | methexp=\(($methparm3)*($left1 $sign1 $right1) + ($methparm4)*($left2 $sign2 $right2)) |
||
38 | !if $methparm3<0 |
||
39 | methparm3=-($methparm3) |
||
40 | sign1=!translate internal <> to >< in $sign1 |
||
41 | left1=-($left1) |
||
42 | right1=-($right1) |
||
43 | !endif |
||
44 | !if $methparm4<0 |
||
45 | methparm4=-($methparm4) |
||
46 | sign2=!translate internal <> to >< in $sign2 |
||
47 | left2=-($left2) |
||
48 | right2=-($right2) |
||
49 | !endif |
||
17234 | bpr | 50 | |
2071 | zjchen | 51 | gt=> |
52 | lt=< |
||
53 | !if ($gt isin $sign1 and $lt isin $sign2) or\ |
||
54 | ($lt isin $sign1 and $gt isin $sign2) |
||
55 | !exchange left2,right2 |
||
56 | !endif |
||
57 | !read deduc/sub/simplify ($methparm3)*($left1) + ($methparm4)*($left2)\ |
||
58 | ($methparm3)*($right1) + ($methparm4)*($right2) |
||
59 | !distribute lines $out into newleft, newright |
||
60 | !if $newleft=$empty or $newright=$empty |
||
61 | error=bad_data |
||
62 | !exit |
||
63 | !endif |
||
64 | |||
65 | !if $gt isin $sign1 |
||
66 | s_=> |
||
67 | !else |
||
68 | s_=< |
||
69 | !endif |
||
70 | eq=$empty= |
||
71 | !if ($eq isin $sign1 or $[$methparm3]=0) \ |
||
72 | and ($eq isin $sign2 or $[$methparm4]=0) |
||
73 | s_=$s_= |
||
74 | !endif |
||
75 | newobject0=$newleft $s_ $newright |
||
76 | oldobject=0 |
||
77 | |||
78 | contextlist=$ct_Always,\ |
||
79 | $ct_Onlywhen系数均非零,\ |
||
80 | $ct_Onlywhen两个不等式都是正的,\ |
||
81 | $ct_Onlywhen其中一个不等式是正的,\ |
||
82 | $ct_Onlywhen其中一个不等式是同号的 |
||
83 | |||
84 | !exit |