@@ -25,7 +25,7 @@ impl Add for &Ideal {
2525 type Output = Ideal ;
2626
2727 fn add ( self , other : Self ) -> Self :: Output {
28- debug_assert_eq ! ( self . len ( ) , other. len ( ) ) ;
28+ debug_assert_eq ! ( self . dimension ( ) , other. dimension ( ) ) ;
2929 Ideal (
3030 self . 0
3131 . iter ( )
@@ -45,7 +45,7 @@ impl Add for Ideal {
4545
4646impl AddAssign for Ideal {
4747 fn add_assign ( & mut self , other : Self ) {
48- debug_assert_eq ! ( self . len ( ) , other. len ( ) ) ;
48+ debug_assert_eq ! ( self . dimension ( ) , other. dimension ( ) ) ;
4949 for ( i, x) in self . 0 . iter_mut ( ) . enumerate ( ) {
5050 * x += other. 0 [ i] ;
5151 }
@@ -100,7 +100,9 @@ impl Ideal {
100100 self . 0 . iter ( ) . enumerate ( ) . all ( |( i, & x) | x <= other. 0 [ i] )
101101 }
102102
103- pub fn len ( & self ) -> usize {
103+ /// Returns the dimension of this ideal,
104+ /// which for us is the number of states in the NFA
105+ pub fn dimension ( & self ) -> usize {
104106 self . 0 . len ( )
105107 }
106108
@@ -113,7 +115,7 @@ impl Ideal {
113115 }
114116
115117 pub fn intersection ( x : & Ideal , ideal : & Ideal ) -> Ideal {
116- debug_assert_eq ! ( x. len ( ) , ideal. len ( ) ) ;
118+ debug_assert_eq ! ( x. dimension ( ) , ideal. dimension ( ) ) ;
117119 Ideal (
118120 x. 0 . iter ( )
119121 . zip ( ideal. 0 . iter ( ) )
@@ -184,8 +186,8 @@ impl Ideal {
184186
185187 //why AddAssign does not allow adding a reference !!??
186188 pub fn add_other ( & mut self , x : & Ideal ) {
187- debug_assert_eq ! ( self . len ( ) , x. len ( ) ) ;
188- for i in 0 ..self . len ( ) {
189+ debug_assert_eq ! ( self . dimension ( ) , x. dimension ( ) ) ;
190+ for i in 0 ..self . dimension ( ) {
189191 self . 0 [ i] += x. 0 [ i] ;
190192 }
191193 }
0 commit comments