Skip to content

Commit

Permalink
implement clone_from for Mat
Browse files Browse the repository at this point in the history
  • Loading branch information
8000thCube authored and sarah-ek committed Sep 7, 2024
1 parent 5eef3eb commit 12c661f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/mat/matown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2069,6 +2069,12 @@ impl<E: Entity> Clone for Mat<E> {
E::faer_from_units(E::faer_deref(this.get_unchecked(i, j)))
})
}
}fn clone_from(&mut self,other:&Self){
let (rows,cols)=other.shape();
self.resize_with(0,0,|_,_|E::zeroed());
unsafe{
self.resize_with(rows,cols,|r,c|E::faer_deref(rhs.get_unchecked(r,c)))
}
}
}

Expand Down

0 comments on commit 12c661f

Please sign in to comment.