File: matops.dia.ref

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (98 lines) | stat: -rw-r--r-- 4,470 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
//insertion
v=[1 2 3];
v(2)=3;if or(v<>[1 3 3]) then bugmes();quit;end
v(4)=-5;if or(v<>[1 3 3 -5]) then bugmes();quit;end
v([1 4])=[2 5];if or(v<>[2 3 3 5]) then bugmes();quit;end
v([1 1])=[2 5];if or(v<>[5 3 3 5]) then bugmes();quit;end
v([1 1 1 1 1 1])=[2 5 6 7 8 9];if or(v<>[9 3 3 5]) then bugmes();quit;end
v([4 2])=[8 5];if or(v<>[9 5 3 8]) then bugmes();quit;end
v=[1 2 3];
v(2,4)=10;if or(v<>[1 2 3 0;0 0 0 10]) then bugmes();quit;end
v([2 2],4)=[10;20];if or(v<>[1 2 3 0;0 0 0 20]) then bugmes();quit;end
v([2 1],4)=[10;20];if or(v<>[1 2 3 20;0 0 0 10]) then bugmes();quit;end
v([2 2 2],4)=[10;20;30];if or(v<>[1 2 3 20;0 0 0 30]) then bugmes();quit;end
v=[1 2 3;0 0 10];
v(1,[1 1 1 1])=1:4;;if or(v<>[4 2 3;0 0 10]) then bugmes();quit;end
v([2 2],[1 1 1 1])=[1:4;2:5];if or(v<>[4 2 3;5 0 10]) then bugmes();quit;end
v(3,4)=7;if or(v<>[4 2 3 0;5 0 10 0;0 0 0 7]) then bugmes();quit;end
v=[];
v(5)=1;if or(v<>[0;0;0;0;1]) then bugmes();quit;end
v(2)=4;if or(v<>[0;4;0;0;1]) then bugmes();quit;end
v=[1 2 3;4 5 6];
v(:,1)=[4;1];if or(v<>[4 2 3;1 5 6]) then bugmes();quit;end
v(:,[1 1])=[4 5;1 2];if or(v<>[5 2 3;2 5 6]) then bugmes();quit;end
v(:,[3 1])=[4 5;1 2];if or(v<>[5 2 4;2 5 1]) then bugmes();quit;end
v(:,[3 3 3 3])=[4 5 6 7;1 2 3 4];if or(v<>[5 2 7;2 5 4]) then bugmes();quit;end
v=[1 2 3;4 5 6];
v(1,:)=[2 3 4];if or(v<>[2 3 4;4 5 6]) then bugmes();quit;end
v([1 1],:)=[2 3 4;4 5 6];if or(v<>[4 5 6;4 5 6]) then bugmes();quit;end
v([2 2 2 2],:)=[2 3 4;4 5 6;7 8 9;10 11 12];
if or(v<>[4 5 6;10 11 12]) then bugmes();quit;end
v=[1 2 3];
v(2)=[];if or(v<>[1 3]) then bugmes();quit;end
v=[1 2 3];
v([3 2])=[];if v<>1 then bugmes();quit;end
v=[1 2 3]';
v(2)=[];if or(v<>[1 3]') then bugmes();quit;end
v=[1 2 3]';
v([3 2])=[];if v<>1 then bugmes();quit;end
v=[1 2 3;4 5 6];
v(1,:)=[];if or(v<>[4 5 6]);then bugmes();quit;end
v=[1 2 3;4 5 6];
v(:,[3 2])=[];if or(v<>[1;4]);then bugmes();quit;end
//======================
v=[1 2 3];
v(2)=%i;if or(v<>[1 %i 3]) then bugmes();quit;end
v(4)=-5;if or(v<>[1 %i 3 -5]) then bugmes();quit;end
v([1 4])=[2*%i 5];if or(v<>[2*%i %i 3 5]) then bugmes();quit;end
v([1 1])=[2 5*%i];if or(v<>[5*%i %i 3 5]) then bugmes();quit;end
v([1 1 1 1 1 1])=[2 5 6 7 8 9];if or(v<>[9 %i 3 5]) then bugmes();quit;end
v([4 2])=[8 5];if or(v<>[9 5 3 8]) then bugmes();quit;end
v=[%i 2 3];
v(2,4)=10;if or(v<>[%i 2 3 0;0 0 0 10]) then bugmes();quit;end
v([2 2],4)=[10;20*%i];if or(v<>[%i 2 3 0;0 0 0 20*%i]) then bugmes();quit;end
v([2 1],4)=[10;20*%i];if or(v<>[%i 2 3 20*%i;0 0 0 10]) then bugmes();quit;end
v([2 2 2],4)=[10;20;30];if or(v<>[%i 2 3 20*%i;0 0 0 30]) then bugmes();quit;end
v=[1 2 3;0 0 10*%i];
v(1,[1 1 1 1])=1:4;if or(v<>[4 2 3;0 0 10*%i]) then bugmes();quit;end
v([2 2],[1 1 1 1])=[1:4;2:5];if or(v<>[4 2 3;5 0 10*%i]) then bugmes();quit;end
v(3,4)=7;if or(v<>[4 2 3 0;5 0 10*%i 0;0 0 0 7]) then bugmes();quit;end
v=[];
v(5)=%i;if or(v<>[0;0;0;0;%i]) then bugmes();quit;end
v(2)=4;if or(v<>[0;4;0;0;%i]) then bugmes();quit;end
v=[1 2 3;4 5 6];
v(:,1)=[4;%i];if or(v<>[4 2 3;%i 5 6]) then bugmes();quit;end
v(:,[1 1])=[4 5;1 2];if or(v<>[5 2 3;2 5 6]) then bugmes();quit;end
v(:,[3 1])=[4 5;%i 2];if or(v<>[5 2 4;2 5 %i]) then bugmes();quit;end
v(:,[3 3 3 3])=[4 5 6 7;1 2 3 4];if or(v<>[5 2 7;2 5 4]) then bugmes();quit;end
v=[%i 2 3;4 5 6];
v(1,:)=[2 3 4];if or(v<>[2 3 4;4 5 6]) then bugmes();quit;end
v([1 1],:)=[2 3 4;4*%i 5 6];if or(v<>[4*%i 5 6;4 5 6]) then bugmes();quit;end
v([2 2 2 2],:)=[2 3 4;4 5 6;7 8 9;10 11 12];
if or(v<>[4*%i 5 6;10 11 12]) then bugmes();quit;end
v=[%i 2 3];
v(2)=[];if or(v<>[%i 3]) then bugmes();quit;end
v=[1 2 3*%i];
v([3 2])=[];if v<>1 then bugmes();quit;end
v=[%i 2 3]';
v(2)=[];if or(v<>[%i 3]') then bugmes();quit;end
v=[1 2 3*%i]';
v([3 2])=[];if v<>1 then bugmes();quit;end
v=[%i 2 3;4 5 6];
v(1,:)=[];if or(v<>[4 5 6]);then bugmes();quit;end
v=[%i 2 3;4 5 6];
v(:,[3 2])=[];if or(v<>[%i;4]);then bugmes();quit;end
//hidden empty index
v=[1 2;3 4];v_ref=v;
v(1,[%f %f])=[];
if or(v<>v_ref) then bugmes();quit;end
v([%f %f],1)=[];
if or(v<>v_ref) then bugmes();quit;end
v([%f %f],[%f %f])=[];
if or(v<>v_ref) then bugmes();quit;end