| I l@ve RuBoard |
This section discusses the different STL containers and presents all of the operations that STL containers provide. The types and members are grouped by functionality. For each type and operation this section describes the signature, the behavior, and the container types that provide it. Possible containers are vector, deques, lists, sets, multisets, maps, multimaps, and strings. In the following subsections, container means the container type that provides the member.
container::value_type
The type of elements.
For sets and multisets, it is constant.
For maps and multimaps, it is pair <const key-type, value-type>
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::reference
The type of element references.
Typically: container::value_type&.
For vector<bool>, it is an auxiliary class (see page 158).
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::const_reference
The type of constant element references.
Typically: const container::value_type&.
For vector<bool>, it is bool.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::iterator
The type of iterators.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::const_iterator
The type of constant iterators.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::reverse_iterator
The type of reverse iterators.
Provided by vectors, deques, lists, sets, multisets, maps, and multimaps.
container::const_reverse_iterator
The type of constant reverse iterators.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::size_type
The unsigned integral type for size values.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::difference_type
The signed integral type for difference values.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::key_type
The type of the key of the elements for associative containers.
For sets and multisets, it is equivalent to value_type.
Provided by sets, multisets, maps, and multimaps.
container::mapped_type
The type of the value of the elements of associative containers.
Provided by maps and multimaps.
container::key_compare
The type of the comparison criterion of associative containers.
Provided by sets, multisets, maps, and multimaps.
container::value_compare
The type of the comparison criterion for the whole element type.
For sets and multisets, it is equivalent to key_compare.
For maps and multimaps, it is an auxiliary class for a comparison criterion that compares only the key part of two elements.
Provided by sets, multisets, maps, and multimaps.
container::allocator_type
The type of the allocator.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
Containers provide the following constructors and destructors. Also, most constructors allow you to pass an allocator as an additional argument (see Section 6.10.9).
container::container ()
The default constructor.
Creates a new empty container.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
explicit container::container (const CompFunc& op)
Creates a new empty container with op used as the sorting criterion (see page 191 and page 213 for examples).
The sorting criterion must define a "strict weak ordering" (see page 176).
Provided by sets, multisets, maps, and multimaps.
explicit container::container (const container&, c)
The copy constructor.
Creates a new container as a copy of the existing container c.
Calls the copy constructor for every element in c.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
explicit container::container (size_type num)
Creates a container with num elements.
The elements are created with their default constructor.
Provided by vectors, deques, and lists.
container::container (size_type num, const T& value)
Creates a container with num elements.
The elements are created as copies of value.
T is the type of the container elements.
For strings, value is not passed by reference.
Provided by vectors, deques, lists, and strings.
container::container (InputIterator beg, InputIterator end)
Creates a container that is initialized by all elements of the range [beg,end).
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::container (InputIterator beg, InputIterator end, const CompFunc& op)
Creates a container that has the sorting criterion op and is initialized by all elements of the range [beg,end).
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
The sorting criterion must define a "strict weak ordering" (see page 176).
Provided by sets, multisets, maps, and multimaps.
container::~container ()
The destructor.
Removes all elements and frees the memory.
Calls the destructor for every element.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
size_type container::size () const
Returns the actual number of elements.
To check whether the container is empty (contains no elements), you should use empty() because it may be faster.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
bool container::empty () const
Returns whether the container is empty (contains no elements).
It is equivalent to container:: size()==0, but it may be faster (especially for lists).
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
size_type container::max_size () const
Returns the maximum number of elements a container may contain.
This is a technical value that may depend on the memory model of the container. In particular, because vectors usually use one memory segment, this value may be less than for other containers.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
size_type container::capacity () const
Returns the number of elements the container may contain without reallocation.
Provided by vectors and strings.
void container::reserve (size_type num)
Reserves internal memory for at least num elements.
If num is less than the actual capacity, this call has no effect on vectors and is a nonbinding shrink request for strings.
To shrink the capacity of vectors, see the example on page 149.
Each reallocation invalidates all references, pointers, and iterators, and takes some time. Thus reserve() can increase speed and keep references, pointers, and iterators valid (see page 149 for details).
Provided by vectors and strings.
bool comparison (const container& c1, const container&, c2)
Returns the result of the comparison of two containers of same type.
comparison might be any of the following:
operator == operator != operator < operator > operator <= operator >=
Two containers are equal if they have the same number of elements and contain the same elements in the same order (all comparisons of two corresponding elements have to yield true).
To check whether a container is less than another container, the containers are compared lexicographically. See the description of the lexicographical_compare() algorithm on page 360 for a description of lexicographical comparison.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
The member functions mentioned here are special implementations of corresponding STL algorithms that are discussed in Section 9.5 and Section 9.9. They provide better performance because they rely on the fact that the elements of associative containers are sorted. In fact, they provide logarithmic complexity instead of linear complexity. For example, to search for one of 1,000 elements, no more than ten comparisons on average are needed (see Section 2.3).
size_type container::count (const T& value) const
Returns the number of elements that are equal to value.
This is the special version of the count() algorithm discussed on page 338.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
Complexity: linear.
Provided by sets, multisets, maps, and multimaps.
iterator container::find (const T& value)
const_iterator container::find (const T& value) const
Both return the position of the first element that has a value equal to value.
They return end() if no element is found.
These are the special versions of the find() algorithm discussed on page 341.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
Complexity: logarithmic.
Provided by sets, multisets, maps, and multimaps.
iterator container::lower_bound (const T& value)
const_iterator container::lower_bound (const T& value) const
Both return the first position where a copy of value would get inserted according to the sorting criterion.
They return end() if no such element is found.
The return value is the position of the first element that has a value less than or equal to value (which might be end()).
These are the special versions of the lower_bound() algorithm discussed on page 413.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
Complexity: logarithmic.
Provided by sets, multisets, maps, and multimaps.
iterator container::upper_bound (const T& value)
const_iterator container::upper_bound (const T& value) const
Both return the last position where a copy of value would get inserted according to the sorting criterion.
They return end() if no such element is found.
The return value is the position of the first element that has a value greater than value (which might be end()).
These are the special versions of the upper_bound() algorithm discussed on page 413.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
Complexity: logarithmic.
Provided by sets, multisets, maps, and multimaps.
pair<iterator,iterator> container::equal_range (const T& value)
pair<const_iterator,const_iterator> container::equal_range (const T& value) const
Both return a pair with the first and last positions where a copy of value would get inserted according to the sorting criterion.
The return value is the range of elements equal to value.
They are equivalent to:
make_pair (lower_bound(value),upper_bound(value))
These are the special versions of the equal_range() algorithm discussed on page 415.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
Complexity: logarithmic.
Provided by sets, multisets, maps, and multimaps.
key_compare container::key_comp ()
Returns the comparison criterion.
Provided by sets, multisets, maps, and multimaps.
value_compare container::value_comp ()
Returns the object that is used as the comparison criterion.
For sets and multisets, it is equivalent to key_comp ().
For maps and multimaps, it is an auxiliary class for a comparison criterion that compares only the key part of two elements.
Provided by sets, multisets, maps, and multimaps.
container& container::operator= (const container& c)
Assigns all elements of c; that is, it replaces all existing elements with copies of the elements of c.
The operator may call the assignment operator for elements that have been overwritten, the copy constructor for appended elements, and the destructor of the element type for removed elements.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void container::assign (size_type num, const T& value)
Assigns num occurrences of value; that is, it replaces all existing elements by num copies of value.
T has to be the element type.
Provided by vectors, deques, lists, and strings.
void container::assign (InputIterator beg, Inputlterator end)
Assigns all elements of the range [beg,end); that is, it replaces all existing elements with copies of the elements of [beg,end).
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
Provided by vectors, deques, lists, and strings.
void container::swap (container& c)
Swaps the contents with c.
Both containers swap
their elements and
their sorting criterion if any.
This function has a constant complexity. You should always prefer it over an assignment when you no longer need the assigned object (see Section 6.1.2).
For associative containers, the function may only throw if copying or assigning the comparison criterion may throw. For all other containers, the function does not throw.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void swap (container& c1, container&, c2)
It is equivalent to c1. swap(c2) (see the previous description).
For associative containers, the function may only throw if copying or assigning the comparison criterion may throw. For all other containers, the function does not throw.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
reference container::at (size_type idx)
const_reference container::at (size_type idx) const
Both return the element with the index idx (the first element has index 0).
Passing an invalid index (less than 0 or equal to size() or greater than size()) throws an out_of _range exception.
Note that the returned reference may get invalidated due to later modifications or reallocations.
If you are sure that the index is valid, you can use operator [ ], which is faster.
Provided by vectors, deques, and strings.
reference container::operator [ ] (size_type idx)
const_reference container::operator [ ] (size_type idx) const
Both return the element with the index idx (the first element has index 0).
Passing an invalid index (less than 0 or equal to size() or greater than size()) results in undefined behavior. Thus, the caller must ensure that the index is valid; otherwise, at() should be used.
The reference returned for the nonconstant string may get invalidated due to string modifications or reallocations (see page 487 for details).
Provided by vectors, deques, and strings.
T& map::operator [] (const key_type& key)
Operator [ ] for associative arrays.
Returns the corresponding value to key in a map.
Note: If no element with a key equal to key exists, this operation creates a new element automatically with a value that is initialized by the default constructor of the value type. Thus, you can't have an invalid index (only wrong behavior). For example:
map<int,string> coll; coll [77] = "hello"; // insert key 77 with value "hello" cout << coll [42]; // Oops, inserts key 42 with value "" and prints the value
See Section 6.6.3, for details.
T is the type of the element value.
It is equivalent to:
(*((insert(make_pair(x,T()))).first)).second
Provided by maps.
reference container::front ()
const_reference container::front () const
Both return the first element (the element with index 0).
The caller must ensure that the container contains an element (size ()>0); otherwise, the behavior is undefined.
Provided by vectors, deques, and lists.
reference container::back ()
const_reference container::back () const
Both return the last element (the element with index size()-l).
The caller must ensure that the container contains an element (size()>0); otherwise, the behavior is undefined.
Provided by vectors, deques, and lists.
The following member functions return iterators to iterate over the elements of the containers. Table 6.34 lists the iterator category (see Section 7.2,) according to the different container types.
| Container | Iterator Category |
|---|---|
| Vector | Random access |
| Deque | Random access |
| List | Bidirectional |
| Set | Bidirectional, element is constant |
| Multiset | Bidirectional, element is constant |
| Map | Bidirectional, key is constant |
| Multimap | Bidirectional, key is constant |
| String | Random access |
iterator container::begin ()
const_iterator container:: begin () const
Both return an iterator for the beginning of the container (the position of the first element).
If the container is empty, the calls are equivalent to container::end().
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
iterator container::end ()
const_iterator container::end () const
Both return an iterator for the end of the container (the position after the last element).
If the container is empty, the calls are equivalent to container: : begin().
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
reverse_iterator container::rbegin ()
const_reverse_iterator container::rbegin () const
Both return a reverse iterator for the beginning of a reverse iteration over the elements of the container (the position of the last element).
If the container is empty, the calls are equivalent to container:: rend().
For details about reverse iterators, see Section 7.4.1.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
reverse_iterator container::rend ()
const_reverse_iterator container::rend () const
Both return a reverse iterator for the end of a reverse iteration over the elements of the container (the position before the first element).
If the container is empty, the calls are equivalent to container:: rbegin().
For details about reverse iterators, see Section 7.4.1.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
iterator container::insert (const T& value)
pair<iterator,bool> container::insert (const T& value)
Both insert a copy of value into an associative container.
Containers that allow duplicates (multisets and multimaps) have the first signature. They return the position of the new element.
Containers that do not allow duplicates (sets and maps) have the second signature. If they can't insert the value because an element with an equal value or key exists, they return the position of the existing element and false. If they can insert the value, they return the position of the new element and true.
T is the type of the container elements. Thus, for maps and multimaps it is a key/value pair.
The functions either succeed or have no effect.
Provided by sets, multisets, maps, and multimaps.
iterator container::insert (iterator pos, const T& value)
Inserts a copy of value at the position of iterator pos.
Returns the position of the new element.
For associative containers (sets, multisets, maps, and multimaps), the position is only used as hint, pointing to where the insert should start to search. If value is inserted right behind pos the function has amortized constant complexity; otherwise, it has logarithmic complexity.
If the container is a set or a map that already contains an element equal to (the key of) value, then the call has no effect and the return value is the position of the existing element.
For vectors and deques, this operation might invalidate iterators and references to other elements.
T is the type of the container elements. Thus, for maps and multimaps it is a key/value pair.
For strings, value is not passed by reference.
For vectors and deques, if the copy operations (copy constructor and assignment operator) of the elements don't throw, the function either succeeds or has no effect. For all other standard containers, the function either succeeds or has no effect.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void container::insert (iterator pos, size_type num, const T& value)
Inserts num copies of value at the position of iterator pos.
For vectors and deques, this operation might invalidate iterators and references to other elements.
T is the type of the container elements. Thus, for maps and multimaps it is a key/value pair.
For strings, value is not passed by reference.
For vectors and deques, if the copy operations (copy constructor and assignment operator) of the elements don't throw, the function either succeeds or has no effect. For lists, the function either succeeds or has no effect.
Provided by vectors, deques, lists, and strings.
void container::insert (InputIterator beg, InputIterator end)
Inserts copies of all elements of the range [beg,end) into the associative container.
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
Provided by sets, multisets, maps, and multimaps.
void container::insert (iterator pos, InputIterator beg, InputIterator end)
Inserts copies of all elements of the range [beg,end) at the position of iterator pos.
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
For vectors and deques, this operation might invalidate iterators and references to other elements.
For lists, the function either succeeds or has no effect.
Provided by vectors, deques, lists, and strings.
void container::push_front (const T& value)
Inserts a copy of value as the new first element.
T is the type of the container elements.
It is equivalent to insert(begin(), value).
For deques, this operation invalidates iterators to other elements. References to other elements stay valid.
This function either succeeds or has no effect.
Provided by deques and lists.
void container::push_back (const T& value)
Appends a copy of value as the new last element.
T is the type of the container elements.
It is equivalent to insert(end() ,value).
For vectors, this operation invalidates iterators and references to other elements when reallocation takes place.
For deques, this operation invalidates iterators to other elements. References to other elements stay valid.
This function either succeeds or has no effect.
Provided by vectors, deques, lists, and strings.
void list::remove (const T& value)
void list::remove_if (UnaryPredicate op)
remove() removes all elements with value value.
remove_if() removes all elements for which the unary predicate
op(elem)
yields true.
Note that op should not change its state during a function call. See Section 8.1.4, for details.
Both call the destructors of the removed elements.
The order of the remaining arguments remains stable.
This is the special version of the remove() algorithm, which is discussed on page 378, for lists.
T is the type of the container elements.
For further details and examples, see page 170.
The functions may only throw if the comparison of the elements may throw.
Provided by lists.
size_type container::erase (const T& value)
Removes all elements equal to value from an associative container.
Returns the number of removed elements.
Calls the destructors of the removed elements.
T is the type of the sorted value:
For sets and multisets, it is the type of the elements.
For maps and multimaps, it is the type of the keys.
The function does not throw.
Provided by sets, multisets, maps, and multimaps.
void container::erase (iterator pos)
iterator container::erase (iterator pos)
Both remove the element at the position of iterator pos.
Sequence containers (vectors, deques, lists, and strings) have the second signature. They return the position of the following element (or end()).
Associative containers (sets, multisets, maps, and multimaps) have the first signature. They return nothing.
Both call the destructors of the removed elements.
Note that the caller must ensure that the iterator pos is valid. For example:
coll. erase (coll. end()); // ERROR ? undefined behavior
For vectors and deques, this operation might invalidate iterators and references to other elements.
For vectors and deques, the function may only throw if the copy constructor or assignment operator of the elements may throw. For all other containers, the function does not throw.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void container::erase (iterator beg, iterator end)
iterator container::erase (iterator beg, iterator end)
Both remove the elements of the range [beg,end).
Sequence containers (vectors, deques, lists, and strings) have the second signature. They return the position of the element that was behind the last removed element on entry (or end()).
Associative containers (sets, multisets, maps, and multimaps) have the first signature. They return nothing.
As always for ranges, all elements including beg but excluding end are removed.
Both call the destructors of the removed elements.
Note that the caller must ensure that beg and end define a valid range that is part of the container.
For vectors and deques, this operation might invalidate iterators and references to other elements.
For vectors and deques, the function may only throw if the copy constructor or the assignment operator of the elements may throw. For all other containers, the function does not throw.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void container::pop_front ()
Removes the first element of the container.
It is equivalent to container. erase (container.begin()).
Note: If the container is empty, the behavior is undefined. Thus, the caller must ensure that the container contains at least one element (size () >0).
The function does not throw.
Provided by deques and lists.
void container::pop_back ()
Removes the last element of the container.
It is equivalent to container.erase(--container.end()), provided this expression is valid, which might not be the case for vectors (see page 258).
Note: If the container is empty, the behavior is undefined. Thus, the caller must ensure that the container contains at least one element (size()>0).
The function does not throw.
Provided by vectors, deques, and lists.
void container::resize (size_type num)
void container::resize (size_type num, T value)
Both change the number of elements to num.
If size() is num on entry, they have no effect.
If num is greater than size() on entry, additional elements are created and appended to the end of the container. The first form creates the new elements by calling their default constructor; the second form creates the new elements as copies of value.
If num is less than size() on entry, elements are removed at the end to get the new size. In this case, they call the destructor of the removed elements.
For vectors and deques, these functions might invalidate iterators and references to other elements.
For vectors and deques, these functions either succeed or have no effect, provided the copy constructor or the assignment operator of the elements don't throw. For lists, the functions either succeed or have no effect.
Provided by vectors, deques, lists, and strings.
void container::clear ()
Removes all elements (makes the container empty).
Calls the destructors of the removed elements.
Invalidates all iterators and references to the container.
For vectors and deques, the function may only throw if the copy constructor or the assignment operator of the elements may throw. For all other containers, the function does not throw.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
void list:: unique ()
void list::unique (BinaryPredicate op)
Both remove subsequent duplicates of list elements so that each element contains a different value than the following element.
The first form removes all elements for which the previous values are equal.
The second form removes all elements that follow an element e and for which the binary predicate
op(elem,e)
yields true.[34] In other words, the predicate is not used to compare an element with its predecessor; the element is compared with the previous element that was not removed.
[34] The second version of unique() is available only in systems that support member templates (see page 11).
Note that op should not change its state during a function call. See Section 8.1.4, for details.
Both call the destructors of the removed elements.
These are the special versions of the unique() algorithms, which are discussed on page 381, for lists.
The functions do not throw if the comparisons of the elements do not throw.
void list::splice (iterator pos, list& source)
Moves all elements of source into *this and inserts them at the position of iterator pos.
source is empty after the call.
If source and *this are identical, the behavior is undefined. Thus, the caller must ensure that source is a different list. To move elements inside the same list you must use the following form of splice().
The caller must ensure that pos is a valid position of *this; otherwise, the behavior is undefined.
This function does not throw.
void list::splice (iterator pos, list& source, iterator sourcePos)
Moves the element at the position sourcePos of the list source into *this and inserts it at the position of iterator pos.
source and *this may be identical. In this case, the element is moved inside the list.
If source is a different list, it contains one element less after the operation.
The caller must ensure that pos is a valid position of *this, sourcePos is a valid iterator of source, and sourcePos is not source. end(); otherwise, the behavior is undefined.
This function does not throw.
void list::splice (iterator pos, list& source, iterator sourceBeg, iterator sourceEnd)
Moves the elements of the range [sourceBeg,sourceEnd) of the list source to *this and inserts it at the position of iterator pos.
source and *this may be identical. In this case, pos must not be part of the moved range, and the elements are moved inside the list.
If source is a different list, it contains less elements after the operation.
The caller must ensure that pos is a valid position of *this, and that sourceBeg and sourceEnd define a valid range that is part of source; otherwise, the behavior is undefined.
This function does not throw.
void list::sort ()
void list::sort (CompFunc op)
Both sort the elements in the list.
The first form sorts all elements in the list with operator <.
The second form sorts all elements in the list by calling op to compare two elements[35] :
[35] The second form of sort() is available only in systems that support member templates (see page 11).
op(elem1,elem2)
The order of elements that have an equal value remains stable (unless an exception is thrown).
These are the special versions of the sort() and stable_sort() algorithms, which are discussed on page 397.
void list::merge (list& source)
void list::merge (list& source, CompFunc op)
Both merge all elements of the list source into *this.
source is empty after the call.
If *this and source are sorted on entry according to the sorting criterion < or op, the resulting list is also sorted. Strictly speaking, the standard requires that both lists be sorted on entry. In practice, however, merging is also possible for unsorted lists. However, you should check this before you rely on it.
The first form uses operator < as the sorting criterion.
The second form uses op as the optional sorting criterion and is used to compare two elements[36] :
[36] The second form of merge() is available only in systems that support member templates (see page 11).
op (elem, sourceElem)
This is the special version of the merge() algorithm, which is discussed on page 416.
If the comparisons of the elements do not throw, the functions either succeed or have no effect.
void list::reverse ()
Reverses the order of the elements in a list.
This is the special version of the reverse() algorithm, which is discussed on page 386.
This function does not throw.
All STL containers can be used with a special memory model that is defined by an allocator object (see Chapter 15 for details). This subsection describes the members for allocator support.
Standard containers require that all instances of an allocator type are interchangeable. Thus, storage allocated from one container can be deallocated via another that has the same type. Therefore, it is no problem when elements (and their storage) are moved between containers of the same type.
container::allocator_type
The type of the allocator.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
allocator_type container::get_allocator () const
Returns the memory model of the container.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
explicit container container (const Allocator& alloc)
Creates a new empty container that uses the memory model alloc.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::container (const CompFunc& op, const Allocator& alloc)
Creates a new empty container with op used as the sorting criterion that uses the memory model alloc.
The sorting criterion must define a "strict weak ordering" (see page 176).
Provided by sets, multisets, maps, and multimaps.
container::container (size.type num, const T& value, const Allocator& alloc)
Creates a container with num elements that uses the memory model alloc.
The elements are created as copies of value.
T is the type of the container elements. Note that for strings, value is passed by value.
Provided by vectors, deques, lists, and strings.
container::container (InputIterator beg, InputIterator end, const Allocator& alloc)
Creates a container that is initialized by all elements of the range [beg,end) and uses the memory model alloc.
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
Provided by vectors, deques, lists, sets, multisets, maps, multimaps, and strings.
container::container (InputIterator beg, InputIterator end, const CompFunc& op, const Allocator& alloc)
Creates a container that has the sorting criterion op, is initialized by all elements of the range [beg,end), and uses the memory model alloc.
This function is a member template (see page 11). Thus, the elements of the source range may have any type that is convertible to the element type of the container.
The sorting criterion must define a "strict weak ordering" (see page 176).
Provided by sets, multisets, maps, and multimaps.
As mentioned in Section 5.11.2, containers provide different guarantees in the face of exceptions. In general, the C++ standard library will not leak resources or violate container invariants in the face of exceptions. However, some operations give stronger guarantees (provided the arguments meet some requirements): They may guarantee commit-or-rollback behavior, or they may even guarantee that they will never throw at all. Table 6.35 lists all operations that give these stronger guarantees.[37]
[37] Many thanks to Greg Colvin and Dave Abrahams for providing this table.
For vectors, deques, and lists, you also have guarantees for resize(). It is defined as having the effect of either calling erase() or calling insert() or doing nothing:
void container::resize (size_type num, T value = T()) { if (num > size()) { insert (end(), num-size(), value); } else if (num < size()) { erase (begin()+num, end()); } }
Thus, its guarantees are a combination of the guarantees of erase() and insert() (see page 244).
| Operation | Page | Guarantee |
|---|---|---|
| vector::push_back() | 241 | Either succeeds or has no effect |
| vector::insert() | 240 | Either succeeds or has no effect if copying/assigning elements doesn't throw |
| vector::pop_back() | 243 | Doesn't throw |
| vector::erase() | 242 | Doesn't throw if copying/assigning elements doesn't throw |
| vector::clear() | 244 | Doesn't throw if copying/assigning elements doesn't throw |
| vector::swap() | 237 | Doesn't throw |
| deque::push_back() | 241 | Either succeeds or has no effect |
| deque::push_front() | 241 | Either succeeds or has no effect |
| deque::insert() | 240 | Either succeeds or has no effect if copying/assigning elements doesn't throw |
| deque::pop_back() | 243 | Doesn't throw |
| deque::pop_front() | 243 | Doesn't throw |
| deque::erase() | 242 | Doesn't throw if copying/assigning elements doesn't throw |
| deque::clear() | 244 | Doesn't throw if copying/assigning elements doesn't throw |
| deque::swap() | 237 | Doesn't throw |
| list::push_back() | 241 | Either succeeds or has no effect |
| list::push_front() | 241 | Either succeeds or has no effect |
| list::insert() | 240 | Either succeeds or has no effect |
| list::pop_back() | 243 | Doesn't throw |
| list::pop_front() | 243 | Doesn't throw |
| list::erase() | 242 | Doesn't throw |
| list:: clear() | 244 | Doesn't throw |
| list:: remove() | 242 | Doesn't throw if comparing the elements doesn't throw |
| list::remove_if() | 242 | Doesn't throw if the predicate doesn't throw |
| list::unique() | 244 | Doesn't throw if comparing the elements doesn't throw |
| list::splice() | 245 | Doesn't throw |
| list::merge() | 246 | Either succeeds or has no effect if comparing the elements doesn't throw |
| list::reverse() | 246 | Doesn't throw |
| list::swap() | 237 | Doesn't throw |
| [multi]set::insert() | 240 | For single elements either succeeds or has no effect |
| [multi]set::erase() | 242 | Doesn't throw |
| [multi]set::clear() | 244 | Doesn't throw |
| [multi]set::swap() | 237 | Doesn't throw if copying/assigning the comparison criterion doesn't throw |
| [multi]map::insert() | 240 | For single elements either succeeds or has no effect |
| [multi]map::erase() | 242 | Doesn't throw |
| [multi]map::clear() | 244 | Doesn't throw |
| [multi]map::swap() | 237 | Doesn't throw if copying/assigning the comparison criterion doesn't throw |
| I l@ve RuBoard |


