class Namelist. 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 287 of file Namelist.hpp.
#include <Namelist.hpp>
Public Member Functions | |
void | clear () |
empty the list More... | |
bool | contains (const std::string &name) const |
does the Namelist contain the input name? More... | |
std::string | getName (const unsigned int in) const |
int | index (const std::string &name) const |
Namelist () | |
empty constructor More... | |
Namelist (const Namelist &names) | |
copy constructor More... | |
Namelist (const std::vector< std::string > &names) | |
Namelist (const unsigned int &n) | |
constructor given dimension - creates default labels More... | |
Namelist & | operator&= (const Namelist &N) |
replace this with (this& input) More... | |
LabeledMatrix | operator() (Matrix< double > &m) |
LabeledVector | operator() (Vector< double > &v) |
Namelist & | operator+= (const Namelist &right) |
add entire Namelist to this using operator+=(string) More... | |
Namelist & | operator+= (const std::string &name) |
Namelist & | operator-= (const std::string &name) |
Namelist & | operator= (const Namelist &right) |
operator= More... | |
Namelist & | operator^= (const Namelist &N) |
replace this with (this ^ input) More... | |
Namelist & | operator|= (const Namelist &N) |
replace this with (this | input) More... | |
void | randomize (long seed=0) |
randomize the list More... | |
void | resize (unsigned int n) |
resize the list by either truncation or adding default names. More... | |
bool | setName (const unsigned int in, const std::string &name) |
unsigned int | size () const |
return the size of the list. More... | |
void | sort () |
reorder the list by sorting More... | |
void | swap (const unsigned int &i, const unsigned int &j) |
bool | valid () const |
is the Namelist valid? checks for repeated names More... | |
~Namelist () | |
destructor More... | |
Public Attributes | |
std::vector< std::string > | labels |
vector of names (strings) More... | |
Friends | |
bool | identical (const Namelist &N1, const Namelist &N2) |
are two Namelists exactly identical, even considering permutations? More... | |
bool | operator!= (const Namelist &N1, const Namelist &N2) |
are two Namelists different, ignoring permutations? More... | |
Namelist | operator& (const Namelist &N1, const Namelist &N2) |
construct the subset Namelist which is common to the two inputs (AND) More... | |
std::ostream & | operator<< (std::ostream &os, const LabeledMatrix &N) |
output ostream operator for LabeledMatrix More... | |
std::ostream & | operator<< (std::ostream &os, const LabeledVector &N) |
output ostream operator for LabeledVector More... | |
std::ostream & | operator<< (std::ostream &os, const Namelist &N) |
output ostream operator More... | |
bool | operator== (const Namelist &N1, const Namelist &N2) |
are two Namelists identical, ignoring permutations? More... | |
Namelist | operator^ (const Namelist &N1, const Namelist &N2) |
construct the subset Namelist which is NOT common to two others (XOR) More... | |
Namelist | operator| (const Namelist &N1, const Namelist &N2) |
merge two Namelists, i.e. construct a non-redundant combination (OR) More... | |
class | SRI |
|
inline |
empty constructor
Definition at line 295 of file Namelist.hpp.
gnsstk::Namelist::Namelist | ( | const unsigned int & | n | ) |
constructor given dimension - creates default labels
Definition at line 67 of file Namelist.cpp.
gnsstk::Namelist::Namelist | ( | const std::vector< std::string > & | names | ) |
explicit constructor - only a unique subset of the input will be included.
Definition at line 88 of file Namelist.cpp.
copy constructor
Definition at line 305 of file Namelist.hpp.
|
inline |
destructor
Definition at line 308 of file Namelist.hpp.
|
inline |
empty the list
Definition at line 354 of file Namelist.hpp.
bool gnsstk::Namelist::contains | ( | const std::string & | name | ) | const |
does the Namelist contain the input name?
Definition at line 264 of file Namelist.cpp.
std::string gnsstk::Namelist::getName | ( | const unsigned int | in | ) | const |
access to a specific name, given its index. returns 'out-of-range' if the index is out of range.
Definition at line 485 of file Namelist.cpp.
int gnsstk::Namelist::index | ( | const std::string & | name | ) | const |
return the index of the name in the list that matches the input, -1 if not found.
Definition at line 530 of file Namelist.cpp.
replace this with (this& input)
Definition at line 402 of file Namelist.cpp.
|
inline |
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 392 of file Namelist.hpp.
|
inline |
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 400 of file Namelist.hpp.
add entire Namelist to this using operator+=(string)
Definition at line 322 of file Namelist.hpp.
add a single name to the Namelist
if | the name is not unique |
Definition at line 114 of file Namelist.cpp.
remove a name from the Namelist; does nothing if the name is not found.
Definition at line 132 of file Namelist.cpp.
operator=
Definition at line 311 of file Namelist.hpp.
replace this with (this ^ input)
Definition at line 447 of file Namelist.cpp.
replace this with (this | input)
Definition at line 425 of file Namelist.cpp.
void gnsstk::Namelist::randomize | ( | long | seed = 0 | ) |
randomize the list
Definition at line 220 of file Namelist.cpp.
void gnsstk::Namelist::resize | ( | unsigned int | n | ) |
resize the list by either truncation or adding default names.
Definition at line 187 of file Namelist.cpp.
assign a specific name, given its index; no effect if the name is not unique; return true if successful.
Definition at line 504 of file Namelist.cpp.
|
inline |
return the size of the list.
Definition at line 408 of file Namelist.hpp.
void gnsstk::Namelist::sort | ( | ) |
reorder the list by sorting
Definition at line 173 of file Namelist.cpp.
swap two elements, as given by their indexes; no effect if either index is out of range.
Definition at line 150 of file Namelist.cpp.
bool gnsstk::Namelist::valid | ( | ) | const |
is the Namelist valid? checks for repeated names
Definition at line 247 of file Namelist.cpp.
are two Namelists exactly identical, even considering permutations?
Definition at line 331 of file Namelist.cpp.
are two Namelists different, ignoring permutations?
Definition at line 318 of file Namelist.cpp.
construct the subset Namelist which is common to the two inputs (AND)
Definition at line 357 of file Namelist.cpp.
|
friend |
output ostream operator for LabeledMatrix
Definition at line 637 of file Namelist.cpp.
|
friend |
output ostream operator for LabeledVector
are two Namelists identical, ignoring permutations?
Definition at line 282 of file Namelist.cpp.
construct the subset Namelist which is NOT common to two others (XOR)
Definition at line 387 of file Namelist.cpp.
merge two Namelists, i.e. construct a non-redundant combination (OR)
Definition at line 372 of file Namelist.cpp.
|
friend |
Definition at line 289 of file Namelist.hpp.
std::vector<std::string> gnsstk::Namelist::labels |
vector of names (strings)
Definition at line 437 of file Namelist.hpp.