14feea4b944eda6e6ed903dc2a4544b7e2810ca9
[scilab.git] / scilab / modules / core / tests / unit_tests / display.dia.ref
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) ????-2008 - INRIA
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 format('v',10)
8 //display of numbers
9 x=2.6533333
10  x  =
11  
12     2.6533333  
13 x=[2.6533333 -0.0002]
14  x  =
15  
16     2.6533333  - 0.0002  
17 x'
18  ans  =
19  
20     2.6533333  
21   - 0.0002     
22 x=[]
23  x  =
24  
25      []
26 //display of polynomials
27 z=poly(0,'z')
28  z  =
29  
30     z   
31 num=[ (((((1)*z-2.6533333)*z+2.6887936)*z-1.2916784)*z+0.2911572)*...
32      z-0.0243497
33       (((((1)*z-2.6533333)*z+2.6887936)*z-1.2916784)*z+0.2911572)*...
34      z-0.0243497
35      (((1)*z )*z )*z+1
36      0]
37  num  =
38  
39                                        2            3            4      
40   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
41                5                                                        
42             + z                                                         
43                                                                         
44                                        2            3            4      
45   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
46                5                                                        
47             + z                                                         
48                                                                         
49          3                                                              
50     1 + z                                                               
51                                                                         
52     0                                                                   
53 den = [ ((((1)*z-1.536926)*z+0.8067352)*z-0.1682810)*z+0.0113508
54 ((((1)*z-1.536926)*z+0.8067352)*z-0.1682810)*z+0.0113508
55 ((1)*z )*z
56 1]
57  den  =
58  
59                                       2           3   4  
60     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z   
61                                                          
62                                       2           3   4  
63     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z   
64                                                          
65      2                                                   
66     z                                                    
67                                                          
68     1                                                    
69 num',den'
70  ans  =
71  
72  
73          column 1
74  
75                                        2            3            4      
76   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
77                5                                                        
78             + z                                                         
79  
80          column 2
81  
82                                        2            3            4      
83   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
84                5                                                        
85             + z                                                         
86  
87          column 3 to 4
88  
89          3       
90     1 + z     0  
91  ans  =
92  
93  
94          column 1
95  
96                                       2           3   4  
97     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z   
98  
99          column 2 to 4
100  
101                                       2           3   4     2        
102     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z     z     1   
103 [num;den]
104  ans  =
105  
106                                        2            3            4      
107   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
108                5                                                        
109             + z                                                         
110                                                                         
111                                        2            3            4      
112   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
113                5                                                        
114             + z                                                         
115                                                                         
116          3                                                              
117     1 + z                                                               
118                                                                         
119     0                                                                   
120                                                                         
121                                       2           3   4                 
122     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z                  
123                                                                         
124                                       2           3   4                 
125     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z                  
126                                                                         
127      2                                                                  
128     z                                                                   
129                                                                         
130     1                                                                   
131 [num den]
132  ans  =
133  
134  
135          column 1
136  
137                                        2            3            4      
138   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
139                5                                                        
140             + z                                                         
141                                                                         
142                                        2            3            4      
143   - 0.0243497 + 0.2911572z - 1.2916784z + 2.6887936z - 2.6533333z       
144                5                                                        
145             + z                                                         
146                                                                         
147          3                                                              
148     1 + z                                                               
149                                                                         
150     0                                                                   
151  
152          column 2
153  
154                                       2           3   4  
155     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z   
156                                                          
157                                       2           3   4  
158     0.0113508 - 0.168281z + 0.8067352z - 1.536926z + z   
159                                                          
160      2                                                   
161     z                                                    
162                                                          
163     1                                                    
164 //display of polynomials
165 z=poly(0,'z')
166  z  =
167  
168     z   
169 n=1+z;d=n*n;n1=[n d];d1=[d d*d];n1=[n1 n1];d1=[d1 d1];
170 n2=[n n*n;n*n n**4];d2=[n*n n**4;n n*n];den=d2(1,:);num=n2(2,:);
171 p=poly(rand(5,1),'z');q=poly(rand(6,1),'z');
172 p1=[p,0.1+2.35*z-5.05*z**3];q1=[q,2.56+0.03*z-10.01*z*z+z**5];
173 d3=[1+z**10 z**15];
174 //display of rationals
175 r=num./den
176  r  =
177  
178     1     1   
179     -     -   
180     1     1   
181 r'
182  ans  =
183  
184     1   
185     -   
186     1   
187         
188     1   
189     -   
190     1   
191 rlist(d,n)
192  ans  =
193  
194               2  
195     1 + 2z + z   
196     ----------   
197       1 + z      
198 rlist(n,d)
199  ans  =
200  
201       1 + z      
202     ---------    
203               2  
204     1 + 2z + z   
205 rlist(d2,n2)
206  ans  =
207  
208               2               2    3   4  
209     1 + 2z + z     1 + 4z + 6z + 4z + z   
210     ----------     --------------------   
211                                   2       
212       1 + z             1 + 2z + z        
213                                           
214                                   2       
215       1 + z             1 + 2z + z        
216     ---------      --------------------   
217               2               2    3   4  
218     1 + 2z + z     1 + 4z + 6z + 4z + z   
219 rlist(n2,d2)
220  ans  =
221  
222                                   2       
223       1 + z             1 + 2z + z        
224     ---------      --------------------   
225               2               2    3   4  
226     1 + 2z + z     1 + 4z + 6z + 4z + z   
227                                           
228               2               2    3   4  
229     1 + 2z + z     1 + 4z + 6z + 4z + z   
230     ----------     --------------------   
231                                   2       
232       1 + z             1 + 2z + z        
233 rlist(den,num)
234  ans  =
235  
236               2               2    3   4  
237     1 + 2z + z     1 + 4z + 6z + 4z + z   
238     ----------     --------------------   
239               2               2    3   4  
240     1 + 2z + z     1 + 4z + 6z + 4z + z   
241 rlist(num,den)
242  ans  =
243  
244               2               2    3   4  
245     1 + 2z + z     1 + 4z + 6z + 4z + z   
246     ----------     --------------------   
247               2               2    3   4  
248     1 + 2z + z     1 + 4z + 6z + 4z + z   
249 rlist(p1,q1)
250  ans  =
251  
252  
253          column 1
254  
255                                        2            3            4      
256   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
257           5                                                             
258        + z                                                              
259     ------------------------------------------------------------------  
260                                        2            3            4      
261     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z       
262                    5   6                                                
263        - 3.6713072z + z                                                 
264  
265          column 2
266  
267                           3     
268        0.1 + 2.35z - 5.05z      
269     -------------------------   
270                          2   5  
271     2.56 + 0.03z - 10.01z + z   
272 rlist(q1,p1)
273  ans  =
274  
275  
276          column 1
277  
278                                        2            3            4      
279     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z       
280                    5   6                                                
281        - 3.6713072z + z                                                 
282     ------------------------------------------------------------------  
283                                        2            3            4      
284   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
285           5                                                             
286        + z                                                              
287  
288          column 2
289  
290                          2   5  
291     2.56 + 0.03z - 10.01z + z   
292     -------------------------   
293                           3     
294        0.1 + 2.35z - 5.05z      
295 rlist(p,q)
296  ans  =
297  
298                                        2            3            4      
299   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
300           5                                                             
301        + z                                                              
302     ------------------------------------------------------------------  
303                                        2            3            4      
304     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z       
305                    5   6                                                
306        - 3.6713072z + z                                                 
307 rlist(q,p)
308  ans  =
309  
310                                        2            3            4      
311     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z       
312                    5   6                                                
313        - 3.6713072z + z                                                 
314     ------------------------------------------------------------------  
315                                        2            3            4      
316   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
317           5                                                             
318        + z                                                              
319 rlist(p,z)
320  ans  =
321  
322                                        2            3            4      
323   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
324           5                                                             
325        + z                                                              
326     ------------------------------------------------------------------  
327                                     z                                   
328 rlist(z,p)
329  ans  =
330  
331                                     z                                   
332     -----------------------------------------------------------------   
333                                        2            3            4      
334   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
335           5                                                             
336        + z                                                              
337 rlist(d1,n1)
338  ans  =
339  
340  
341          column 1 to 3
342  
343               2               2    3   4              2  
344     1 + 2z + z     1 + 4z + 6z + 4z + z     1 + 2z + z   
345     ----------     --------------------     ----------   
346                                   2                      
347       1 + z             1 + 2z + z            1 + z      
348  
349          column 4
350  
351                2    3   4  
352     1 + 4z + 6z + 4z + z   
353     --------------------   
354                    2       
355          1 + 2z + z        
356 rlist(n1,d1)
357  ans  =
358  
359  
360          column 1 to 3
361  
362                                   2                      
363       1 + z             1 + 2z + z            1 + z      
364     ---------      --------------------     ---------    
365               2               2    3   4              2  
366     1 + 2z + z     1 + 4z + 6z + 4z + z     1 + 2z + z   
367  
368          column 4
369  
370                    2       
371          1 + 2z + z        
372     --------------------   
373                2    3   4  
374     1 + 4z + 6z + 4z + z   
375 //display of strings
376 digits='abcdefghijklmnopqrstuvwxyz'
377  digits  =
378  
379  abcdefghijklmnopqrstuvwxyz   
380 numbers='1234567890'
381  numbers  =
382  
383  1234567890   
384 majuscules='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
385  majuscules  =
386  
387  ABCDEFGHIJKLMNOPQRSTUVWXYZ   
388 symbols=',./;''[] \ =-!\$%^&*()_+~:""[]| @'
389  symbols  =
390  
391  ,./;'[] \ =-!\$%^&*()_+~:"[]| @   
392 [numbers;digits]
393  ans  =
394  
395 !1234567890                  !
396 !                            !
397 !abcdefghijklmnopqrstuvwxyz  !
398 [numbers digits;digits numbers]
399  ans  =
400  
401 !1234567890                  abcdefghijklmnopqrstuvwxyz  !
402 !                                                        !
403 !abcdefghijklmnopqrstuvwxyz  1234567890                  !
404 [numbers digits+digits+digits]
405  ans  =
406  
407  
408          column 1
409  
410 !1234567890  !
411  
412          column 2
413  
414 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
415 !     stuvwxyz                                                         !
416 ans';
417 [ans ans]
418  ans  =
419  
420  
421          column 1
422  
423 !1234567890                                                            !
424 !                                                                      !
425 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
426 !     stuvwxyz                                                         !
427  
428          column 2
429  
430 !1234567890                                                            !
431 !                                                                      !
432 !abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr!
433 !     stuvwxyz                                                         !
434 ''
435  ans  =
436  
437     
438 // display of list
439 list()
440  ans  =
441  
442      ()
443 list(1,2,3)
444  ans  =
445  
446  
447        ans(1)
448  
449     1.  
450  
451        ans(2)
452  
453     2.  
454  
455        ans(3)
456  
457     3.  
458 list(list(1,list()),2)
459  ans  =
460  
461  
462        ans(1)
463  
464  
465         ans(1)(1)
466  
467     1.  
468  
469         ans(1)(2)
470  
471      ()
472  
473        ans(2)
474  
475     2.  
476 list(rlist(q,p),1.23)
477  ans  =
478  
479  
480        ans(1)
481  
482                                        2            3            4      
483     0.0123314 - 0.2684985z + 1.5393672z - 4.0114366z + 5.4004179z       
484                    5   6                                                
485        - 3.6713072z + z                                                 
486     ------------------------------------------------------------------  
487                                        2            3            4      
488   - 0.0000078 + 0.0351988z - 0.3720034z + 1.3432153z - 1.9632981z       
489           5                                                             
490        + z                                                              
491  
492        ans(2)
493  
494     1.23  
495 // overloading of display
496 1:$
497  ans  =
498  
499  
500  1:1:$   
501 list(1,1:$)
502  ans  =
503  
504  
505        ans(1)
506  
507     1.  
508  
509        ans(2)
510  
511  
512  1:1:$   
513 list(list(1:$))
514  ans  =
515  
516  
517        ans(1)
518  
519  
520         ans(1)(1)
521  
522  
523  1:1:$   
524 list(list(1,$),list())
525  ans  =
526  
527  
528        ans(1)
529  
530  
531         ans(1)(1)
532  
533     1.  
534  
535         ans(1)(2)
536  
537     $   
538  
539        ans(2)
540  
541      ()
542 // Tlist overloaded display
543 TL=tlist('x',1,2)
544  TL  =
545  
546  
547        TL(1)
548  
549  x   
550  
551        TL(2)
552  
553     1.  
554  
555        TL(3)
556  
557     2.  
558 deff('%x_p(x)','disp(x(3),x(2),''Mydisplay'')')
559 TL
560  TL  =
561  
562  
563  Mydisplay   
564  
565     1.  
566  
567     2.  
568 list(TL)
569  ans  =
570  
571  
572        ans(1)
573  
574  
575  Mydisplay   
576  
577     1.  
578  
579     2.  
580 list(list(TL))
581  ans  =
582  
583  
584        ans(1)
585  
586  
587         ans(1)(1)
588  
589  
590  Mydisplay   
591  
592     1.  
593  
594     2.  
595 TL=tlist('x',1:$,2)
596  TL  =
597  
598  
599  Mydisplay   
600  
601  
602  1:1:$   
603  
604     2.  
605 list(TL)
606  ans  =
607  
608  
609        ans(1)
610  
611  
612  Mydisplay   
613  
614  
615  1:1:$   
616  
617     2.  
618 list(list(TL))
619  ans  =
620  
621  
622        ans(1)
623  
624  
625         ans(1)(1)
626  
627  
628  Mydisplay   
629  
630  
631  1:1:$   
632  
633     2.  
634 TL(2)=TL
635  TL  =
636  
637  
638  Mydisplay   
639  
640  
641  Mydisplay   
642  
643  
644  1:1:$   
645  
646     2.  
647  
648     2.