Creating an ebook using Calibre is a pretty simple process. The most important steps are to plan the chapters of your book, then to create the XHTML files for holding their content. The remainder of the work will consist just of the plain work of editing your content and of updating the Table of Contents and the content.opf file whenever you add new content. And don't forget to also regenerate the logical Table of Contents at the end.
If you need additional information about how to format specific content, you can find many resources on HTML and CSS online. Here are a couple of links to get you started:
Happy ebook editing!


Please enter your login information to continue.
Enter your E-mail and your User ID will be emailed to you.
Enter your User ID and E-mail address and we will email you a temporary password.


| Package | Description |
|---|---|
| org.apache.commons.collections4 |
This package contains the interfaces and utilities shared across all the subpackages of this component.
|
| org.apache.commons.collections4.bag | |
| org.apache.commons.collections4.bidimap | |
| org.apache.commons.collections4.collection |
This package contains implementations of the
Collection interface. |
| org.apache.commons.collections4.comparators |
This package contains implementations of the
Comparator interface. |
| org.apache.commons.collections4.functors |
This package contains implementations of the
Closure ,
Predicate ,
Transformer and
Factory interfaces. |
| org.apache.commons.collections4.iterators |
This package contains implementations of the
Iterator interface. |
| org.apache.commons.collections4.keyvalue |
This package contains implementations of collection and map related key/value classes.
|
| org.apache.commons.collections4.list |
This package contains implementations of the
List interface. |
| org.apache.commons.collections4.map | |
| org.apache.commons.collections4.multimap |
This package contains implementations of the
MultiValuedMap interfaces. |
| org.apache.commons.collections4.multiset |
This package contains implementations of the
MultiSet interface. |
| org.apache.commons.collections4.queue |
This package contains implementations for the
Queue interface. |
| org.apache.commons.collections4.sequence |
This package provides classes to compare two sequences of objects.
|
| org.apache.commons.collections4.set | |
| org.apache.commons.collections4.splitmap | |
| org.apache.commons.collections4.trie |
This package contains implementations of the
Trie interface. |
| Class and Description |
|---|
| Bag
Defines a collection that counts the number of times an object appears in
the collection.
|
| BidiMap
Defines a map that allows bidirectional lookup between key and values.
|
| Closure
Defines a functor interface implemented by classes that do something.
|
| Equator
An equation function, which determines equality between objects of type T.
|
| Factory
Defines a functor interface implemented by classes that create objects.
|
| FluentIterable
A FluentIterable provides a powerful yet simple API for manipulating
Iterable instances in a fluent manner.
|
| Get
The "read" subset of the
Map interface. |
| IterableGet
The "read" subset of the
Map interface. |
| IterableMap
Defines a map that can be iterated directly without needing to create an entry set.
|
| IterableSortedMap |
| ListValuedMap
Defines a map that holds a list of values against each key.
|
| MapIterator
Defines an iterator that operates over a
Map . |
| MultiMap
Deprecated.
since 4.1, use
MultiValuedMap instead |
| MultiSet
Defines a collection that counts the number of times an object appears in
the collection.
|
| MultiSet.Entry
An unmodifiable entry for an element and its occurrence as contained in a MultiSet.
|
| MultiValuedMap
Defines a map that holds a collection of values against each key.
|
| OrderedBidiMap
Defines a map that allows bidirectional lookup between key and values
and retains and provides access to an ordering.
|
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| OrderedMap
Defines a map that maintains order and allows both forward and backward
iteration through that order.
|
| OrderedMapIterator
Defines an iterator that operates over an ordered
Map . |
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Put
The "write" subset of the
Map interface. |
| ResettableIterator
Defines an iterator that can be reset back to an initial state.
|
| ResettableListIterator
Defines a list iterator that can be reset back to an initial state.
|
| SetUtils.SetView
An unmodifiable view of a set that may be backed by other sets.
|
| SetValuedMap
Defines a map that holds a set of values against each key.
|
| SortedBag
Defines a type of
Bag that maintains a sorted order among
its unique representative members. |
| SortedBidiMap
Defines a map that allows bidirectional lookup between key and values
and retains both keys and values in sorted order.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Trie
Defines the interface for a prefix tree, an ordered tree data structure.
|
| Class and Description |
|---|
| Bag
Defines a collection that counts the number of times an object appears in
the collection.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| SortedBag
Defines a type of
Bag that maintains a sorted order among
its unique representative members. |
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| BidiMap
Defines a map that allows bidirectional lookup between key and values.
|
| Get
The "read" subset of the
Map interface. |
| IterableGet
The "read" subset of the
Map interface. |
| IterableMap
Defines a map that can be iterated directly without needing to create an entry set.
|
| IterableSortedMap |
| KeyValue
Defines a simple key value pair.
|
| MapIterator
Defines an iterator that operates over a
Map . |
| OrderedBidiMap
Defines a map that allows bidirectional lookup between key and values
and retains and provides access to an ordering.
|
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| OrderedMap
Defines a map that maintains order and allows both forward and backward
iteration through that order.
|
| OrderedMapIterator
Defines an iterator that operates over an ordered
Map . |
| Put
The "write" subset of the
Map interface. |
| ResettableIterator
Defines an iterator that can be reset back to an initial state.
|
| SortedBidiMap
Defines a map that allows bidirectional lookup between key and values
and retains both keys and values in sorted order.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| Bag
Defines a collection that counts the number of times an object appears in
the collection.
|
| BoundedCollection
Defines a collection that is bounded in size.
|
| MultiMap
Deprecated.
since 4.1, use
MultiValuedMap instead |
| MultiSet
Defines a collection that counts the number of times an object appears in
the collection.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Class and Description |
|---|
| Closure
Defines a functor interface implemented by classes that do something.
|
| Equator
An equation function, which determines equality between objects of type T.
|
| Factory
Defines a functor interface implemented by classes that create objects.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Class and Description |
|---|
| MapIterator
Defines an iterator that operates over a
Map . |
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| OrderedMapIterator
Defines an iterator that operates over an ordered
Map . |
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| ResettableIterator
Defines an iterator that can be reset back to an initial state.
|
| ResettableListIterator
Defines a list iterator that can be reset back to an initial state.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| KeyValue
Defines a simple key value pair.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| BoundedCollection
Defines a collection that is bounded in size.
|
| Factory
Defines a functor interface implemented by classes that create objects.
|
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| BoundedMap
Defines a map that is bounded in size.
|
| Factory
Defines a functor interface implemented by classes that create objects.
|
| Get
The "read" subset of the
Map interface. |
| IterableGet
The "read" subset of the
Map interface. |
| IterableMap
Defines a map that can be iterated directly without needing to create an entry set.
|
| IterableSortedMap |
| KeyValue
Defines a simple key value pair.
|
| MapIterator
Defines an iterator that operates over a
Map . |
| MultiMap
Deprecated.
since 4.1, use
MultiValuedMap instead |
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| OrderedMap
Defines a map that maintains order and allows both forward and backward
iteration through that order.
|
| OrderedMapIterator
Defines an iterator that operates over an ordered
Map . |
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Put
The "write" subset of the
Map interface. |
| ResettableIterator
Defines an iterator that can be reset back to an initial state.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| ListValuedMap
Defines a map that holds a list of values against each key.
|
| MapIterator
Defines an iterator that operates over a
Map . |
| MultiSet
Defines a collection that counts the number of times an object appears in
the collection.
|
| MultiValuedMap
Defines a map that holds a collection of values against each key.
|
| SetValuedMap
Defines a map that holds a set of values against each key.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| MultiSet
Defines a collection that counts the number of times an object appears in
the collection.
|
| MultiSet.Entry
An unmodifiable entry for an element and its occurrence as contained in a MultiSet.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| BoundedCollection
Defines a collection that is bounded in size.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| Equator
An equation function, which determines equality between objects of type T.
|
| Class and Description |
|---|
| OrderedIterator
Defines an iterator that operates over an ordered container.
|
| Predicate
Defines a functor interface implemented by classes that perform a predicate
test on an object.
|
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
| Class and Description |
|---|
| Get
The "read" subset of the
Map interface. |
| IterableGet
The "read" subset of the
Map interface. |
| MapIterator
Defines an iterator that operates over a
Map . |
| Put
The "write" subset of the
Map interface. |
| Transformer
Defines a functor interface implemented by classes that transform one
object into another.
|
| Class and Description |
|---|
| Get
The "read" subset of the
Map interface. |
| IterableGet
The "read" subset of the
Map interface. |
| IterableMap
Defines a map that can be iterated directly without needing to create an entry set.
|
| IterableSortedMap |
| OrderedMap
Defines a map that maintains order and allows both forward and backward
iteration through that order.
|
| OrderedMapIterator
Defines an iterator that operates over an ordered
Map . |
| Put
The "write" subset of the
Map interface. |
| Trie
Defines the interface for a prefix tree, an ordered tree data structure.
|
| Unmodifiable
Marker interface for collections, maps and iterators that are unmodifiable.
|
Copyright © 2001–2019 The Apache Software Foundation. All rights reserved.


