CSet++
Set of defined functions to work with sets
Loading...
Searching...
No Matches
set.h File Reference

This is the main header file of the cset library. It contains all the functions and their implementation. More...

#include <algorithm>
#include <vector>
+ Include dependency graph for set.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  set
 Contains all the functions for performing set operations on std::vector.
 

Functions

template<typename T >
bool set::contains (const std::vector< T > &k, const T &kk) noexcept
 Checks if an element is present in the set.
 
template<typename T >
int set::count (const std::vector< T > &k, const T &kk) noexcept
 Counts the number of times an element is present in the set.
 
template<typename T >
std::vector< T > & set::unique (std::vector< T > &c, const std::vector< T > &k)
 Removes duplicates from a set.
 
template<typename T >
std::vector< T > & set::unique (std::vector< T > &k)
 Removes duplicates from a set.
 
template<typename T >
std::vector< T > set::unique (std::vector< T > &&k)
 Removes duplicates from a set.
 
template<typename T >
std::vector< T > & set::sort (std::vector< T > &c, const std::vector< T > &k)
 Sorts a set in ascending order.
 
template<typename T >
std::vector< T > & set::sort (std::vector< T > &k)
 Sorts a set in ascending order.
 
template<typename T >
std::vector< T > set::sort (std::vector< T > &&k)
 Sorts a set in ascending order.
 
template<typename T >
std::vector< T > & set::rsort (std::vector< T > &c, const std::vector< T > &k)
 Sorts a set in descending order.
 
template<typename T >
std::vector< T > & set::rsort (std::vector< T > &k)
 Sorts a set in descending order.
 
template<typename T >
std::vector< T > set::rsort (std::vector< T > &&k)
 Sorts a set in descending order.
 
template<typename T >
std::vector< T > & set::reverse (std::vector< T > &c, const std::vector< T > &k)
 Reverses the passed set.
 
template<typename T >
std::vector< T > & set::reverse (std::vector< T > &k)
 Reverses the passed set.
 
template<typename T >
std::vector< T > set::reverse (std::vector< T > &&k)
 Reverses the passed set.
 
template<typename T >
std::vector< T > & set::sunion (std::vector< T > &c, const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory union of two sets.
 
template<typename T >
std::vector< T > set::sunion (const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory union of two sets.
 
template<typename T >
std::vector< T > set::sunion (std::vector< T > &&k, const std::vector< T > &&kk)
 Obtains the set theory union of two sets.
 
template<typename T >
std::vector< T > & set::intersection (std::vector< T > &c, const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory intersection of two sets.
 
template<typename T >
std::vector< T > set::intersection (const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory intersection of two sets.
 
template<typename T >
std::vector< T > set::intersection (std::vector< T > &&k, const std::vector< T > &&kk)
 Obtains the set theory intersection of two sets.
 
template<typename T >
std::vector< T > & set::diff (std::vector< T > &c, const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory difference of two sets.
 
template<typename T >
std::vector< T > set::diff (const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory difference of two sets.
 
template<typename T >
std::vector< T > set::diff (std::vector< T > &&k, const std::vector< T > &&kk)
 Obtains the set theory difference of two sets.
 
template<typename T >
std::vector< T > & set::sdiff (std::vector< T > &c, const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory symmetric difference of two sets.
 
template<typename T >
std::vector< T > set::sdiff (const std::vector< T > &k, const std::vector< T > &kk)
 Obtains the set theory symmetric difference of two sets.
 
template<typename T >
std::vector< T > set::sdiff (std::vector< T > &&k, const std::vector< T > &&kk)
 Obtains the set theory symmetric difference of two sets.
 

Detailed Description

This is the main header file of the cset library. It contains all the functions and their implementation.

This file contains a set of functions that perform set theory operations on std::vector.
The functions are implemented as templates to support multiple types without the need to overload each function for each type.

Definition in file set.h.