Skip to content

Commit

Permalink
Fixed some spacing issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mercere99 committed Dec 2, 2023
1 parent 97bb567 commit b613f1d
Show file tree
Hide file tree
Showing 33 changed files with 114 additions and 114 deletions.
2 changes: 1 addition & 1 deletion include/emp/base/notify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ namespace notify {
/// Send out a notification of an ERROR.
template <typename... Ts>
static bool Error(Ts... args) {
bool success = Notify(Type::ERROR, std::forward<Ts>(args)...);
bool success = Notify(Type::ERROR, std::forward<Ts>(args)...);
if (!success) {
#ifdef NDEBUG
Exit(1);
Expand Down
12 changes: 6 additions & 6 deletions include/emp/bits/Bits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
* The Bits template allows the user to recreate the functionality of std::vector<bool>,
* array<bool>, std::bitset, and other such bit-handling classes.
*
*
* This class stores an arbitrary number of bits in a set of "fields" (typically 32 bits or 64
* bits per field, depending on which should be faster.) Individual bits can be extracted,
* -or- bitwise logic (including more complex bit magic) can be used on the groups of bits.
Expand All @@ -25,13 +25,13 @@
* StaticBitValue : Like BitValue, but max size and fixed memory.
* BitArray : A replacement for std::array<bool> (index 0 is on left)
* BitSet : A replacement for std::bitset (index 0 is on right)
*
*
* In the case of replacements, the aim was for identical functionality, but many additional
* features, especially associated with bitwise logic operations.
*
*
* @note Compile with -O3 and -msse4.2 for fast bit counting.
*
*
*
* @todo Most of the operators don't check to make sure that both Bit groups are the same size.
* We should create versions (Intersection() and Union()?) that adjust sizes if needed.
* @todo Do small BitVector optimization. Currently we have number of bits (8 bytes) and a
Expand Down Expand Up @@ -76,7 +76,7 @@ namespace emp {

/// @brief A flexible base template to handle BitVector, BitArray, BitSet, & other combinations.
/// @tparam DATA_T How is this Bits object allowed to change size?
/// @tparam ZERO_LEFT Should the index of zero be the left-most bit? (right-most if false)
/// @tparam ZERO_LEFT Should the index of zero be the left-most bit? (right-most if false)
template <typename DATA_T, bool ZERO_LEFT>
class Bits {
using this_t = Bits<DATA_T, ZERO_LEFT>;
Expand Down Expand Up @@ -160,7 +160,7 @@ namespace emp {

public:
/// @brief Default constructor; will build the default number of bits (often 0, but not always)
/// @param init_val Initial value of all default bits.
/// @param init_val Initial value of all default bits.
Bits(bool init_val=0) { if (init_val) SetAll(); else Clear(); }

/// @brief Build a new Bits with specified bit count and initialization (default 0)
Expand Down
8 changes: 4 additions & 4 deletions include/emp/bits/Bits_Data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,15 @@ namespace emp {
Bits_Data_Mem_Static_Base & operator=(Bits_Data_Mem_Static_Base &&) = default;

// --- Helper functions --

[[nodiscard]] Ptr<field_t> FieldPtr() { return bits.data(); }
[[nodiscard]] Ptr<const field_t> FieldPtr() const { return bits.data(); }

void RawResize(const size_t new_size, const bool preserve_data=false) {
const size_t old_num_fields = BASE_T::NumFields();
BASE_T::SetSize(new_size);
if (preserve_data && BASE_T::NumEndBits()) {
bits[BASE_T::LastField()] &= BASE_T::EndMask();
bits[BASE_T::LastField()] &= BASE_T::EndMask();
for (size_t id = BASE_T::NumFields(); id < old_num_fields; ++id) bits[id] = 0;
}
}
Expand All @@ -208,7 +208,7 @@ namespace emp {
}

};

template <size_t CAPACITY, size_t DEFAULT_SIZE=0>
using Bits_Data_Mem_Static =
Bits_Data_Mem_Static_Base< Bits_Data_Size_Var<DEFAULT_SIZE>, CAPACITY >;
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace emp {
base_t::SetSize(new_size);

if (preserve_data) {
// Clear any new (or previously unused) fields.
// Clear any new (or previously unused) fields.
for (size_t i = num_old_fields; i < num_new_fields; ++i) bits[i] = 0;

// Clear out any extra end bits.
Expand Down
2 changes: 1 addition & 1 deletion include/emp/bits/bitset_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace emp {
[[nodiscard]] static std::string BitFieldsToString(emp::Ptr<bits_field_t> bits, size_t count) {
std::stringstream ss;
for (size_t i = 0; i < count; ++i) {
if (i) ss << ' ';
if (i) ss << ' ';
ss << BitFieldToString(bits[i]);
}
return ss.str();
Expand Down
16 changes: 8 additions & 8 deletions include/emp/compiler/Lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
* @file Lexer.hpp
* @brief A general-purpose, fast lexer.
* @note Status: BETA
*
*
* Build a lexer that can convert input strings or streams into a series of provided tokens.
*
*
* Use AddToken(name, regex) to list out the relevant tokens.
* 'name' is the unique name for this token.
* 'regex' is the regular expression that describes this token.
* It will return a unique ID associated with this lexeme.
*
*
* IgnoreToken(name, regex) uses the same arguments, but is used for tokens that
* should be skipped over.
*
*
* Names and IDs can be recovered later using GetTokenID(name) and GetTokenName(id).
*
*
* Tokens can be retrieved either one at a time with Process(string) or Process(stream),
* which will return the next (non-ignored) token, removing it from the input.
*
*
* Alternatively, an entire series of tokens can be processed with Tokenize().
*
*
* Finally, GetLexeme() can be used to retrieve the lexeme from the most recent token found.
*/

Expand Down Expand Up @@ -349,7 +349,7 @@ namespace emp {
}

/// Turn a vector of strings into a vector of tokens.
TokenStream Tokenize(const emp::vector<std::string> & str_v,
TokenStream Tokenize(const emp::vector<std::string> & str_v,
const std::string & name="in_string vector") const
{
std::stringstream ss;
Expand Down
14 changes: 7 additions & 7 deletions include/emp/config/FlagManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@
* @file FlagManager.hpp
* @brief This file contains tools for dealing with command-line flags (from argv and argc).
* @note Status: ALPHA
*
*
* The FlagManager class will take command line arguments (either in its constructor or with
* the AddFlags() function) and process them appropriately.
*
*
* For setup, the user must run AddOption with the function to call. Functions to call can take
* zero, one, or two Strings as arguments OR they can take a vector of Strings and the range of
* allowed arguments should be specified. When Process() is run, the appropriate function will
* be called on each and any invalid arguments will trigger an error.
*
*
* Flags are expected to begin with a '-' and non-flags are expected to NOT begin with a '-'.
*
*
* If a single dash is followed by multiple characters, each will be processed independently.
* So, "-abc" will be the same as "-a -b -c".
*
*
* Extra command line arguments will be saves as a vector of strings called "extras" and must
* be processed manually. They can be retrieved with GetExtras().
*
*
*
*
* @todo: Make variable numbers of flag arguments work.
*/

Expand Down
2 changes: 1 addition & 1 deletion include/emp/data/DataMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ namespace emp {

/// Return a function that takes in a data map and (efficiently) returns a Datum using the
/// specified name.
static auto MakeDatumAccessor(const emp::DataLayout & layout, const std::string & name) {
static auto MakeDatumAccessor(const emp::DataLayout & layout, const std::string & name) {
emp_assert(layout.HasName(name), "DatumAccessor not pointing to valid name", name);
return MakeDatumAccessor(layout, layout.GetID(name));
}
Expand Down
4 changes: 2 additions & 2 deletions include/emp/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This directory contains a set of tools for managing more or less genetic data.
* DataMapParser.hpp - A parser to take an equation based on variables in a DataLayout that
will produce a lambda. If a DataMap is passed into the lambda the equation will be
calculated and the result returned.

* Trait.hpp - ?


Expand All @@ -55,7 +55,7 @@ DataRow - Same interface as DataMap; refers to associated DataFrame.

DataTracker - Handles all of the functionality of DataNode, DataLog, etc., but more dynamic
using lambdas to deal with values as needed.


## To modify?

Expand Down
2 changes: 1 addition & 1 deletion include/emp/data/SimpleParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Allowed map types include std::map<std::string,T>, std::unordered_map<std::string,T>,
* emp::DataMap, and (soon) derivations from emp::AnnotatedType. For standard maps, T must be
* convertable to emp::Datum.
*
*
* Developer TODO:
* - Setup operator RegEx to be built dynamically
* - Setup LVALUES as a type, and allow assignment
Expand Down
2 changes: 1 addition & 1 deletion include/emp/datastructs/IndexSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace emp {
size_t GetEnd() const {
return range_set.size() ? range_set.back().GetEnd() : 0;
}

size_t GetNumRanges() const { return range_set.size(); }

/// @brief Calculate the total combined size of all ranges.
Expand Down
2 changes: 1 addition & 1 deletion include/emp/datastructs/QueueCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
if (found != cache_map.end()) {
Delete(found);
}

cache_list.emplace_front(key, val); // Put element into the cache
cache_map.emplace(key, cache_list.begin()); // Add element pointer to map
Shrink(); // Reduce if we are over capacity
Expand Down
2 changes: 1 addition & 1 deletion include/emp/datastructs/UnorderedIndexMap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ namespace emp {
emp_assert(num_items > 0, "UnorderedIndexMaps should not be initialized with empty weights");
for (size_t i = 0; i < num_items; i++) weights[i + num_nodes] = in_weights[i];
}

UnorderedIndexMap(const UnorderedIndexMap &) = default;
UnorderedIndexMap(UnorderedIndexMap &&) = default;
~UnorderedIndexMap() = default;
Expand Down
4 changes: 2 additions & 2 deletions include/emp/datastructs/ra_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @file ra_map.hpp
* @brief This file defines a Random Access Map template.
* @note Status: ALPHA
*
*
* A random access map allows for simple traversal by index and a guarantee that a value at a
* given index will always be at that index unless any map element is deleted. This allows
* storage of indices for maps with a fixed layout, resulting in easy access.
Expand Down Expand Up @@ -131,7 +131,7 @@ namespace emp {
return true;
}


size_t count(const KEY_T & key) const { return id_map.count(key); } /// Is value included? (0 or 1).

/// Index into the ra_map by key.
Expand Down
6 changes: 3 additions & 3 deletions include/emp/hardware/VirtualCPU.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ namespace emp{
size_t write_head; ///< Write head, signals where to copy next
///< instruction
size_t cooldown_timer = 0; ///< Do not process inst if value > 0.
///< Decrease this value instead
///< Decrease this value instead
//////// HELPER CONSTRUCTS
emp::unordered_map<size_t, size_t> nop_id_map;/**< NOP inst id -> Nop index
(e.g., NopA -> 0, NopB -> 1,
Expand Down Expand Up @@ -252,7 +252,7 @@ namespace emp{
/// Redirect literal ints to PushInst(size_t) overload.
void PushInst(int idx) { PushInst(static_cast<size_t>(idx)); }

/// Add a new instruction to the end of the genome, by the instruction's symbol/char
/// Add a new instruction to the end of the genome, by the instruction's symbol/char
void PushInst(char c) { PushInst( GetInstLib()->GetIndexFromSymbol(c) ); }

/// Add a new instruction to the end of the genome, by name
Expand Down Expand Up @@ -353,7 +353,7 @@ namespace emp{


//////// HEAD MANIPULATION

void ResetIP() { inst_ptr = 0; } ///< Move instruction pointer to beginning of the genome.
void ResetRH() { read_head = 0; } ///< Move read head to beginning of the genome.
void ResetWH() { write_head = 0; } ///< Move write head to beginning of the genome.
Expand Down
4 changes: 2 additions & 2 deletions include/emp/in_progress/SimpleParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @file SimpleParser.hpp
* @brief Common praser functionality with custom plugins for variables and functions.
* @note Status: ALPHA
*
*
* Developer TODO:
* - Make ${ ... } actually work
* - Setup operator RegEx to be built dynamically
Expand Down Expand Up @@ -234,7 +234,7 @@ namespace emp {
if (pos->lexeme == ",") ++pos;
}
++pos;

// Now build the function based on its argument count.
value_fun_t out_fun;
switch (args.size()) {
Expand Down
2 changes: 1 addition & 1 deletion include/emp/io/File.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ namespace emp {
if constexpr ( std::is_same<return_t, String>() ) {
cur_line = fun(cur_line);
} else {
fun(cur_line);
fun(cur_line);
}
}
return *this;
Expand Down
2 changes: 1 addition & 1 deletion include/emp/math/Range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace emp {
lower = (MaxLimit() - shift > lower) ? (lower + shift) : MaxLimit();
}
void Shift(T shift) {
if (shift > 0) ShiftUp(shift);
if (shift > 0) ShiftUp(shift);
else ShiftDown(-shift);
}

Expand Down
12 changes: 6 additions & 6 deletions include/emp/math/RangeSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ namespace emp {
// }
size_t _FindRange(T value) const {
auto it = std::lower_bound(
range_set.begin(),
range_set.end(),
range_set.begin(),
range_set.end(),
value,
[](const range_t & range, T value) { return range.GetUpper() < value; }
);
Expand Down Expand Up @@ -155,7 +155,7 @@ namespace emp {

/// @return Overall end of all ranges (or min value if no ranges exist.)
[[nodiscard]] T GetEnd() const { return IsEmpty() ? MinLimit() : range_set.back().Upper(); }

[[nodiscard]] size_t GetNumRanges() const { return range_set.size(); }

/// @brief Calculate the total combined size of all ranges.
Expand Down Expand Up @@ -284,7 +284,7 @@ namespace emp {
}

// Otherwise insert as a new range.
else _InsertRange(start_id, in);
else _InsertRange(start_id, in);

return *this;
}
Expand Down Expand Up @@ -366,7 +366,7 @@ namespace emp {
range_set[start_id].SetUpper(rm_range.Lower());
return *this;
}

// Deal with beginning of removal - cut it down if needed, and move on to next range.
if (rm_range.Lower() > start_range.Lower()) {
start_range.Upper() = rm_range.Lower();
Expand Down Expand Up @@ -472,7 +472,7 @@ namespace emp {
return out;
}

/// @brief Check for internal errors in this RangeSet.
/// @brief Check for internal errors in this RangeSet.
bool OK() const {
// Check each range individually.
for (const auto & range : range_set) {
Expand Down
4 changes: 2 additions & 2 deletions include/emp/text/EmphaticEncoding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @file EmphaticEncoding.hpp
* @brief Plugs into emp::Text, setting up inputs and output to be Emphatic encoded.
* @note Status: ALPHA
*
*
*/

#ifndef EMP_TEXT_EMPHATICENCODING_HPP_INCLUDE
Expand Down Expand Up @@ -64,7 +64,7 @@ namespace emp {

public:
EmphaticEncoding() { SetupTags(); }
~EmphaticEncoding() = default;
~EmphaticEncoding() = default;

String GetName() const override { return "emphatic"; }
emp::Ptr<TextEncoding_Interface> Clone() const override {
Expand Down
2 changes: 1 addition & 1 deletion include/emp/text/HTMLEncoding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @file HTMLEncoding.hpp
* @brief Plugs into emp::Text, setting up inputs and output to be HTML encoded.
* @note Status: ALPHA
*
*
*/

#ifndef EMP_TEXT_HTMLENCODING_HPP_INCLUDE
Expand Down
Loading

0 comments on commit b613f1d

Please sign in to comment.