src/rand_distr.rs

changeset 23
9869fa1e0ccd
parent 0
eb3c7813b67a
equal deleted inserted replaced
22:9fb8ecb3da74 23:9869fa1e0ccd
6 use serde::{Serialize, Deserialize}; 6 use serde::{Serialize, Deserialize};
7 use serde::ser::{Serializer, SerializeStruct}; 7 use serde::ser::{Serializer, SerializeStruct};
8 use alg_tools::types::*; 8 use alg_tools::types::*;
9 9
10 /// Wrapper for [`Normal`] that can be serialized by serde. 10 /// Wrapper for [`Normal`] that can be serialized by serde.
11 #[derive(Debug)]
11 pub struct SerializableNormal<T : Float>(Normal<T>) 12 pub struct SerializableNormal<T : Float>(Normal<T>)
12 where StandardNormal : Distribution<T>; 13 where StandardNormal : Distribution<T>;
13 14
14 impl<T : Float> Distribution<T> for SerializableNormal<T> 15 impl<T : Float> Distribution<T> for SerializableNormal<T>
15 where StandardNormal : Distribution<T> { 16 where StandardNormal : Distribution<T> {

mercurial