@@ -144,16 +144,16 @@ describe('utility methods', () => {
144144 [ 0 , 1 / 2 , 1 ] ,
145145 [ 0 , 1 , 1 / 3 ]
146146 ] ) ;
147- expect ( matrix . scaleRows ( 1 , 2 ) . to2DArray ( ) ) . toStrictEqual ( [
147+ expect ( matrix . scaleRows ( { min : 1 , max : 2 } ) . to2DArray ( ) ) . toStrictEqual ( [
148148 [ 1 , 3 / 2 , 2 ] ,
149149 [ 1 , 2 , 4 / 3 ]
150150 ] ) ;
151- expect ( matrix . scaleRows ( - 2 , - 1 ) . to2DArray ( ) ) . toStrictEqual ( [
151+ expect ( matrix . scaleRows ( { min : - 2 , max : - 1 } ) . to2DArray ( ) ) . toStrictEqual ( [
152152 [ - 2 , - 3 / 2 , - 1 ] ,
153153 [ - 2 , - 1 , - 5 / 3 ]
154154 ] ) ;
155- expect ( ( ) => matrix . scaleRows ( 2 , 1 ) ) . toThrow (
156- / m i n s h o u l d b e s t r i c t l y s m a l l e r t h a n m a x /
155+ expect ( ( ) => matrix . scaleRows ( { min : 2 , max : 1 } ) ) . toThrow (
156+ / ^ m i n m u s t b e s m a l l e r t h a n m a x $ /
157157 ) ;
158158 } ) ;
159159
@@ -164,18 +164,16 @@ describe('utility methods', () => {
164164 [ 0 , 1 / 2 ] ,
165165 [ 1 , 1 ]
166166 ] ) ;
167- expect ( matrix . scaleColumns ( 1 , 2 ) . to2DArray ( ) ) . toStrictEqual ( [
167+ expect ( matrix . scaleColumns ( { min : 1 , max : 2 } ) . to2DArray ( ) ) . toStrictEqual ( [
168168 [ 13 / 7 , 1 ] ,
169169 [ 1 , 3 / 2 ] ,
170170 [ 2 , 2 ]
171171 ] ) ;
172- expect ( matrix . scaleColumns ( - 2 , - 1 ) . to2DArray ( ) ) . toStrictEqual ( [
173- [ - 8 / 7 , - 2 ] ,
174- [ - 2 , - 3 / 2 ] ,
175- [ - 1 , - 1 ]
176- ] ) ;
177- expect ( ( ) => matrix . scaleColumns ( 2 , 1 ) ) . toThrow (
178- / m i n s h o u l d b e s t r i c t l y s m a l l e r t h a n m a x /
172+ expect ( matrix . scaleColumns ( { min : - 2 , max : - 1 } ) . to2DArray ( ) ) . toStrictEqual (
173+ [ [ - 8 / 7 , - 2 ] , [ - 2 , - 3 / 2 ] , [ - 1 , - 1 ] ]
174+ ) ;
175+ expect ( ( ) => matrix . scaleColumns ( { min : 2 , max : 1 } ) ) . toThrow (
176+ / ^ m i n m u s t b e s m a l l e r t h a n m a x $ /
179177 ) ;
180178 } ) ;
181179
@@ -203,13 +201,13 @@ describe('utility methods', () => {
203201 it ( 'repeat matrix' , ( ) => {
204202 var matrix = new Matrix ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) ;
205203 expect ( matrix . repeat ( ) . to2DArray ( ) ) . toStrictEqual ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) ;
206- expect ( matrix . repeat ( 2 , 2 ) . to2DArray ( ) ) . toStrictEqual ( [
204+ expect ( matrix . repeat ( { rows : 2 , columns : 2 } ) . to2DArray ( ) ) . toStrictEqual ( [
207205 [ 1 , 2 , 1 , 2 ] ,
208206 [ 3 , 4 , 3 , 4 ] ,
209207 [ 1 , 2 , 1 , 2 ] ,
210208 [ 3 , 4 , 3 , 4 ]
211209 ] ) ;
212- expect ( matrix . repeat ( 1 , 2 ) . to2DArray ( ) ) . toStrictEqual ( [
210+ expect ( matrix . repeat ( { columns : 2 } ) . to2DArray ( ) ) . toStrictEqual ( [
213211 [ 1 , 2 , 1 , 2 ] ,
214212 [ 3 , 4 , 3 , 4 ]
215213 ] ) ;
0 commit comments