Skip to content

Commit

Permalink
fix(projectors): correct implementation of sample in Scale and Shift
Browse files Browse the repository at this point in the history
  • Loading branch information
tspooner committed May 4, 2018
1 parent b5f8481 commit e324244
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/projectors/mixing/scaling.rs
Expand Up @@ -25,7 +25,7 @@ impl<I: ?Sized, P: Projector<I>> Space for Scale<I, P> {
type Value = Projection;

fn sample(&self, rng: &mut ThreadRng) -> Projection {
self.projector.sample(rng)
Projection::Dense(self.projector.sample(rng).expanded(self.dim()) * self.scale)
}

fn dim(&self) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion src/projectors/mixing/shifting.rs
Expand Up @@ -25,7 +25,7 @@ impl<I: ?Sized, P: Projector<I>> Space for Shift<I, P> {
type Value = Projection;

fn sample(&self, rng: &mut ThreadRng) -> Projection {
self.projector.sample(rng)
Projection::Dense(self.projector.sample(rng).expanded(self.dim()) + self.offset)
}

fn dim(&self) -> usize {
Expand Down

0 comments on commit e324244

Please sign in to comment.