|
Samchon Framework for CPP
1.0.0
|
Case generator. More...
#include <CaseGenerator.hpp>
Public Member Functions | |
| CaseGenerator (size_t n, size_t r) | |
| Construct from size of N and R. More... | |
| auto | size () const -> size_t |
| Get size of all cases. More... | |
| virtual auto | operator[] (size_t) const -> std::vector< size_t >=0 |
| Get x'th case. More... | |
| auto | at (size_t) const -> std::vector< size_t > |
| auto | n () const -> size_t |
| Get size of the N. More... | |
| auto | r () const -> size_t |
| Get size of the R. More... | |
| auto | toMatrix () const -> std::vector< std::vector< size_t >> |
| Create a matrix containing all cases. More... | |
Protected Attributes | |
| size_t | n_ |
| N, size of the candidates. More... | |
| size_t | r_ |
| R, size of elements of each case. More... | |
| size_t | size_ |
| Size, the number of all cases. More... | |
Case generator.
An abstract case generator using like a matrix
Definition at line 25 of file CaseGenerator.hpp.
| CaseGenerator::CaseGenerator | ( | size_t | n, |
| size_t | r | ||
| ) |
Construct from size of N and R.
| n | Size of candidates |
| r | Size of elements of each case |
Definition at line 9 of file CaseGenerator.cpp.
| auto CaseGenerator::size | ( | ) | const -> size_t |
Get size of all cases.
Definition at line 18 of file CaseGenerator.cpp.
Referenced by samchon::example::packer::Packer::optimize().

|
pure virtual |
Get x'th case.
Implemented in samchon::library::CombinedPermutationGenerator, and samchon::library::PermutationGenerator.
| auto CaseGenerator::at | ( | size_t | index | ) | const -> std::vector<size_t> |
Definition at line 22 of file CaseGenerator.cpp.
| auto CaseGenerator::n | ( | ) | const -> size_t |
Get size of the N.
Definition at line 30 of file CaseGenerator.cpp.
Referenced by samchon::library::PermutationGenerator::PermutationGenerator().

| auto CaseGenerator::r | ( | ) | const -> size_t |
Get size of the R.
Definition at line 34 of file CaseGenerator.cpp.
Referenced by samchon::library::CombinedPermutationGenerator::CombinedPermutationGenerator(), and samchon::library::PermutationGenerator::PermutationGenerator().

| auto CaseGenerator::toMatrix | ( | ) | const -> std::vector<std::vector<size_t>> |
Create a matrix containing all cases.
Definition at line 42 of file CaseGenerator.cpp.
|
protected |
N, size of the candidates.
Definition at line 31 of file CaseGenerator.hpp.
Referenced by samchon::library::CombinedPermutationGenerator::operator[]().
|
protected |
R, size of elements of each case.
Definition at line 36 of file CaseGenerator.hpp.
Referenced by samchon::library::CombinedPermutationGenerator::operator[](), and samchon::library::PermutationGenerator::operator[]().
|
protected |
Size, the number of all cases.
Definition at line 41 of file CaseGenerator.hpp.
Referenced by samchon::library::CombinedPermutationGenerator::CombinedPermutationGenerator(), and samchon::library::PermutationGenerator::PermutationGenerator().