|
Panda3D
|
This is a collection of materials by MRef name. More...
Public Member Functions | |
| __init__ () | |
| __init__ (const EggMaterialCollection copy) | |
| bool | addMaterial (EggMaterial material) |
| Explicitly adds a new material to the collection. More... | |
| clear () | |
| Removes all materials from the collection. More... | |
| int | collapseEquivalentMaterials (int eq, EggGroupNode node) |
| Walks through the collection and collapses together any separate materials that are equivalent according to the indicated equivalence factor, eq (see EggMaterial::is_equivalent_to()). More... | |
| int | collapseEquivalentMaterials (int eq, EggMaterialCollection::MaterialReplacement removed) |
| Walks through the collection and collapses together any separate materials that are equivalent according to the indicated equivalence factor, eq (see EggMaterial::is_equivalent_to()). More... | |
| EggMaterial | createUniqueMaterial (const EggMaterial copy, int eq) |
| int | extractMaterials (EggGroupNode node) |
| Walks the egg hierarchy beginning at the indicated node, and removes any EggMaterials encountered in the hierarchy, adding them to the collection. More... | |
| EggMaterial | findMref (str mref_name) |
| Returns the material with the indicated MRef name, or NULL if no material matches. More... | |
| int | findUsedMaterials (EggNode node) |
| Walks the egg hierarchy beginning at the indicated node, looking for materials that are referenced by primitives but are not already members of the collection, adding them to the collection. More... | |
| EggMaterialCollection | operator= (const EggMaterialCollection copy) |
| bool | removeMaterial (EggMaterial material) |
| Explicitly removes a material from the collection. More... | |
| removeUnusedMaterials (EggNode node) | |
| Removes any materials from the collection that aren't referenced by any primitives in the indicated egg hierarchy. More... | |
| sortByMref () | |
| Sorts all the materials into alphabetical order by MRef name. More... | |
| uniquifyMrefs () | |
| Guarantees that each material in the collection has a unique MRef name. More... | |
Static Public Member Functions | |
| static | replaceMaterials (EggGroupNode node, const EggMaterialCollection::MaterialReplacement replace) |
| Walks the egg hierarchy, changing out any reference to a material appearing on the left side of the map with its corresponding material on the right side. More... | |
This is a collection of materials by MRef name.
It can extract the materials from an egg file and sort them all together; it can also manage the creation of unique materials and the assignment of unique MRef names.
| __init__ | ( | ) |
| __init__ | ( | const EggMaterialCollection | copy | ) |
| bool addMaterial | ( | EggMaterial | material | ) |
Explicitly adds a new material to the collection.
Returns true if the material was added, false if it was already there or if there was some error.
| clear | ( | ) |
Removes all materials from the collection.
| int collapseEquivalentMaterials | ( | int | eq, |
| EggGroupNode | node | ||
| ) |
Walks through the collection and collapses together any separate materials that are equivalent according to the indicated equivalence factor, eq (see EggMaterial::is_equivalent_to()).
The return value is the number of materials removed.
This flavor of collapse_equivalent_materials() automatically adjusts all the primitives in the egg hierarchy to refer to the new material pointers.
| int collapseEquivalentMaterials | ( | int | eq, |
| EggMaterialCollection::MaterialReplacement | removed | ||
| ) |
Walks through the collection and collapses together any separate materials that are equivalent according to the indicated equivalence factor, eq (see EggMaterial::is_equivalent_to()).
The return value is the number of materials removed.
This flavor of collapse_equivalent_materials() does not adjust any primitives in the egg hierarchy; instead, it fills up the 'removed' map with an entry for each removed material, mapping it back to the equivalent retained material. It's up to the user to then call replace_materials() with this map, if desired, to apply these changes to the egg hierarchy.
| EggMaterial createUniqueMaterial | ( | const EggMaterial | copy, |
| int | eq | ||
| ) |
| int extractMaterials | ( | EggGroupNode | node | ) |
Walks the egg hierarchy beginning at the indicated node, and removes any EggMaterials encountered in the hierarchy, adding them to the collection.
Returns the number of EggMaterials encountered.
| EggMaterial findMref | ( | str | mref_name | ) |
Returns the material with the indicated MRef name, or NULL if no material matches.
| int findUsedMaterials | ( | EggNode | node | ) |
Walks the egg hierarchy beginning at the indicated node, looking for materials that are referenced by primitives but are not already members of the collection, adding them to the collection.
If this is called following extract_materials(), it can be used to pick up any additional material references that appeared in the egg hierarchy (but whose EggMaterial node was not actually part of the hierarchy).
If this is called in lieu of extract_materials(), it will fill up the collection with all of the referenced materials (and only the referenced materials), without destructively removing the EggMaterials from the hierarchy.
This also has the side effect of incrementing the internal usage count for a material in the collection each time a material reference is encountered. This side effect is taken advantage of by remove_unused_materials().
| EggMaterialCollection operator= | ( | const EggMaterialCollection | copy | ) |
| bool removeMaterial | ( | EggMaterial | material | ) |
Explicitly removes a material from the collection.
Returns true if the material was removed, false if it wasn't there or if there was some error.
| removeUnusedMaterials | ( | EggNode | node | ) |
Removes any materials from the collection that aren't referenced by any primitives in the indicated egg hierarchy.
This also, incidentally, adds materials to the collection that had been referenced by primitives but had not previously appeared in the collection.
|
static |
Walks the egg hierarchy, changing out any reference to a material appearing on the left side of the map with its corresponding material on the right side.
This is most often done following a call to collapse_equivalent_materials(). It does not directly affect the Collection.
| sortByMref | ( | ) |
Sorts all the materials into alphabetical order by MRef name.
Subsequent operations using begin()/end() will traverse in this sorted order.
| uniquifyMrefs | ( | ) |
Guarantees that each material in the collection has a unique MRef name.
This is essential before writing an egg file.


