@@ -1043,22 +1043,22 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
1043
1043
}
1044
1044
}
1045
1045
1046
- /// Perform an elementwise assigment to `self` from `other `.
1046
+ /// Perform an elementwise assigment to `self` from `rhs `.
1047
1047
///
1048
- /// If their shapes disagree, `other ` is broadcast to the shape of `self`.
1048
+ /// If their shapes disagree, `rhs ` is broadcast to the shape of `self`.
1049
1049
///
1050
1050
/// **Panics** if broadcasting isn't possible.
1051
- pub fn assign < E : Dimension , S2 > ( & mut self , other : & ArrayBase < S2 , E > )
1051
+ pub fn assign < E : Dimension , S2 > ( & mut self , rhs : & ArrayBase < S2 , E > )
1052
1052
where S : DataMut ,
1053
1053
A : Clone ,
1054
1054
S2 : Data < Elem =A > ,
1055
1055
{
1056
- if self . shape ( ) == other . shape ( ) {
1057
- for ( x, y) in self . iter_mut ( ) . zip ( other . iter ( ) ) {
1056
+ if self . shape ( ) == rhs . shape ( ) {
1057
+ for ( x, y) in self . iter_mut ( ) . zip ( rhs . iter ( ) ) {
1058
1058
* x = y. clone ( ) ;
1059
1059
}
1060
1060
} else {
1061
- let other_iter = other . broadcast_iter_unwrap ( self . dim ( ) ) ;
1061
+ let other_iter = rhs . broadcast_iter_unwrap ( self . dim ( ) ) ;
1062
1062
for ( x, y) in self . iter_mut ( ) . zip ( other_iter) {
1063
1063
* x = y. clone ( ) ;
1064
1064
}
@@ -1351,10 +1351,10 @@ impl<A, S> ArrayBase<S, (Ix, Ix)>
1351
1351
impl < A : Copy + linalg:: Ring , S > ArrayBase < S , ( Ix , Ix ) >
1352
1352
where S : Data < Elem =A > ,
1353
1353
{
1354
- /// Perform matrix multiplication of rectangular arrays `self` and `other `.
1354
+ /// Perform matrix multiplication of rectangular arrays `self` and `rhs `.
1355
1355
///
1356
1356
/// The array sizes must agree in the way that
1357
- /// if `self` is *M* × *N*, then `other ` is *N* × *K*.
1357
+ /// if `self` is *M* × *N*, then `rhs ` is *N* × *K*.
1358
1358
///
1359
1359
/// Return a result array with shape *M* × *K*.
1360
1360
///
@@ -1374,9 +1374,9 @@ impl<A: Copy + linalg::Ring, S> ArrayBase<S, (Ix, Ix)>
1374
1374
/// );
1375
1375
/// ```
1376
1376
///
1377
- pub fn mat_mul ( & self , other : & ArrayBase < S , ( Ix , Ix ) > ) -> Array < A , ( Ix , Ix ) >
1377
+ pub fn mat_mul ( & self , rhs : & ArrayBase < S , ( Ix , Ix ) > ) -> Array < A , ( Ix , Ix ) >
1378
1378
{
1379
- let ( ( m, a) , ( b, n) ) = ( self . dim , other . dim ) ;
1379
+ let ( ( m, a) , ( b, n) ) = ( self . dim , rhs . dim ) ;
1380
1380
let ( self_columns, other_rows) = ( a, b) ;
1381
1381
assert ! ( self_columns == other_rows) ;
1382
1382
@@ -1390,7 +1390,7 @@ impl<A: Copy + linalg::Ring, S> ArrayBase<S, (Ix, Ix)>
1390
1390
for rr in res_elems. iter_mut ( ) {
1391
1391
unsafe {
1392
1392
let dot = ( 0 ..a) . fold ( libnum:: zero :: < A > ( ) ,
1393
- |s, k| s + * self . uchk_at ( ( i, k) ) * * other . uchk_at ( ( k, j) )
1393
+ |s, k| s + * self . uchk_at ( ( i, k) ) * * rhs . uchk_at ( ( k, j) )
1394
1394
) ;
1395
1395
std:: ptr:: write ( rr, dot) ;
1396
1396
}
@@ -1406,17 +1406,17 @@ impl<A: Copy + linalg::Ring, S> ArrayBase<S, (Ix, Ix)>
1406
1406
}
1407
1407
1408
1408
/// Perform the matrix multiplication of the rectangular array `self` and
1409
- /// column vector `other `.
1409
+ /// column vector `rhs `.
1410
1410
///
1411
1411
/// The array sizes must agree in the way that
1412
- /// if `self` is *M* × *N*, then `other ` is *N*.
1412
+ /// if `self` is *M* × *N*, then `rhs ` is *N*.
1413
1413
///
1414
1414
/// Return a result array with shape *M*.
1415
1415
///
1416
1416
/// **Panics** if sizes are incompatible.
1417
- pub fn mat_mul_col ( & self , other : & ArrayBase < S , Ix > ) -> Array < A , Ix >
1417
+ pub fn mat_mul_col ( & self , rhs : & ArrayBase < S , Ix > ) -> Array < A , Ix >
1418
1418
{
1419
- let ( ( m, a) , n) = ( self . dim , other . dim ) ;
1419
+ let ( ( m, a) , n) = ( self . dim , rhs . dim ) ;
1420
1420
let ( self_columns, other_rows) = ( a, n) ;
1421
1421
assert ! ( self_columns == other_rows) ;
1422
1422
@@ -1429,7 +1429,7 @@ impl<A: Copy + linalg::Ring, S> ArrayBase<S, (Ix, Ix)>
1429
1429
for rr in res_elems. iter_mut ( ) {
1430
1430
unsafe {
1431
1431
let dot = ( 0 ..a) . fold ( libnum:: zero :: < A > ( ) ,
1432
- |s, k| s + * self . uchk_at ( ( i, k) ) * * other . uchk_at ( k)
1432
+ |s, k| s + * self . uchk_at ( ( i, k) ) * * rhs . uchk_at ( k)
1433
1433
) ;
1434
1434
std:: ptr:: write ( rr, dot) ;
1435
1435
}
@@ -1447,10 +1447,10 @@ impl<A: Float + PartialOrd, D: Dimension> Array<A, D>
1447
1447
/// Return `true` if the arrays' elementwise differences are all within
1448
1448
/// the given absolute tolerance.<br>
1449
1449
/// Return `false` otherwise, or if the shapes disagree.
1450
- pub fn allclose ( & self , other : & Array < A , D > , tol : A ) -> bool
1450
+ pub fn allclose ( & self , rhs : & Array < A , D > , tol : A ) -> bool
1451
1451
{
1452
- self . shape ( ) == other . shape ( ) &&
1453
- self . iter ( ) . zip ( other . iter ( ) ) . all ( |( x, y) | ( * x - * y) . abs ( ) <= tol)
1452
+ self . shape ( ) == rhs . shape ( ) &&
1453
+ self . iter ( ) . zip ( rhs . iter ( ) ) . all ( |( x, y) | ( * x - * y) . abs ( ) <= tol)
1454
1454
}
1455
1455
}
1456
1456
@@ -1466,22 +1466,22 @@ impl<A, S, D> ArrayBase<S, D> where
1466
1466
{
1467
1467
/// Perform elementwise
1468
1468
#[ doc=$doc]
1469
- /// between `self` and `other `,
1469
+ /// between `self` and `rhs `,
1470
1470
/// *in place*.
1471
1471
///
1472
- /// If their shapes disagree, `other ` is broadcast to the shape of `self`.
1472
+ /// If their shapes disagree, `rhs ` is broadcast to the shape of `self`.
1473
1473
///
1474
1474
/// **Panics** if broadcasting isn't possible.
1475
- pub fn $imethod <E : Dimension , S2 > ( & mut self , other : & ArrayBase <S2 , E >)
1475
+ pub fn $imethod <E : Dimension , S2 > ( & mut self , rhs : & ArrayBase <S2 , E >)
1476
1476
where S2 : Data <Elem =A >,
1477
1477
{
1478
- if self . dim. ndim( ) == other . dim. ndim( ) &&
1479
- self . shape( ) == other . shape( ) {
1480
- for ( x, y) in self . iter_mut( ) . zip( other . iter( ) ) {
1478
+ if self . dim. ndim( ) == rhs . dim. ndim( ) &&
1479
+ self . shape( ) == rhs . shape( ) {
1480
+ for ( x, y) in self . iter_mut( ) . zip( rhs . iter( ) ) {
1481
1481
* x = ( x. clone( ) ) . $mth ( y. clone( ) ) ;
1482
1482
}
1483
1483
} else {
1484
- let other_iter = other . broadcast_iter_unwrap( self . dim( ) ) ;
1484
+ let other_iter = rhs . broadcast_iter_unwrap( self . dim( ) ) ;
1485
1485
for ( x, y) in self . iter_mut( ) . zip( other_iter) {
1486
1486
* x = ( x. clone( ) ) . $mth ( y. clone( ) ) ;
1487
1487
}
@@ -1502,10 +1502,10 @@ impl<A, S, D> ArrayBase<S, D> where
1502
1502
1503
1503
/// Perform elementwise
1504
1504
#[ doc=$doc]
1505
- /// between `self` and `other `,
1505
+ /// between `self` and `rhs `,
1506
1506
/// and return the result.
1507
1507
///
1508
- /// If their shapes disagree, `other ` is broadcast to the shape of `self`.
1508
+ /// If their shapes disagree, `rhs ` is broadcast to the shape of `self`.
1509
1509
///
1510
1510
/// **Panics** if broadcasting isn't possible.
1511
1511
impl <A , S , S2 , D , E > $trt<ArrayBase <S2 , E >> for ArrayBase <S , D >
@@ -1516,15 +1516,15 @@ impl<A, S, S2, D, E> $trt<ArrayBase<S2, E>> for ArrayBase<S, D>
1516
1516
E : Dimension ,
1517
1517
{
1518
1518
type Output = ArrayBase <S , D >;
1519
- fn $mth ( mut self , other : ArrayBase <S2 , E >) -> ArrayBase <S , D >
1519
+ fn $mth ( mut self , rhs : ArrayBase <S2 , E >) -> ArrayBase <S , D >
1520
1520
{
1521
1521
// FIXME: Can we co-broadcast arrays here? And how?
1522
- if self . shape( ) == other . shape( ) {
1523
- for ( x, y) in self . iter_mut( ) . zip( other . iter( ) ) {
1522
+ if self . shape( ) == rhs . shape( ) {
1523
+ for ( x, y) in self . iter_mut( ) . zip( rhs . iter( ) ) {
1524
1524
* x = x. clone( ) . $mth ( y. clone( ) ) ;
1525
1525
}
1526
1526
} else {
1527
- let other_iter = other . broadcast_iter_unwrap( self . dim( ) ) ;
1527
+ let other_iter = rhs . broadcast_iter_unwrap( self . dim( ) ) ;
1528
1528
for ( x, y) in self . iter_mut( ) . zip( other_iter) {
1529
1529
* x = x. clone( ) . $mth ( y. clone( ) ) ;
1530
1530
}
@@ -1535,10 +1535,10 @@ impl<A, S, S2, D, E> $trt<ArrayBase<S2, E>> for ArrayBase<S, D>
1535
1535
1536
1536
/// Perform elementwise
1537
1537
#[ doc=$doc]
1538
- /// between `self` and `other `,
1538
+ /// between `self` and `rhs `,
1539
1539
/// and return the result.
1540
1540
///
1541
- /// If their shapes disagree, `other ` is broadcast to the shape of `self`.
1541
+ /// If their shapes disagree, `rhs ` is broadcast to the shape of `self`.
1542
1542
///
1543
1543
/// **Panics** if broadcasting isn't possible.
1544
1544
impl <' a, A , S , S2 , D , E > $trt<& ' a ArrayBase <S2 , E >> for & ' a ArrayBase <S , D >
@@ -1549,16 +1549,16 @@ impl<'a, A, S, S2, D, E> $trt<&'a ArrayBase<S2, E>> for &'a ArrayBase<S, D>
1549
1549
E : Dimension ,
1550
1550
{
1551
1551
type Output = OwnedArray <A , D >;
1552
- fn $mth ( self , other : & ' a ArrayBase <S2 , E >) -> OwnedArray <A , D >
1552
+ fn $mth ( self , rhs : & ' a ArrayBase <S2 , E >) -> OwnedArray <A , D >
1553
1553
{
1554
1554
// FIXME: Can we co-broadcast arrays here? And how?
1555
1555
let mut result = Vec :: <A >:: with_capacity( self . dim. size( ) ) ;
1556
- if self . shape( ) == other . shape( ) {
1557
- for ( x, y) in self . iter( ) . zip( other . iter( ) ) {
1556
+ if self . shape( ) == rhs . shape( ) {
1557
+ for ( x, y) in self . iter( ) . zip( rhs . iter( ) ) {
1558
1558
result. push( ( x. clone( ) ) . $mth ( y. clone( ) ) ) ;
1559
1559
}
1560
1560
} else {
1561
- let other_iter = other . broadcast_iter_unwrap( self . dim( ) ) ;
1561
+ let other_iter = rhs . broadcast_iter_unwrap( self . dim( ) ) ;
1562
1562
for ( x, y) in self . iter( ) . zip( other_iter) {
1563
1563
result. push( ( x. clone( ) ) . $mth ( y. clone( ) ) ) ;
1564
1564
}
@@ -1602,7 +1602,7 @@ mod assign_ops {
1602
1602
( $trt: ident, $method: ident, $doc: expr) => {
1603
1603
1604
1604
#[ doc=$doc]
1605
- /// If their shapes disagree, `other ` is broadcast to the shape of `self`.
1605
+ /// If their shapes disagree, `rhs ` is broadcast to the shape of `self`.
1606
1606
///
1607
1607
/// **Panics** if broadcasting isn't possible.
1608
1608
///
@@ -1614,13 +1614,13 @@ mod assign_ops {
1614
1614
D : Dimension ,
1615
1615
E : Dimension ,
1616
1616
{
1617
- fn $method( & mut self , other : & ArrayBase <S2 , E >) {
1618
- if self . shape( ) == other . shape( ) {
1619
- for ( x, y) in self . iter_mut( ) . zip( other . iter( ) ) {
1617
+ fn $method( & mut self , rhs : & ArrayBase <S2 , E >) {
1618
+ if self . shape( ) == rhs . shape( ) {
1619
+ for ( x, y) in self . iter_mut( ) . zip( rhs . iter( ) ) {
1620
1620
x. $method( y. clone( ) ) ;
1621
1621
}
1622
1622
} else {
1623
- let other_iter = other . broadcast_iter_unwrap( self . dim( ) ) ;
1623
+ let other_iter = rhs . broadcast_iter_unwrap( self . dim( ) ) ;
1624
1624
for ( x, y) in self . iter_mut( ) . zip( other_iter) {
1625
1625
x. $method( y. clone( ) ) ;
1626
1626
}
@@ -1632,21 +1632,21 @@ mod assign_ops {
1632
1632
}
1633
1633
1634
1634
impl_assign_op ! ( AddAssign , add_assign,
1635
- "Implement `self += other ` as elementwise addition (in place).\n " ) ;
1635
+ "Implement `self += rhs ` as elementwise addition (in place).\n " ) ;
1636
1636
impl_assign_op ! ( SubAssign , sub_assign,
1637
- "Implement `self -= other ` as elementwise subtraction (in place).\n " ) ;
1637
+ "Implement `self -= rhs ` as elementwise subtraction (in place).\n " ) ;
1638
1638
impl_assign_op ! ( MulAssign , mul_assign,
1639
- "Implement `self *= other ` as elementwise multiplication (in place).\n " ) ;
1639
+ "Implement `self *= rhs ` as elementwise multiplication (in place).\n " ) ;
1640
1640
impl_assign_op ! ( DivAssign , div_assign,
1641
- "Implement `self /= other ` as elementwise division (in place).\n " ) ;
1641
+ "Implement `self /= rhs ` as elementwise division (in place).\n " ) ;
1642
1642
impl_assign_op ! ( RemAssign , rem_assign,
1643
- "Implement `self %= other ` as elementwise remainder (in place).\n " ) ;
1643
+ "Implement `self %= rhs ` as elementwise remainder (in place).\n " ) ;
1644
1644
impl_assign_op ! ( BitAndAssign , bitand_assign,
1645
- "Implement `self &= other ` as elementwise bit and (in place).\n " ) ;
1645
+ "Implement `self &= rhs ` as elementwise bit and (in place).\n " ) ;
1646
1646
impl_assign_op ! ( BitOrAssign , bitor_assign,
1647
- "Implement `self |= other ` as elementwise bit or (in place).\n " ) ;
1647
+ "Implement `self |= rhs ` as elementwise bit or (in place).\n " ) ;
1648
1648
impl_assign_op ! ( BitXorAssign , bitxor_assign,
1649
- "Implement `self ^= other ` as elementwise bit xor (in place).\n " ) ;
1649
+ "Implement `self ^= rhs ` as elementwise bit xor (in place).\n " ) ;
1650
1650
}
1651
1651
1652
1652
impl < A : Clone + Neg < Output =A > , D : Dimension >
0 commit comments