@@ -2552,28 +2552,28 @@ def random_rref_matrix(parent, num_pivots):
2552
2552
# Keep track of the non-pivot columns by using the pivot_index, start at the first column to
2553
2553
# the right of the initial pivot column, go until the first column to the left of the next
2554
2554
# pivot column.
2555
- for pivot_index in range (num_pivots - 1 ):
2556
- for non_pivot_column_index in range (pivots [pivot_index ]+ 1 , pivots [pivot_index + 1 ]):
2555
+ for pivot_index in range (num_pivots - 1 ):
2556
+ for non_pivot_column_index in range (pivots [pivot_index ] + 1 , pivots [pivot_index + 1 ]):
2557
2557
entry_generator1 = pd .RealDistribution ("beta" , [6 , 4 ])
2558
2558
# Experimental distribution used to generate the values.
2559
- for non_pivot_column_entry in range (pivot_index + 1 ):
2560
- sign1 = (2 * randint (0 ,1 ) - 1 )
2561
- return_matrix [non_pivot_column_entry ,non_pivot_column_index ]= sign1 * int (entry_generator1 .get_random_element ()* ((1 - non_pivot_column_entry / return_matrix .ncols ())* 7 ))
2559
+ for non_pivot_column_entry in range (pivot_index + 1 ):
2560
+ sign1 = (2 * randint (0 , 1 ) - 1 )
2561
+ return_matrix [non_pivot_column_entry , non_pivot_column_index ] = sign1 * int (entry_generator1 .get_random_element () * ((1 - non_pivot_column_entry / return_matrix .ncols ()) * 7 ))
2562
2562
# Use index to fill entries of the columns to the right of the last pivot column.
2563
- for rest_non_pivot_column in range (pivots [num_pivots - 1 ] + 1 , num_col ):
2564
- entry_generator2 = pd .RealDistribution ("beta" ,[2.6 ,4 ])
2563
+ for rest_non_pivot_column in range (pivots [num_pivots - 1 ] + 1 , num_col ):
2564
+ entry_generator2 = pd .RealDistribution ("beta" , [2.6 , 4 ])
2565
2565
# experimental distribution to generate small values.
2566
2566
for rest_entries in range (num_pivots ):
2567
- sign2 = ( 2 * randint (0 ,1 ) - 1 )
2568
- return_matrix [rest_entries ,rest_non_pivot_column ]= sign2 * int (entry_generator2 .get_random_element ()* 5 )
2567
+ sign2 = ( 2 * randint (0 , 1 ) - 1 )
2568
+ return_matrix [rest_entries , rest_non_pivot_column ] = sign2 * int (entry_generator2 .get_random_element () * 5 )
2569
2569
else :
2570
- for pivot_index in range (num_pivots - 1 ):
2571
- for non_pivot_column_index in range (pivots [pivot_index ]+ 1 , pivots [pivot_index + 1 ]):
2572
- for non_pivot_column_entry in range (pivot_index + 1 ):
2573
- return_matrix [non_pivot_column_entry ,non_pivot_column_index ]= ring .random_element ()
2574
- for rest_non_pivot_column in range (pivots [num_pivots - 1 ] + 1 , num_col ):
2570
+ for pivot_index in range (num_pivots - 1 ):
2571
+ for non_pivot_column_index in range (pivots [pivot_index ] + 1 , pivots [pivot_index + 1 ]):
2572
+ for non_pivot_column_entry in range (pivot_index + 1 ):
2573
+ return_matrix [non_pivot_column_entry , non_pivot_column_index ] = ring .random_element ()
2574
+ for rest_non_pivot_column in range (pivots [num_pivots - 1 ] + 1 , num_col ):
2575
2575
for rest_entries in range (num_pivots ):
2576
- return_matrix [rest_entries ,rest_non_pivot_column ]= ring .random_element ()
2576
+ return_matrix [rest_entries , rest_non_pivot_column ] = ring .random_element ()
2577
2577
return return_matrix
2578
2578
2579
2579
0 commit comments