{% extends "layout.html" %} {% block body %} {% if not session.username %} Curami translated from Italian is 'heal me'
This tool employs various data analysis techniques to compare attributes in the BioSamples Database and provide relevant information to human curators to help them make curation decisions. Specifically, the tool is designed to find incorrect and erroneous attributes in the database. By presuming that a correct attribute already exists the tool looks for similar pairs of attributes and attempts to identify appropriate 'merges'.
This tool is in early development. This first implementation is designed to generate training data to inform the development of smarter curation algorithms. Curating the value information in the BioSamples Database is out of the current scope but the inbuilt techniques herein can be extended to this portion of the data in the future. The tool currently uses pairwise comparisons to find erroneous information but one of the next steps will be to evaluate each attribute on an individual basis. Training data will be used to inform the development of this functionality.
Currently, only lexically similar attribute pairs are fed into the analysis pipeline. Whilst lexically similar pairs most likely represent the largest number of erroneous attributes, this technique misses interesting non-lexical merges. The training data captured in this first round of curation will provide insight into other indicators for pair matching which can be later implemented across the dataset.


Last updated: 2018-08-06
workflowr checks: (Click a bullet for more information) ✖ R Markdown file: uncommitted changes
The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish
to commit the R Markdown file and build the HTML.
✔ Environment: empty
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
✔ Seed:
set.seed(20180708)
The command set.seed(20180708)
was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.
✔ Session information: recorded
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
✔ Repository version: f5bdc97
wflow_publish
or wflow_git_commit
). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
Ignored files:
Ignored: .RData
Ignored: .Rhistory
Ignored: .Rproj.user/
Untracked files:
Untracked: ORvalplot3a.pdf
Untracked: docs/assets/kd_abl_movie_2.mpg
Untracked: testmkdn.Rmd
Unstaged changes:
Modified: analysis/about.Rmd
Modified: analysis/index.Rmd
Modified: analysis/license.Rmd
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | be0a07e | haiderinam | 2018-08-06 | cleaned up the index page |
| html | be0a07e | haiderinam | 2018-08-06 | cleaned up the index page |
| html | ce0ba9a | haiderinam | 2018-07-08 | Build site. |
| Rmd | 13bfe58 | haiderinam | 2018-07-08 | Removed warning messages from code |
| html | 13bfe58 | haiderinam | 2018-07-08 | Removed warning messages from code |
| html | c659c89 | haiderinam | 2018-07-08 | wflow_git_commit(all = TRUE) |
| Rmd | dbeb3a4 | haiderinam | 2018-07-08 | wflow_git_commit(all = TRUE) |
| html | a87321b | haiderinam | 2018-07-08 | Build site. |
| html | 6388f5d | haiderinam | 2018-07-08 | Build site. |
| Rmd | eeb9ac4 | haiderinam | 2018-07-08 | wflow_git_commit(all = TRUE) |
| html | eeb9ac4 | haiderinam | 2018-07-08 | wflow_git_commit(all = TRUE) |
| html | e37fd6a | haiderinam | 2018-07-08 | Build site. |
| Rmd | 2cf442f | haiderinam | 2018-07-08 | Start workflowr project. |
Source: add github source here
alldata=read.csv("data/All_Data_V2.csv",sep=",",header=T,stringsAsFactors=F)
alldata=read.csv("data/All_Data_V2.csv",sep=",",header=T,stringsAsFactors=F)
#Sorting by whether user wants to search by specific mutations or the general format overall
if(mtn=='N') {
Positive_Ctrl1=as.numeric(!grepl("NaN",do.call("$",list(alldata,nameposctrl1)),ignore.case = TRUE))
Positive_Ctrl2=as.numeric(!grepl("NaN",do.call("$",list(alldata,nameposctrl2)),ignore.case = TRUE))
} else {
Positive_Ctrl1=as.numeric(grepl(nameposctrl1mt,do.call("$",list(alldata,nameposctrl1)),ignore.case = TRUE))
Positive_Ctrl2=as.numeric(grepl(nameposctrl2mt,do.call("$",list(alldata,nameposctrl2)),ignore.case = TRUE))
}
genex=as.numeric(!grepl(paste(c("NaN","0"), collapse = "|"),do.call("$",list(alldata,namegene)))) #Searching for 'NaN' or '0' in desired gene. A positive hit returns 0 and vise versa.
alldata_comp=cbind(alldata[,c(1,2)],Positive_Ctrl1,Positive_Ctrl2,genex) #Data frame with all the data compiled. I add in random array to this later
genex_replication_prop=sum(genex)/length(genex) #Calculating Replication Proportion
#Creating Random Array (Negative Control)
rndmarray=rbinom(length(Positive_Ctrl1),1,genex_replication_prop) #change alldata #Decided to just call random array in the for-loop
alldata_comp=cbind(alldata_comp,rndmarray) #Adding in random array to compiled gene data
all_genex =alldata_comp[alldata_comp$genex!=0,] #These will be used later for sampling
all_not_genex =alldata_comp[alldata_comp$genex==0,]
all_pc1 =alldata_comp[alldata_comp$Positive_Ctrl1!=0,]
all_not_pc1 =alldata_comp[alldata_comp$Positive_Ctrl1==0,]
all_pc2 =alldata_comp[alldata_comp$Positive_Ctrl2!=0,]
all_not_pc2 =alldata_comp[alldata_comp$Positive_Ctrl2==0,]
all_rndm =alldata_comp[alldata_comp$rndmarray!=0,]
all_not_rndm =alldata_comp[alldata_comp$rndmarray==0,]
#max subsample size is whichever integer is the minimum of: number of genex in sample vs. number of NOTgenex or PC1 or PC2 in sample*genexreplication proportion. For example we had 165 PC1s, therefore 340-175=165 PC1s in our data. Since we want to sample 7.35% positive hits and 92.65% negative hits, a sample containing too many positive hits can impose an upper bound on our subsampling size.
maxsubsamplesize=min(c(genex_replication_prop*length(alldata_comp$Positive_Ctrl1),floor((length(alldata_comp$Positive_Ctrl1)-sum(alldata_comp$Positive_Ctrl1))*genex_replication_prop),floor((length(alldata_comp$Positive_Ctrl1)-sum(alldata_comp$Positive_Ctrl2))*genex_replication_prop),floor((length(alldata_comp$Positive_Ctrl1)-sum(alldata_comp$genex))*genex_replication_prop)))
#Part in the code where exceeding the max limit, i.e. 25, returns an error
if(nsubsamples>maxsubsamplesize){
stop("Desired Subsample Size Exceeds Maxium Subsample Size")
}
#Returns error if max value > 1. Will this ever be a problem?
if(max(alldata_comp$Positive_Ctrl1|alldata_comp$Positive_Ctrl2|alldata_comp$genex)>1){
stop("Data Contains Integers >1. Please use either logicals or characters")
}
Current proportion of GeneX = 7.353% Total Number of Samples = 340
Number of Positive Control 1 Hits =175
Number of Positive Control 2 Hits = 95
Number of Gene of Interest Hits =25
The maximum allowed subsample size is 12
Therefore, during simulations, Positive Control 1 will be downsampled from 175 to 12. Positive Control 2 will be downsampled from 95 to 12
contab_maker<- function(gene1,gene2,arrayname) {
gene1_gene2_nn=nrow(arrayname[gene1==0 & gene2==0,]) #N N
gene1_gene2_ny=nrow(arrayname[gene1==0 & gene2!=0,]) #N Y
gene1_gene2_yn=nrow(arrayname[gene1!=0 & gene2==0,]) #Y N
gene1_gene2_yy=nrow(arrayname[gene1!=0 & gene2!=0,]) #Y Y
con_tab_gene1_gene2=rbind(c(gene1_gene2_nn,gene1_gene2_ny),c(gene1_gene2_yn,gene1_gene2_yy))
con_tab_gene1_gene2
}
#Contingency Tables:
con_tab_pctrl1_genex=contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$genex,alldata_comp)
con_tab_pctrl2_genex=contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$genex,alldata_comp)
con_tab_pctrl1_pctrl2=contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$Positive_Ctrl2,alldata_comp)
con_tab_pctrl1_rndmarray=contab_maker(alldata_comp$Positive_Ctrl1,alldata_comp$rndmarray,alldata_comp)
con_tab_pctrl2_rndmarray=contab_maker(alldata_comp$Positive_Ctrl2,alldata_comp$rndmarray,alldata_comp)
#Fisher's Exact Test
p_p1_genex=fisher.test(con_tab_pctrl1_genex)
p_p2_genex=fisher.test(con_tab_pctrl2_genex)
p_p1_p2=fisher.test(con_tab_pctrl1_pctrl2)
p_p1_rndm=fisher.test(con_tab_pctrl1_rndmarray)
p_p2_rndm=fisher.test(con_tab_pctrl2_rndmarray)
# There are three Loops here. These loop through sumsample size, simulation Number, and experiment number.
# Experiment number: There are 6 experiments. This is because there are 6 possible combinations to combinations of fisher's test for 4 samples (4C2=6)
#Need to modify so that nsubsamples can be a range (like 10:100) rather than a number (like 100)
nexperiments=6 #to make nexperiments a variable, alldatasamplepvals will need to be defined differently
simresults<-matrix(nrow=nsims*nsubsamples*nexperiments,ncol=9)
ct=1
for (subsamplenumber in 1:nsubsamples){
simresults[c(ct:((ct+(nsims*nexperiments))-1)),2]=subsamplenumber #Subsample Number: This updates the next n rows with the subsample number that the loop is on. n is calculated by number of experiments * number of simulations
subsamplenumbernegativehits=round(subsamplenumber/(genex_replication_prop))-subsamplenumber #This determines the number of non-hits for the sample
for (simnumber in 1:nsims){
alldata_comp$rndmarray=rbinom(length(Positive_Ctrl1),1,genex_replication_prop) #Creates random array. Note: we're updating random array at each simulation within each subsample size.
simresults[c(ct:((ct+nexperiments)-1)),3]=simnumber #Simulation Number. This updates the next 6 rows with the simulation number that the loop is on.
sample_genex =all_genex[sample(length(all_genex$genex),subsamplenumber,replace=F,prob=NULL),]
sample_not_genex =all_not_genex[sample(length(all_not_genex$genex),subsamplenumbernegativehits,replace=F,prob=NULL),]
sample_pc1 =all_pc1[sample(length(all_pc1$Positive_Ctrl1),subsamplenumber,replace=F,prob=NULL),]
sample_not_pc1 =all_not_pc1[sample(length(all_not_pc1$Positive_Ctrl1),subsamplenumbernegativehits,replace=F,prob=NULL),]
sample_pc2 =all_pc2[sample(length(all_pc2$Positive_Ctrl2),subsamplenumber,replace=F,prob=NULL),]
sample_not_pc2 =all_not_pc2[sample(length(all_not_pc2$Positive_Ctrl2),subsamplenumbernegativehits,replace=F,prob=NULL),]
sample_rndm =all_rndm[sample(length(all_rndm$rndmarray),subsamplenumber,replace=F,prob=NULL),]
sample_not_rndm =all_not_rndm[sample(length(all_not_rndm$rndmarray),subsamplenumbernegativehits,replace=F,prob=NULL),]
#Combining n (subsample number) hits and m (subsamplenegativenumber) non-hits
sample_genex_comb =rbind(sample_genex,sample_not_genex) #Dunno if this is the right way to do it
sample_pc1_comb =rbind(sample_pc1,sample_not_pc1)
sample_pc2_comb =rbind(sample_pc2,sample_not_pc2)
sample_rndm_comb =rbind(sample_rndm,sample_not_rndm)
alldata_comp_sample<-as.data.frame(cbind(sample_pc1_comb,sample_pc2_comb,sample_genex_comb,sample_rndm_comb)) #Creating array with samples so that contab_maker can use them
#contingency tables
con_tab_sample_pctrl1_genex=contab_maker(sample_pc1_comb$Positive_Ctrl1,sample_pc1_comb$genex,sample_pc1_comb) #Double check to see if this is the right way to do it
con_tab_sample_pctrl2_genex=contab_maker(sample_pc2_comb$Positive_Ctrl2,sample_pc2_comb$genex,sample_pc2_comb)
con_tab_sample_pctrl1_pctrl2=contab_maker(sample_pc1_comb$Positive_Ctrl1,sample_pc1_comb$Positive_Ctrl2,sample_pc1_comb) #note how sampling pc1 vs pc2 and then finding pc2 vs pc1 has drastically different p-values. Add code that looks at which of the samples has a smaller size and then chooses to sample for 7% of that first
con_tab_sample_pctrl1_pctrl2=contab_maker(sample_pc2_comb$Positive_Ctrl2,sample_pc2_comb$Positive_Ctrl1,sample_pc2_comb)
con_tab_sample_pctrl1_rndmarray=contab_maker(sample_pc1_comb$Positive_Ctrl1,sample_pc1_comb$rndmarray,sample_pc1_comb)
con_tab_sample_pctrl2_rndmarray=contab_maker(sample_pc2_comb$Positive_Ctrl2,sample_pc2_comb$rndmarray,sample_pc2_comb)
con_tab_sample_genex_rndmarray=contab_maker(sample_genex_comb$genex,sample_genex_comb$rndmarray,sample_genex_comb)
#Fishers exact test
p_s_p1_genex=fisher.test(con_tab_sample_pctrl1_genex,conf.int = 50) #p_s_ stands p-value, sample. Can name these better in the future
p_s_p2_genex=fisher.test(con_tab_sample_pctrl2_genex,conf.int = 50) #Could check if pc1_genex and genex_pc1 give the same p-value just to verify our test
p_s_p1_p2=fisher.test(con_tab_sample_pctrl1_pctrl2,conf.int = 50)
p_s_p1_rndm=fisher.test(con_tab_sample_pctrl1_rndmarray,conf.int = 50)
p_s_p2_rndm=fisher.test(con_tab_sample_pctrl2_rndmarray,conf.int = 50)
p_s_genex_rndm=fisher.test(con_tab_sample_genex_rndmarray,conf.int = 50)
#Creating df that has all the simulation data so far. This will be used by the simresults df later.
alldatasamplepvals<-as.data.frame(cbind(p_s_p1_genex$p.value,p_s_p2_genex$p.value,p_s_p1_p2$p.value,p_s_p1_rndm$p.value,p_s_p2_rndm$p.value,p_s_genex_rndm$p.value))
colnames(alldatasamplepvals)=c("p_s_p1_genex","p_s_p2_genex","p_s_p1_p2","p_s_p1_rndm","p_s_p2_rndm","p_s_genex_rndm")
alldatasampleORvals<-as.data.frame(cbind(p_s_p1_genex$estimate,p_s_p2_genex$estimate,p_s_p1_p2$estimate,p_s_p1_rndm$estimate,p_s_p2_rndm$estimate,p_s_genex_rndm$estimate))
colnames(alldatasampleORvals)=c("p_s_p1_genex","p_s_p2_genex","p_s_p1_p2","p_s_p1_rndm","p_s_p2_rndm","p_s_genex_rndm")
alldatasampleCIub<-as.data.frame(cbind(p_s_p1_genex$conf.int[2],p_s_p2_genex$conf.int[2],p_s_p1_p2$conf.int[2],p_s_p1_rndm$conf.int[2],p_s_p2_rndm$conf.int[2],p_s_genex_rndm$conf.int[2]))
colnames(alldatasampleCIub)=c("p_s_p1_genex","p_s_p2_genex","p_s_p1_p2","p_s_p1_rndm","p_s_p2_rndm","p_s_genex_rndm")
alldatasampleCIlb<-as.data.frame(cbind(p_s_p1_genex$conf.int[1],p_s_p2_genex$conf.int[1],p_s_p1_p2$conf.int[1],p_s_p1_rndm$conf.int[1],p_s_p2_rndm$conf.int[1],p_s_genex_rndm$conf.int[1]))
colnames(alldatasampleCIlb)=c("p_s_p1_genex","p_s_p2_genex","p_s_p1_p2","p_s_p1_rndm","p_s_p2_rndm","p_s_genex_rndm")
for (expnumber in 1:nexperiments) {
simresults[ct,1]=ct #Total Count
simresults[ct,4]=expnumber #Experiment Number
simresults[ct,5]=colnames(alldatasamplepvals[expnumber]) #Experiment Name
simresults[ct,6]=alldatasamplepvals[1,expnumber] #Experiment P-value. Trying to convert it into numerics
simresults[ct,7]=as.numeric(alldatasampleORvals[1,expnumber]) #Experiment OR-value
simresults[ct,8]=as.numeric(alldatasampleCIub[1,expnumber]) #Experiment 95% Upper Confidence Interval. Can be changed to other CI
simresults[ct,9]=as.numeric(alldatasampleCIlb[1,expnumber]) #Experiment 95% Lower Confidence Interval. Can be changed to other CI
ct=ct+1
}
}
}
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
`geom_smooth()` using method = 'loess'
Warning: Removed 23 rows containing non-finite values (stat_smooth).
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
| Version | Author | Date |
|---|---|---|
| be0a07e | haiderinam | 2018-08-06 |
Add an ab-line to the p-value plot from the ks-test to show your chosen criteria for p-values. Label this point of significance?
sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2.2 dplyr_0.7.5 ggplot2_2.2.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.17 bindr_0.1.1 knitr_1.20
[4] whisker_0.3-2 magrittr_1.5 workflowr_1.0.1
[7] tidyselect_0.2.4 munsell_0.5.0 colorspace_1.3-2
[10] R6_2.2.2 rlang_0.2.1 stringr_1.3.1
[13] plyr_1.8.4 tools_3.4.1 grid_3.4.1
[16] gtable_0.2.0 R.oo_1.22.0 git2r_0.21.0
[19] htmltools_0.3.6 assertthat_0.2.0 yaml_2.1.19
[22] lazyeval_0.2.1 rprojroot_1.3-2 digest_0.6.15
[25] tibble_1.4.2 purrr_0.2.5 R.utils_2.6.0
[28] glue_1.2.0 evaluate_0.10.1 rmarkdown_1.10
[31] labeling_0.3 stringi_1.2.3 pillar_1.2.3
[34] compiler_3.4.1 scales_0.5.0 backports_1.1.2
[37] R.methodsS3_1.7.1 pkgconfig_2.0.1
This reproducible R Markdown analysis was created with workflowr 1.0.1


