CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::TestEnum Class Reference

#include <TestEnum.hh>

+ Inheritance diagram for CASM::TestEnum:

Detailed Description

Enumerate over all possible occupations in a particular Supercell.

Definition at line 24 of file TestEnum.hh.

Public Types

typedef InputEnumIterator
< Configuration, IsConst > 
iterator
 
typedef Configuration value_type
 
typedef CASM_TMP::ConstSwitch
< IsConst, Configuration > & 
reference
 
typedef long step_type
 

Public Member Functions

 TestEnum (Supercell &_scel)
 Construct with a Supercell, using all permutations. More...
 
std::string name () const override
 Derived enumerators must implement name, via ENUM_MEMBERS. More...
 
iterator begin ()
 
iterator end ()
 
reference current () const
 Access the current ObjectType by reference. More...
 
step_type step () const
 Increments with each enumerated object. More...
 
bool valid () const
 Returns false if enumeration is complete. More...
 
virtual jsonParser source (step_type step) const
 

Static Public Member Functions

static int run (PrimClex &primclex, const jsonParser &kwargs, const Completer::EnumOption &enum_opt)
 

Static Public Attributes

static const std::string enumerator_name = "TestEnum"
 
static const std::string interface_help
 

Protected Member Functions

void _initialize (value_type *_initial)
 
void _initialize ()
 
void _set_current_ptr (value_type *_new)
 Change the pointer. More...
 
value_type_current ()
 Access the current ObjectType by reference. More...
 
void _set_step (step_type val)
 Set current step value. More...
 
void _increment_step ()
 Increment current step value. More...
 
void _decrement_step ()
 Decrement current step value. More...
 
void _invalidate ()
 Call if enumeration complete. More...
 
void _validate ()
 Used if random access enumerator step is moved into valid range. More...
 

Private Member Functions

void increment () override
 Implements increment. More...
 
bool _check_current () const
 Returns true if current() is primitive and canonical. More...
 

Private Attributes

Counter< Array< int > > m_counter
 
notstd::cloneable_ptr
< Configuration
m_current
 

Member Typedef Documentation

Definition at line 231 of file InputEnumerator.hh.

typedef CASM_TMP::ConstSwitch<IsConst, Configuration >& CASM::ValEnumerator< Configuration , IsConst >::reference
inherited

Definition at line 192 of file Enumerator.hh.

typedef long CASM::EnumeratorBase::step_type
inherited

Definition at line 103 of file Enumerator.hh.

typedef Configuration CASM::ValEnumerator< Configuration , IsConst >::value_type
inherited

Definition at line 191 of file Enumerator.hh.

Constructor & Destructor Documentation

CASM::TestEnum::TestEnum ( Supercell _scel)

Construct with a Supercell, using all permutations.

Definition at line 78 of file TestEnum.cc.

Member Function Documentation

bool CASM::TestEnum::_check_current ( ) const
private

Returns true if current() is primitive and canonical.

Definition at line 121 of file TestEnum.cc.

value_type& CASM::ValEnumerator< Configuration , IsConst >::_current ( )
inlineprotectedinherited

Access the current ObjectType by reference.

Definition at line 244 of file Enumerator.hh.

void CASM::EnumeratorBase::_decrement_step ( )
inlineprotectedinherited

Decrement current step value.

Definition at line 164 of file Enumerator.hh.

void CASM::EnumeratorBase::_increment_step ( )
inlineprotectedinherited

Increment current step value.

Definition at line 159 of file Enumerator.hh.

void CASM::EnumeratorBase::_initialize ( )
inlineprotectedinherited

Initialize

  • Sets step to 0
  • Sets valid to true

Definition at line 148 of file Enumerator.hh.

void CASM::ValEnumerator< Configuration , IsConst >::_initialize ( value_type _initial)
inlineprotectedinherited

Initialize

  • Sets current to point at _initial
  • Sets step to 0
  • Sets valid to true

Definition at line 216 of file Enumerator.hh.

void CASM::EnumeratorBase::_invalidate ( )
inlineprotectedinherited

Call if enumeration complete.

Definition at line 169 of file Enumerator.hh.

