Rev 16321 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16321 | bpr | 1 | !set methtit=Suma de desigualdades con coeficientes |
20 | reyssat | 2 | !set methenv=ZZ QQ RR |
3 | !set methparmtype=parm inequality >,parm inequality >,\ |
||
4 | number, number |
||
16321 | bpr | 5 | !set methhelp=Este método acepta dos desigualdades existentes en\ |
6 | la hipótesis, para deducir una tercera, que es\ |
||
7 | la suma con coeficientes de los dos primeros.\ |
||
8 | La nueva desigualdad se añadirá en las hipótesis. |
||
20 | reyssat | 9 | |
10 | !if $wims_read_parm iswordof form check |
||
16321 | bpr | 11 | !goto $wims_read_parm |
20 | reyssat | 12 | !endif |
13 | |||
14 | !exit |
||
15 | :form |
||
17187 | bpr | 16 | Introduciruna nueva desigualdad que es <br> |
16321 | bpr | 17 | !default methparm3=1 |
18 | !default methparm4=1 |
||
19 | !read deduc/methparm.phtml 3,5 |
||
20 | $ veces la desigualdad |
||
21 | !read deduc/methparm.phtml 1 |
||
17187 | bpr | 22 | <br> más |
16321 | bpr | 23 | !read deduc/methparm.phtml 4,5 |
24 | $ veces la desigualdad |
||
25 | !read deduc/methparm.phtml 2 |
||
20 | reyssat | 26 | |
27 | !exit |
||
28 | :check |
||
16321 | bpr | 29 | !ifval $methparm3=0 and $methparm4=0 |
30 | error=¡Los coeficientes son cero! |
||
20 | reyssat | 31 | !exit |
16321 | bpr | 32 | !endif |
33 | !distribute items $methparmobj1 into data1,left1,sign1,right1 |
||
34 | !distribute items $methparmobj2 into data2,left2,sign2,right2 |
||
35 | !if $data1 issametext $data2 |
||
36 | error=Este método prohíbe la combinación lineal de una desigualdad\ |
||
37 | consigo misma. |
||
20 | reyssat | 38 | !exit |
16321 | bpr | 39 | !endif |
40 | methexp=\(($methparm3)*($left1 $sign1 $right1) + ($methparm4)*($left2 $sign2 $right2)) |
||
41 | !if $methparm3<0 |
||
20 | reyssat | 42 | methparm3=-($methparm3) |
43 | sign1=!translate internal <> to >< in $sign1 |
||
44 | left1=-($left1) |
||
45 | right1=-($right1) |
||
16321 | bpr | 46 | !endif |
47 | !if $methparm4<0 |
||
20 | reyssat | 48 | methparm4=-($methparm4) |
49 | sign2=!translate internal <> to >< in $sign2 |
||
50 | left2=-($left2) |
||
51 | right2=-($right2) |
||
16321 | bpr | 52 | !endif |
53 | |||
54 | gt=> |
||
55 | lt=< |
||
56 | !if ($gt isin $sign1 and $lt isin $sign2) or\ |
||
20 | reyssat | 57 | ($lt isin $sign1 and $gt isin $sign2) |
58 | !exchange left2,right2 |
||
16321 | bpr | 59 | !endif |
60 | !read deduc/sub/simplify ($methparm3)*($left1) + ($methparm4)*($left2)\ |
||
20 | reyssat | 61 | ($methparm3)*($right1) + ($methparm4)*($right2) |
16321 | bpr | 62 | !distribute lines $out into newleft, newright |
63 | !if $newleft=$empty or $newright=$empty |
||
20 | reyssat | 64 | error=bad_data |
65 | !exit |
||
16321 | bpr | 66 | !endif |
20 | reyssat | 67 | |
16321 | bpr | 68 | !if $gt isin $sign1 |
20 | reyssat | 69 | s_=> |
16321 | bpr | 70 | !else |
20 | reyssat | 71 | s_=< |
16321 | bpr | 72 | !endif |
73 | eq=$empty= |
||
74 | !if ($eq isin $sign1 or $[$methparm3]=0) \ |
||
20 | reyssat | 75 | and ($eq isin $sign2 or $[$methparm4]=0) |
76 | s_=$s_= |
||
16321 | bpr | 77 | !endif |
78 | newobject0=$newleft $s_ $newright |
||
79 | oldobject=0 |
||
20 | reyssat | 80 | |
16321 | bpr | 81 | contextlist=$ct_Always,\ |
82 | $ct_Onlywhen ambos coeficientes son distintos de cero,\ |
||
83 | $ct_Onlywhen ambas desigualdades son positivas,\ |
||
84 | $ct_Onlywhen una de las dos desigualdades es positiva,\ |
||
85 | $ct_Onlywhen una de las dos desigualdades tiene el mismo signo |
||
20 | reyssat | 86 | |
87 | !exit |