channel add
This commit is contained in:
14
Code/ldpc/src/channel.rs
Normal file
14
Code/ldpc/src/channel.rs
Normal file
@ -0,0 +1,14 @@
|
||||
pub rand::Rng;
|
||||
|
||||
pub struct Channel {
|
||||
pub error_prob: f64,
|
||||
}
|
||||
|
||||
impl Channel {
|
||||
pub fn new(error_prob: f64) -> Self {
|
||||
assert!(error_prob >= 0.0 && error_prob <= 1.0, "0 <= p <= 1");
|
||||
Self {error_prob}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user