#include <Ca.h>
The CA has fixed size [width = height] and two possible states per cell. Cyclic or hard-zeroed CA's boundary can be switched by the CA_CYCLIC_NEIGHBORHOOD compile-time option.
Definition at line 114 of file Ca.h.
Public Member Functions | ||||
| CaState (size_t size) | ||||
| ||||
| size_t | size () const | |||
| Return size of CA in one direction. | ||||
| bool | getCellAtPos (Pos pos) const | |||
| Return cell state at given position (respecting selected boundary settings). | ||||
| void | setCellAtPos (Pos pos, bool val) | |||
| Set cell state at given position to given value (respecting selected boundary settings). | ||||
| bool | operator== (const CaState &other) const | |||
| bool | operator!= (const CaState &other) const | |||
Private Attributes | ||||
| size_t | size_ | |||
| boost::dynamic_bitset | bitset_ | |||
| CaState | ( | size_t | size | ) |
| size_t size | ( | ) | const |
Return size of CA in one direction.
Definition at line 149 of file Ca.cpp.
References size_.
Referenced by applyRules(), operator<<(), and writeCaState().

| bool getCellAtPos | ( | Pos | pos | ) | const |
Return cell state at given position (respecting selected boundary settings).
| pos | Position of the cell whose state ought be returned. |
Definition at line 153 of file Ca.cpp.
References bitset_, Pos::col, Pos::row, and size_.
Referenced by applyRule(), operator<<(), and writeCaState().

| void setCellAtPos | ( | Pos | pos, | |
| bool | val | |||
| ) |
Set cell state at given position to given value (respecting selected boundary settings).
| pos | Position of the cell whose state is being changed. | |
| val | New value (state) for the selected cell. |
Definition at line 174 of file Ca.cpp.
References bitset_, Pos::col, Pos::row, and size_.
Referenced by applyRules().

| bool operator== | ( | const CaState & | other | ) | const |
Definition at line 194 of file Ca.cpp.
References bitset_, and size_.
Referenced by operator!=().

| bool operator!= | ( | const CaState & | other | ) | const [inline] |
Definition at line 143 of file Ca.h.
References operator==().

size_t size_ [private] |
Definition at line 148 of file Ca.h.
Referenced by getCellAtPos(), operator==(), setCellAtPos(), and size().
boost::dynamic_bitset bitset_ [private] |
Definition at line 149 of file Ca.h.
Referenced by CaState(), getCellAtPos(), operator==(), and setCellAtPos().
1.5.4