@@ -74,6 +74,12 @@ struct GammaBuilder;
74
74
struct LogNormal ;
75
75
struct LogNormalBuilder ;
76
76
77
+ struct Binomial ;
78
+ struct BinomialBuilder ;
79
+
80
+ struct Weibull ;
81
+ struct WeibullBuilder ;
82
+
77
83
enum MessageBody {
78
84
MessageBody_NONE = 0 ,
79
85
MessageBody_Handshake = 1 ,
@@ -196,11 +202,13 @@ enum Distribution {
196
202
Distribution_Exponential = 7 ,
197
203
Distribution_Gamma = 8 ,
198
204
Distribution_LogNormal = 9 ,
205
+ Distribution_Binomial = 10 ,
206
+ Distribution_Weibull = 11 ,
199
207
Distribution_MIN = Distribution_NONE,
200
- Distribution_MAX = Distribution_LogNormal
208
+ Distribution_MAX = Distribution_Weibull
201
209
};
202
210
203
- inline const Distribution (&EnumValuesDistribution ())[10 ] {
211
+ inline const Distribution (&EnumValuesDistribution ())[12 ] {
204
212
static const Distribution values[] = {
205
213
Distribution_NONE,
206
214
Distribution_Normal,
@@ -211,13 +219,15 @@ inline const Distribution (&EnumValuesDistribution())[10] {
211
219
Distribution_Beta,
212
220
Distribution_Exponential,
213
221
Distribution_Gamma,
214
- Distribution_LogNormal
222
+ Distribution_LogNormal,
223
+ Distribution_Binomial,
224
+ Distribution_Weibull
215
225
};
216
226
return values;
217
227
}
218
228
219
229
inline const char * const *EnumNamesDistribution () {
220
- static const char * const names[11 ] = {
230
+ static const char * const names[13 ] = {
221
231
" NONE" ,
222
232
" Normal" ,
223
233
" Uniform" ,
@@ -228,13 +238,15 @@ inline const char * const *EnumNamesDistribution() {
228
238
" Exponential" ,
229
239
" Gamma" ,
230
240
" LogNormal" ,
241
+ " Binomial" ,
242
+ " Weibull" ,
231
243
nullptr
232
244
};
233
245
return names;
234
246
}
235
247
236
248
inline const char *EnumNameDistribution (Distribution e) {
237
- if (flatbuffers::IsOutRange (e, Distribution_NONE, Distribution_LogNormal )) return " " ;
249
+ if (flatbuffers::IsOutRange (e, Distribution_NONE, Distribution_Weibull )) return " " ;
238
250
const size_t index = static_cast <size_t >(e);
239
251
return EnumNamesDistribution ()[index];
240
252
}
@@ -279,6 +291,14 @@ template<> struct DistributionTraits<ppx::LogNormal> {
279
291
static const Distribution enum_value = Distribution_LogNormal;
280
292
};
281
293
294
+ template <> struct DistributionTraits <ppx::Binomial> {
295
+ static const Distribution enum_value = Distribution_Binomial;
296
+ };
297
+
298
+ template <> struct DistributionTraits <ppx::Weibull> {
299
+ static const Distribution enum_value = Distribution_Weibull;
300
+ };
301
+
282
302
bool VerifyDistribution (flatbuffers::Verifier &verifier, const void *obj, Distribution type);
283
303
bool VerifyDistributionVector (flatbuffers::Verifier &verifier, const flatbuffers::Vector<flatbuffers::Offset<void >> *values, const flatbuffers::Vector<uint8_t > *types);
284
304
@@ -720,6 +740,12 @@ struct Sample FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
720
740
const ppx::LogNormal *distribution_as_LogNormal () const {
721
741
return distribution_type () == ppx::Distribution_LogNormal ? static_cast <const ppx::LogNormal *>(distribution ()) : nullptr ;
722
742
}
743
+ const ppx::Binomial *distribution_as_Binomial () const {
744
+ return distribution_type () == ppx::Distribution_Binomial ? static_cast <const ppx::Binomial *>(distribution ()) : nullptr ;
745
+ }
746
+ const ppx::Weibull *distribution_as_Weibull () const {
747
+ return distribution_type () == ppx::Distribution_Weibull ? static_cast <const ppx::Weibull *>(distribution ()) : nullptr ;
748
+ }
723
749
bool control () const {
724
750
return GetField<uint8_t >(VT_CONTROL, 1 ) != 0 ;
725
751
}
@@ -777,6 +803,14 @@ template<> inline const ppx::LogNormal *Sample::distribution_as<ppx::LogNormal>(
777
803
return distribution_as_LogNormal ();
778
804
}
779
805
806
+ template <> inline const ppx::Binomial *Sample::distribution_as<ppx::Binomial>() const {
807
+ return distribution_as_Binomial ();
808
+ }
809
+
810
+ template <> inline const ppx::Weibull *Sample::distribution_as<ppx::Weibull>() const {
811
+ return distribution_as_Weibull ();
812
+ }
813
+
780
814
struct SampleBuilder {
781
815
typedef Sample Table;
782
816
flatbuffers::FlatBufferBuilder &fbb_;
@@ -941,6 +975,12 @@ struct Observe FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
941
975
const ppx::LogNormal *distribution_as_LogNormal () const {
942
976
return distribution_type () == ppx::Distribution_LogNormal ? static_cast <const ppx::LogNormal *>(distribution ()) : nullptr ;
943
977
}
978
+ const ppx::Binomial *distribution_as_Binomial () const {
979
+ return distribution_type () == ppx::Distribution_Binomial ? static_cast <const ppx::Binomial *>(distribution ()) : nullptr ;
980
+ }
981
+ const ppx::Weibull *distribution_as_Weibull () const {
982
+ return distribution_type () == ppx::Distribution_Weibull ? static_cast <const ppx::Weibull *>(distribution ()) : nullptr ;
983
+ }
944
984
const ppx::Tensor *value () const {
945
985
return GetPointer<const ppx::Tensor *>(VT_VALUE);
946
986
}
@@ -995,6 +1035,14 @@ template<> inline const ppx::LogNormal *Observe::distribution_as<ppx::LogNormal>
995
1035
return distribution_as_LogNormal ();
996
1036
}
997
1037
1038
+ template <> inline const ppx::Binomial *Observe::distribution_as<ppx::Binomial>() const {
1039
+ return distribution_as_Binomial ();
1040
+ }
1041
+
1042
+ template <> inline const ppx::Weibull *Observe::distribution_as<ppx::Weibull>() const {
1043
+ return distribution_as_Weibull ();
1044
+ }
1045
+
998
1046
struct ObserveBuilder {
999
1047
typedef Observe Table;
1000
1048
flatbuffers::FlatBufferBuilder &fbb_;
@@ -1671,6 +1719,114 @@ inline flatbuffers::Offset<LogNormal> CreateLogNormal(
1671
1719
return builder_.Finish ();
1672
1720
}
1673
1721
1722
+ struct Binomial FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1723
+ typedef BinomialBuilder Builder;
1724
+ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1725
+ VT_TOTAL_COUNT = 4 ,
1726
+ VT_PROBS = 6
1727
+ };
1728
+ const ppx::Tensor *total_count () const {
1729
+ return GetPointer<const ppx::Tensor *>(VT_TOTAL_COUNT);
1730
+ }
1731
+ const ppx::Tensor *probs () const {
1732
+ return GetPointer<const ppx::Tensor *>(VT_PROBS);
1733
+ }
1734
+ bool Verify (flatbuffers::Verifier &verifier) const {
1735
+ return VerifyTableStart (verifier) &&
1736
+ VerifyOffset (verifier, VT_TOTAL_COUNT) &&
1737
+ verifier.VerifyTable (total_count ()) &&
1738
+ VerifyOffset (verifier, VT_PROBS) &&
1739
+ verifier.VerifyTable (probs ()) &&
1740
+ verifier.EndTable ();
1741
+ }
1742
+ };
1743
+
1744
+ struct BinomialBuilder {
1745
+ typedef Binomial Table;
1746
+ flatbuffers::FlatBufferBuilder &fbb_;
1747
+ flatbuffers::uoffset_t start_;
1748
+ void add_total_count (flatbuffers::Offset<ppx::Tensor> total_count) {
1749
+ fbb_.AddOffset (Binomial::VT_TOTAL_COUNT, total_count);
1750
+ }
1751
+ void add_probs (flatbuffers::Offset<ppx::Tensor> probs) {
1752
+ fbb_.AddOffset (Binomial::VT_PROBS, probs);
1753
+ }
1754
+ explicit BinomialBuilder (flatbuffers::FlatBufferBuilder &_fbb)
1755
+ : fbb_(_fbb) {
1756
+ start_ = fbb_.StartTable ();
1757
+ }
1758
+ BinomialBuilder &operator =(const BinomialBuilder &);
1759
+ flatbuffers::Offset<Binomial> Finish () {
1760
+ const auto end = fbb_.EndTable (start_);
1761
+ auto o = flatbuffers::Offset<Binomial>(end);
1762
+ return o;
1763
+ }
1764
+ };
1765
+
1766
+ inline flatbuffers::Offset<Binomial> CreateBinomial (
1767
+ flatbuffers::FlatBufferBuilder &_fbb,
1768
+ flatbuffers::Offset<ppx::Tensor> total_count = 0 ,
1769
+ flatbuffers::Offset<ppx::Tensor> probs = 0 ) {
1770
+ BinomialBuilder builder_ (_fbb);
1771
+ builder_.add_probs (probs);
1772
+ builder_.add_total_count (total_count);
1773
+ return builder_.Finish ();
1774
+ }
1775
+
1776
+ struct Weibull FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
1777
+ typedef WeibullBuilder Builder;
1778
+ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
1779
+ VT_SCALE = 4 ,
1780
+ VT_CONCENTRATION = 6
1781
+ };
1782
+ const ppx::Tensor *scale () const {
1783
+ return GetPointer<const ppx::Tensor *>(VT_SCALE);
1784
+ }
1785
+ const ppx::Tensor *concentration () const {
1786
+ return GetPointer<const ppx::Tensor *>(VT_CONCENTRATION);
1787
+ }
1788
+ bool Verify (flatbuffers::Verifier &verifier) const {
1789
+ return VerifyTableStart (verifier) &&
1790
+ VerifyOffset (verifier, VT_SCALE) &&
1791
+ verifier.VerifyTable (scale ()) &&
1792
+ VerifyOffset (verifier, VT_CONCENTRATION) &&
1793
+ verifier.VerifyTable (concentration ()) &&
1794
+ verifier.EndTable ();
1795
+ }
1796
+ };
1797
+
1798
+ struct WeibullBuilder {
1799
+ typedef Weibull Table;
1800
+ flatbuffers::FlatBufferBuilder &fbb_;
1801
+ flatbuffers::uoffset_t start_;
1802
+ void add_scale (flatbuffers::Offset<ppx::Tensor> scale) {
1803
+ fbb_.AddOffset (Weibull::VT_SCALE, scale);
1804
+ }
1805
+ void add_concentration (flatbuffers::Offset<ppx::Tensor> concentration) {
1806
+ fbb_.AddOffset (Weibull::VT_CONCENTRATION, concentration);
1807
+ }
1808
+ explicit WeibullBuilder (flatbuffers::FlatBufferBuilder &_fbb)
1809
+ : fbb_(_fbb) {
1810
+ start_ = fbb_.StartTable ();
1811
+ }
1812
+ WeibullBuilder &operator =(const WeibullBuilder &);
1813
+ flatbuffers::Offset<Weibull> Finish () {
1814
+ const auto end = fbb_.EndTable (start_);
1815
+ auto o = flatbuffers::Offset<Weibull>(end);
1816
+ return o;
1817
+ }
1818
+ };
1819
+
1820
+ inline flatbuffers::Offset<Weibull> CreateWeibull (
1821
+ flatbuffers::FlatBufferBuilder &_fbb,
1822
+ flatbuffers::Offset<ppx::Tensor> scale = 0 ,
1823
+ flatbuffers::Offset<ppx::Tensor> concentration = 0 ) {
1824
+ WeibullBuilder builder_ (_fbb);
1825
+ builder_.add_concentration (concentration);
1826
+ builder_.add_scale (scale);
1827
+ return builder_.Finish ();
1828
+ }
1829
+
1674
1830
inline bool VerifyMessageBody (flatbuffers::Verifier &verifier, const void *obj, MessageBody type) {
1675
1831
switch (type) {
1676
1832
case MessageBody_NONE: {
@@ -1777,6 +1933,14 @@ inline bool VerifyDistribution(flatbuffers::Verifier &verifier, const void *obj,
1777
1933
auto ptr = reinterpret_cast <const ppx::LogNormal *>(obj);
1778
1934
return verifier.VerifyTable (ptr);
1779
1935
}
1936
+ case Distribution_Binomial: {
1937
+ auto ptr = reinterpret_cast <const ppx::Binomial *>(obj);
1938
+ return verifier.VerifyTable (ptr);
1939
+ }
1940
+ case Distribution_Weibull: {
1941
+ auto ptr = reinterpret_cast <const ppx::Weibull *>(obj);
1942
+ return verifier.VerifyTable (ptr);
1943
+ }
1780
1944
default : return true ;
1781
1945
}
1782
1946
}
0 commit comments