CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CppAD::local::sparse_list Class Reference

Vector of sets of positive integers, each set stored as a singly linked list. More...

Classes

struct  pair_size_t
 type used for each entry in a singly linked list. More...
 

Public Types

typedef sparse_list_const_iterator const_iterator
 declare a const iterator More...
 

Public Member Functions

void add_element (size_t i, size_t element)
 Add one element to a set. More...
 
void assignment (size_t this_target, size_t other_source, const sparse_list &other)
 Assign one set equal to another set. More...
 
void binary_intersection (size_t this_target, size_t this_left, size_t other_right, const sparse_list &other)
 Assign a set equal to the intersection of two other sets. More...
 
void binary_union (size_t this_target, size_t this_left, size_t other_right, const sparse_list &other)
 Assign a set equal to the union of two other sets. More...
 
void clear (size_t target)
 Assign the empty set to one of the sets. More...
 
size_t end (void) const
 Fetch end for this vector of sets object. More...
 
bool is_element (size_t i, size_t element) const
 check an element is in a set. More...
 
size_t memory (void) const
 Amount of memory used by this vector of sets. More...
 
size_t n_set (void) const
 Fetch n_set for vector of sets object. More...
 
size_t number_elements (size_t i) const
 Count number of elements in a set. More...
 
void operator= (const sparse_list &other)
 Assignement operator. More...
 
void post_element (size_t i, size_t element)
 Post an element for delayed addition to a set. More...
 
void print (void) const
 Print the vector of sets (used for debugging) More...
 
void process_post (size_t i)
 process post entries for a specific set. More...
 
void resize (size_t n_set, size_t end)
 Start a new vector of sets. More...
 
 sparse_list (void)
 Default constructor (no sets) More...
 
 sparse_list (const sparse_list &v)
 Using copy constructor is a programing (not user) error. More...
 
 ~sparse_list (void)
 Destructor. More...
 

Private Member Functions

void binary_union (size_t target, size_t left, const pod_vector< size_t > &right)
 Assign a set equal to the union of a set and a vector;. More...
 
void check_data_structure (void)
 Checks data structure (effectively const, but modifies and restores values) More...
 
size_t drop (size_t i)
 drop a set and its postings (no longer being used). More...
 
size_t get_data_index (void)
 get a new data_ element for use. More...
 
size_t is_subset (size_t one_this, size_t two_other, const sparse_list &other) const
 Check if one of two sets is a subset of the other set. More...
 
size_t reference_count (size_t i) const
 Counts references to sets. More...
 

Private Attributes

pod_vector< pair_size_tdata_
 The data for all the singly linked lists. More...
 
size_t data_not_used_
 list of elements of data_ that are not being used. More...
 
size_t end_
 Possible elements in each set are 0, 1, ..., end_ - 1;. More...
 
size_t number_not_used_
 number of elements in data_ that are not being used. More...
 
pod_vector< size_t > post_
 Vectors of elements that have not yet been added to corresponding sets. More...
 
pod_vector< size_t > start_
 Starting point for i-th set is start_[i]. More...
 
pod_vector< size_t > temporary_
 A temporary vector used by member functions that keeps its capacity. More...
 

Friends

bool is_pod (void)
 
class sparse_list_const_iterator
 

Detailed Description

Vector of sets of positive integers, each set stored as a singly linked list.

All the public members for this class are also in the sparse_pack and sparse_vecsize classes. This defines the CppAD vector_of_sets concept.

Definition at line 35 of file sparse_list.hpp.


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