changes
This commit is contained in:
@@ -94,13 +94,11 @@ impl RoyaltyTree {
|
||||
} else {
|
||||
let w0=self.weight_here_below(index);
|
||||
let w1=self.weight_below(index);
|
||||
println!("Weight_here at {}, weight_here_below {}, weight_below {}",index,w0,w1);
|
||||
w0-w1
|
||||
}
|
||||
}
|
||||
fn expand_to(&mut self, index: usize) -> &mut Self {
|
||||
println!("Expand_to {} ",index);
|
||||
for _ in self.tree.len()..=index { println!(" Push!"); self.tree.push(Royalty::new()) }
|
||||
for _ in self.tree.len()..=index { self.tree.push(Royalty::new()) }
|
||||
self
|
||||
}
|
||||
fn capture0(&mut self, index: usize) -> &mut Self {
|
||||
@@ -136,10 +134,8 @@ impl RoyaltyTree {
|
||||
fn add_royalty(&mut self, amount: FiNum) {
|
||||
let ff=self.forefather();
|
||||
self.tree[ff].lazy+=amount;
|
||||
println!("Add royalty amount {}, storing at node {}, lazy amount there is now {}",amount,ff,self.tree[ff].lazy);
|
||||
}
|
||||
fn add_weight(&mut self, index: usize, weight: FiNum) {
|
||||
println!("Add_weight at {}",index);
|
||||
if self.tree.len()>0 {
|
||||
let mut ff0=self.forefather();
|
||||
let ff1=wt_forefather(index);
|
||||
@@ -154,7 +150,6 @@ impl RoyaltyTree {
|
||||
self.get_royalty(index); // Just for the side effect of capturing everything to this point
|
||||
let mut index=index;
|
||||
let ff=self.forefather();
|
||||
println!("Ascending from {} to {}",index,ff);
|
||||
while index!=ff {
|
||||
self.tree[index].weight+=weight;
|
||||
index=wt_parent(index);
|
||||
|
||||
Reference in New Issue
Block a user