void CASM::ValEnumerator< Configuration , IsConst >::_set_current_ptr ( value_type _new)
inlineprotectedinherited

Change the pointer.

Definition at line 239 of file Enumerator.hh.

void CASM::EnumeratorBase::_set_step ( step_type  val)
inlineprotectedinherited

Set current step value.

Definition at line 154 of file Enumerator.hh.

void CASM::EnumeratorBase::_validate ( )
inlineprotectedinherited

Used if random access enumerator step is moved into valid range.

Definition at line 174 of file Enumerator.hh.

iterator CASM::InputEnumeratorBase< Configuration , IsConst >::begin ( )
inlineinherited

Definition at line 245 of file InputEnumerator.hh.

reference CASM::ValEnumerator< Configuration , IsConst >::current ( ) const
inlineinherited

Access the current ObjectType by reference.

Definition at line 232 of file Enumerator.hh.

iterator CASM::InputEnumeratorBase< Configuration , IsConst >::end ( )
inlineinherited

Definition at line 249 of file InputEnumerator.hh.

void CASM::TestEnum::increment ( )
overrideprivatevirtual

Implements increment.

Implements _increment over all occupations.

Implements CASM::InputEnumeratorBase< Configuration >.

Definition at line 101 of file TestEnum.cc.

std::string CASM::TestEnum::name ( ) const
inlineoverridevirtual

Derived enumerators must implement name, via ENUM_MEMBERS.

Implements CASM::EnumeratorBase.

Definition at line 33 of file TestEnum.hh.

int CASM::TestEnum::run ( PrimClex primclex,
const jsonParser kwargs,
const Completer::EnumOption enum_opt 
)
static

Definition at line 53 of file TestEnum.cc.

virtual jsonParser CASM::EnumeratorBase::source ( step_type  step) const
inlinevirtualinherited

Default Object source just uses step#

Returns:

{
"enumerated_by": "<enumerator_type>",
"step": <step #>
}

Definition at line 131 of file Enumerator.hh.

step_type CASM::EnumeratorBase::step ( ) const
inlineinherited

Increments with each enumerated object.

Definition at line 113 of file Enumerator.hh.

bool CASM::EnumeratorBase::valid ( ) const
inlineinherited

Returns false if enumeration is complete.

Definition at line 118 of file Enumerator.hh.

Member Data Documentation

const std::string CASM::TestEnum::enumerator_name = "TestEnum"
static

Definition at line 37 of file TestEnum.hh.

const std::string CASM::TestEnum::interface_help
static
Initial value:
=
"TestEnum: \n\n"
" supercells: ScelEnum JSON settings (default='{\"existing_only\"=true}')\n"
" Indicate supercells to enumerate all occupational configurations in. May \n"
" be a JSON array of supercell names, or a JSON object specifying \n"
" supercells in terms of size and unit cell. By default, all existing \n"
" supercells are used. See 'ScelEnum' description for details. \n\n"
" filter: string (optional, default=None)\n"
" A query command to use to filter which Configurations are kept. \n"
"\n"
" Examples:\n"
" To enumerate all occupations in supercells up to and including size 4:\n"
" casm enum --method TestEnum -i '{\"supercells\": {\"max\": 4}}' \n"
"\n"
" To enumerate all occupations in all existing supercells:\n"
" casm enum --method TestEnum\n"
"\n"
" To enumerate all occupations in all particular supercells:\n"
" casm enum --method TestEnum -i \n"
" '{ \n"
" \"supercells\": { \n"
" \"name\": [\n"
" \"SCEL1_1_1_1_0_0_0\",\n"
" \"SCEL2_1_2_1_0_0_0\",\n"
" \"SCEL4_1_4_1_0_0_0\"\n"
" ]\n"
" } \n"
" }' \n\n"

Definition at line 38 of file TestEnum.hh.

Counter<Array<int> > CASM::TestEnum::m_counter
private

Definition at line 53 of file TestEnum.hh.

notstd::cloneable_ptr<Configuration> CASM::TestEnum::m_current
private

Definition at line 54 of file TestEnum.hh.


The documentation for this class was generated from the following files: