@@ -2,70 +2,59 @@ function Array1DTracer(module) {
2
2
return Array2DTracer . call ( this , module || Array1DTracer ) ;
3
3
}
4
4
5
- Array1DTracer . prototype = Object . create ( Array2DTracer . prototype ) ;
6
- Array1DTracer . prototype . constructor = Array1DTracer ;
7
-
8
- // Override
9
- Array1DTracer . prototype . _setData = function ( D ) {
10
- return Array2DTracer . prototype . _setData . call ( this , [ D ] ) ;
11
- } ;
12
-
13
- // Override
14
- Array1DTracer . prototype . _notify = function ( idx1 , idx2 ) {
15
- if ( idx2 === undefined ) {
16
- Array2DTracer . prototype . _notify . call ( this , 0 , idx1 ) ;
17
- } else {
18
- Array2DTracer . prototype . _notify . call ( this , 0 , idx1 , 0 , idx2 ) ;
19
- }
20
- } ;
21
-
22
- // Override
23
- Array1DTracer . prototype . _select = function ( s , e ) {
24
- if ( e === undefined ) {
25
- Array2DTracer . prototype . _select . call ( this , 0 , s ) ;
26
- } else {
27
- Array2DTracer . prototype . _selectRow . call ( this , 0 , s , e ) ;
28
- }
29
- } ;
30
-
31
- // Override
32
- Array1DTracer . prototype . _selectSet = function ( indexes ) {
33
- var coords = [ ] ;
34
- indexes . forEach ( function ( index ) {
35
- coords . push ( {
36
- x : 0 ,
37
- y : index
5
+ Array1DTracer . prototype = $ . extend ( true , Object . create ( Array2DTracer . prototype ) , {
6
+ constructor : Array1DTracer ,
7
+ _setData : function ( D ) {
8
+ return Array2DTracer . prototype . _setData . call ( this , [ D ] ) ;
9
+ } ,
10
+ _notify : function ( idx1 , idx2 ) {
11
+ if ( idx2 === undefined ) {
12
+ Array2DTracer . prototype . _notify . call ( this , 0 , idx1 ) ;
13
+ } else {
14
+ Array2DTracer . prototype . _notify . call ( this , 0 , idx1 , 0 , idx2 ) ;
15
+ }
16
+ } ,
17
+ _select : function ( s , e ) {
18
+ if ( e === undefined ) {
19
+ Array2DTracer . prototype . _select . call ( this , 0 , s ) ;
20
+ } else {
21
+ Array2DTracer . prototype . _selectRow . call ( this , 0 , s , e ) ;
22
+ }
23
+ } ,
24
+ _selectSet : function ( indexes ) {
25
+ var coords = [ ] ;
26
+ indexes . forEach ( function ( index ) {
27
+ coords . push ( {
28
+ x : 0 ,
29
+ y : index
30
+ } ) ;
38
31
} ) ;
39
- } ) ;
40
- Array2DTracer . prototype . _selectSet . call ( this , coords ) ;
41
- } ;
42
-
43
- // Override
44
- Array1DTracer . prototype . _deselect = function ( s , e ) {
45
- if ( e === undefined ) {
46
- Array2DTracer . prototype . _deselect . call ( this , 0 , s ) ;
47
- } else {
48
- Array2DTracer . prototype . _deselectRow . call ( this , 0 , s , e ) ;
49
- }
50
- } ;
51
-
52
- // Override
53
- Array1DTracer . prototype . _deselectSet = function ( indexes ) {
54
- var coords = [ ] ;
55
- indexes . forEach ( function ( index ) {
56
- coords . push ( {
57
- x : 0 ,
58
- y : index
32
+ Array2DTracer . prototype . _selectSet . call ( this , coords ) ;
33
+ } ,
34
+ _deselect : function ( s , e ) {
35
+ if ( e === undefined ) {
36
+ Array2DTracer . prototype . _deselect . call ( this , 0 , s ) ;
37
+ } else {
38
+ Array2DTracer . prototype . _deselectRow . call ( this , 0 , s , e ) ;
39
+ }
40
+ } ,
41
+ _deselectSet : function ( indexes ) {
42
+ var coords = [ ] ;
43
+ indexes . forEach ( function ( index ) {
44
+ coords . push ( {
45
+ x : 0 ,
46
+ y : index
47
+ } ) ;
59
48
} ) ;
60
- } ) ;
61
- Array2DTracer . prototype . _deselectSet . call ( this , coords ) ;
62
- } ;
49
+ Array2DTracer . prototype . _deselectSet . call ( this , coords ) ;
50
+ }
51
+ } ) ;
63
52
64
53
var Array1D = {
65
- random : function ( N , min , max ) {
54
+ random : function ( N , min , max ) {
66
55
return Array2D . random ( 1 , N , min , max ) [ 0 ] ;
67
56
} ,
68
- randomSorted : function ( N , min , max ) {
57
+ randomSorted : function ( N , min , max ) {
69
58
return Array2D . randomSorted ( 1 , N , min , max ) [ 0 ] ;
70
59
}
71
60
} ;
0 commit comments