Feature improvements
Bug Fixes
- Fixes for clients tied to virtual servers. If there is
no "listen" section there, clients use the main "listen"
section.
- Remove compiler warnings
- Print out correct filenames in debug mode
- Allow post-auth section to return "reject". This turns
the response into Access-Reject.
- Set X509_V_FLAG_CRL_CHECK_ALL, and add "check_all_crl"
to eap.conf. Fixes oCert CVE-2015-4680.


Name:
Age:
Country:
Goals:
Assists:
Minutes:
Fines:
Violations:
Matches:
Notes:
Task for matches:
Task for training:
Results (0-5):
Diet:
Transfer value (€):
Yellow cards:
Red cards:
Wage (€):
Contract:
New scored goals:
New goals conceded:
New league position:
New champions league place:
New cup place:
New match:


Embed your Public Participation Guide by pasting the following HTML code in an HTML embed block in your site:

Example preview:


1-way/2-way and 1-time binding Example
# watchers
name log
full name log
set Full Name
Full name : {{::fullName}}


|
GUISAN
|
#include <color.hpp>
Public Member Functions | |
| Color () | |
| Color (int color) | |
| Color (int r, int g, int b, int a=255) | |
| Color | operator+ (const Color &color) const |
| Color | operator- (const Color &color) const |
| Color | operator* (float value) const |
| bool | operator== (const Color &color) const |
| bool | operator!= (const Color &color) const |
Public Attributes | |
| int | r |
| int | g |
| int | b |
| int | a |
Represents a color with red, green, blue and alpha components.
| gcn::Color::Color | ( | ) |
Constructor. Initializes the color to black.
| gcn::Color::Color | ( | int | color | ) |
Constructs a color from the bytes in an integer. Call it with a hexadecimal constant for HTML-style color representation. The alpha component will be set to 255.
EXAMPLE: Color(0xff50a0) constructs Gui-chan's favourite color.
NOTE: Because of this constructor, integers will be automatically casted to a color by your compiler.
| color | the color. |
| gcn::Color::Color | ( | int | r, |
| int | g, | ||
| int | b, | ||
| int | a = 255 |
||
| ) |
Constructor.
| r | Red color component (range 0-255). |
| g | Green color component (range 0-255). |
| b | Blue color component (range 0-255). |
| a | Color alpha, used for transparency. A value of 0 means totaly transparent, 255 is totaly opaque (the default). |
| bool gcn::Color::operator!= | ( | const Color & | color | ) | const |
Compares two colors.
| Color gcn::Color::operator* | ( | float | value | ) | const |
Multiplies the RGB values of a color with a float value. The values will be clamped if they go out of range.
| value | the value to multiply the color with. |
Adds the RGB values of two colors together. The values will be clamped if they go out of range.
| color | a color to add to this color. |
Subtracts the RGB values of one color from another. The values will be clamped if they go out of range.
| color | a color to subtract from this color. |
| bool gcn::Color::operator== | ( | const Color & | color | ) | const |
Compares two colors.
| int gcn::Color::a |
Color alpha, used for transparency. A value of 0 means totaly transparent, 255 is totaly opaque (the default)
| int gcn::Color::b |
Blue color component (range 0-255).
| int gcn::Color::g |
Green color component (range 0-255).
| int gcn::Color::r |
Red color component (range 0-255).