#include <Namelist.hpp>
A Namelist is simply an ordered set of unique strings ('names' or 'labels') of any length. Namelists are used to label or identify elements of Vectors or Matrix rows and columns. Namelist is particularly useful in class SRI, which includes a Matrix and Vector that hold state and covariance information in an estimation problem; SRI include a Namelist which associates readable labels with the elements of the state and covariance.
Definition at line 122 of file Namelist.hpp.
Public Member Functions | |
| Namelist (void) | |
| empty constructor | |
| Namelist (const unsigned int &) | |
| constructor given dimension - creates default labels | |
| Namelist (const std::vector< std::string > &) | |
| explicit constructor - only a unique subset of the input will be included. | |
| Namelist (const Namelist &names) | |
| copy constructor | |
| ~Namelist (void) | |
| destructor | |
| Namelist & | operator= (const Namelist &right) |
| operator= | |
| Namelist & | operator+= (const std::string &) |
| add a single name to the Namelist; do nothing if the name is not unique. | |
| Namelist & | operator-= (const std::string &) |
| remove a name from the Namelist; does nothing if the name is not found. | |
| void | swap (const unsigned int &, const unsigned int &) |
| swap two elements, as given by their indexes; no effect if either index is out of range. | |
| void | sort (void) |
| reorder the list by sorting | |
| void | resize (unsigned int) |
| resize the list by either truncation or adding default names. | |
| void | randomize (long seed=0) |
| randomize the list | |
| void | clear (void) |
| empty the list | |
| bool | valid (void) const |
| is the Namelist valid? checks for repeated names (? not possible to create an invalid Namelist?) | |
| bool | contains (const std::string &) const |
| does the Namelist contain the input name? | |
| Namelist & | operator &= (const Namelist &) |
| replace this with (this & input) | |
| Namelist & | operator|= (const Namelist &) |
| replace this with (this | input) | |
| Namelist & | operator^= (const Namelist &) |
| replace this with (this ^ input) | |
| LabelledMatrix | operator() (Matrix< double > &m) |
| bind a Namelist to a Matrix<double> before sending it to an output stream, to get a 'labelled display' of the matrix. | |
| LabelledVector | operator() (Vector< double > &v) |
| bind a Namelist to a Vector<double> before sending it to an output stream, to get a 'labelled display' of the vector. | |
| unsigned int | size (void) const |
| return the size of the list. | |
| std::string | getName (const unsigned int) const |
| access to a specific name, given its index. | |
| bool | setName (const unsigned int, const std::string &) |
| assign a specific name, given its index; no effect if the name is not unique; return true if successful. | |
| int | index (const std::string &) const |
| return the index of the name in the list that matches the input, -1 if not found. | |
Public Attributes | |
| std::vector< std::string > | labels |
| vector of names (strings) | |
Friends | |
| class | SRI |
| std::ostream & | operator<< (std::ostream &, const LabelledMatrix &) |
| std::ostream & | operator<< (std::ostream &, const LabelledVector &) |
| bool | operator== (const Namelist &, const Namelist &) |
| are two Namelists identical, ignoring permutations? | |
| bool | operator!= (const Namelist &, const Namelist &) |
| are two Namelists different, ignoring permutations? | |
| bool | identical (const Namelist &, const Namelist &) |
| are two Namelists exactly identical, even considering permutations? | |
| Namelist | operator & (const Namelist &, const Namelist &) |
| construct the subset Namelist which is common to the two inputs (AND) | |
| Namelist | operator| (const Namelist &, const Namelist &) |
| merge two Namelists, i.e. construct a non-redundant combination (OR) | |
| Namelist | operator^ (const Namelist &, const Namelist &) |
| construct the subset Namelist which is NOT common to two others (XOR) | |
| std::ostream & | operator<< (std::ostream &s, const Namelist &) |
| output operator | |
|
|
empty constructor
Definition at line 128 of file Namelist.hpp. |
|
|
constructor given dimension - creates default labels
Definition at line 67 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. |
|
|
explicit constructor - only a unique subset of the input will be included.
Definition at line 83 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. |
|
|
copy constructor
Definition at line 134 of file Namelist.hpp. References Namelist::labels. |
|
|
destructor
Definition at line 136 of file Namelist.hpp. References Namelist::clear(). |
|
|
empty the list
Definition at line 156 of file Namelist.hpp. Referenced by Namelist::~Namelist(). |
|
|
does the Namelist contain the input name?
Definition at line 191 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. Referenced by Namelist::operator &=(), Namelist::operator+=(), Namelist::operator^=(), Namelist::operator|=(), Namelist::resize(), and Namelist::setName(). |
|
|
access to a specific name, given its index. returns 'out-of-range' if the index is out of range. Definition at line 327 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. Referenced by SRI::getName(), and gpstk::operator<<(). |
|
|
return the index of the name in the list that matches the input, -1 if not found.
Definition at line 352 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. Referenced by SRI::index(), and SRI::operator+=(). |
|
|
replace this with (this & input)
Definition at line 275 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, and Namelist::labels. |
|
|
bind a Namelist to a Vector<double> before sending it to an output stream, to get a 'labelled display' of the vector.
Definition at line 190 of file Namelist.hpp. |
|
|
bind a Namelist to a Matrix<double> before sending it to an output stream, to get a 'labelled display' of the matrix.
Definition at line 185 of file Namelist.hpp. |
|
|
add a single name to the Namelist; do nothing if the name is not unique.
Definition at line 98 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, and Namelist::labels. |
|
|
remove a name from the Namelist; does nothing if the name is not found.
Definition at line 109 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. |
|
|
operator=
Definition at line 139 of file Namelist.hpp. References Namelist::labels. |
|
|
replace this with (this ^ input)
Definition at line 302 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, Namelist::labels, and Namelist::size(). |
|
|
replace this with (this | input)
Definition at line 289 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, Namelist::labels, and Namelist::size(). |
|
|
randomize the list
Definition at line 169 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. |
|
|
resize the list by either truncation or adding default names.
Definition at line 146 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, and Namelist::labels. |
|
||||||||||||
|
assign a specific name, given its index; no effect if the name is not unique; return true if successful.
Definition at line 339 of file Namelist.cpp. References Namelist::contains(), GPSTK_RETHROW, and Namelist::labels. Referenced by SRI::setName(). |
|
|
return the size of the list.
Definition at line 196 of file Namelist.hpp. Referenced by gpstk::identical(), SRI::operator+=(), gpstk::operator<<(), gpstk::operator==(), Namelist::operator^=(), and Namelist::operator|=(). |
|
|
reorder the list by sorting
Definition at line 136 of file Namelist.cpp. References GPSTK_RETHROW, Namelist::labels, and gpstk::sort(). |
|
||||||||||||
|
swap two elements, as given by their indexes; no effect if either index is out of range.
Definition at line 123 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. Referenced by SRI::split(). |
|
|
is the Namelist valid? checks for repeated names (? not possible to create an invalid Namelist?)
Definition at line 179 of file Namelist.cpp. References GPSTK_RETHROW, and Namelist::labels. |
|
||||||||||||
|
are two Namelists exactly identical, even considering permutations?
Definition at line 228 of file Namelist.cpp. |
|
||||||||||||
|
construct the subset Namelist which is common to the two inputs (AND)
Definition at line 242 of file Namelist.cpp. |
|
||||||||||||
|
are two Namelists different, ignoring permutations?
Definition at line 219 of file Namelist.cpp. |
|
||||||||||||
|
output operator
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
are two Namelists identical, ignoring permutations?
Definition at line 202 of file Namelist.cpp. |
|
||||||||||||
|
construct the subset Namelist which is NOT common to two others (XOR)
Definition at line 264 of file Namelist.cpp. |
|
||||||||||||
|
merge two Namelists, i.e. construct a non-redundant combination (OR)
Definition at line 253 of file Namelist.cpp. |
|
|
Definition at line 123 of file Namelist.hpp. |
|
|
vector of names (strings)
Definition at line 221 of file Namelist.hpp. Referenced by Namelist::contains(), Namelist::getName(), gpstk::identical(), Namelist::index(), Namelist::Namelist(), Namelist::operator &=(), SRI::operator+=(), Namelist::operator+=(), Namelist::operator-=(), gpstk::operator<<(), Namelist::operator=(), gpstk::operator==(), Namelist::operator^=(), Namelist::operator|=(), Namelist::randomize(), Namelist::resize(), Namelist::setName(), Namelist::sort(), SRI::split(), Namelist::swap(), and Namelist::valid(). |
1.3.9.1