distr_param.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au)
  2. // Copyright 2008-2016 National ICT Australia (NICTA)
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // ------------------------------------------------------------------------
  15. //! \addtogroup distr_param
  16. //! @{
  17. class distr_param
  18. {
  19. public:
  20. uword state;
  21. union
  22. {
  23. int a_int;
  24. double a_double;
  25. };
  26. union
  27. {
  28. int b_int;
  29. double b_double;
  30. };
  31. inline distr_param()
  32. : state(0)
  33. {
  34. }
  35. inline explicit distr_param(const int a, const int b)
  36. : state(1)
  37. , a_int(a)
  38. , b_int(b)
  39. {
  40. }
  41. inline explicit distr_param(const double a, const double b)
  42. : state(2)
  43. , a_double(a)
  44. , b_double(b)
  45. {
  46. }
  47. };
  48. //! @}