Warning, file /include/Geant4/G4FermiIntegerPartition.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef G4INTEGERPARTITION_HH
0032 #define G4INTEGERPARTITION_HH
0033
0034 #include "globals.hh"
0035 #include <vector>
0036
0037 using G4FermiPartition = std::vector<std::uint32_t>;
0038
0039 class G4integerPartition
0040 {
0041 public:
0042 class Iterator;
0043
0044 Iterator begin() const;
0045
0046 Iterator end() const;
0047
0048 G4integerPartition(std::uint32_t number, std::uint32_t termsCount, std::uint32_t base = 1);
0049
0050 private:
0051 std::uint32_t number_;
0052 std::uint32_t termsCount_;
0053 std::uint32_t base_;
0054 };
0055
0056 class G4integerPartition::Iterator
0057 {
0058 public:
0059 friend class G4integerPartition;
0060
0061 using difference_type = std::int64_t;
0062 using value_type = G4FermiPartition;
0063 using reference = const G4FermiPartition&;
0064 using pointer = const G4FermiPartition*;
0065 using iterator_category = std::forward_iterator_tag;
0066
0067 Iterator(const Iterator&) = default;
0068
0069 Iterator& operator=(const Iterator&) = default;
0070
0071 pointer operator->() const;
0072
0073 reference operator*() const;
0074
0075 Iterator& operator++();
0076
0077 Iterator operator++(int);
0078
0079 G4bool operator==(const Iterator& other) const;
0080
0081 G4bool operator!=(const Iterator& other) const;
0082
0083 private:
0084
0085 Iterator() = default;
0086
0087 Iterator(std::uint32_t number, std::uint32_t termsCount, std::uint32_t base);
0088
0089 void NextPartition();
0090
0091 G4FermiPartition partition_;
0092 };
0093
0094 #endif