Xmipp
v3.23.11-Nereus
|
#include <docfile.h>
Public Types | |
enum | Line_Type { NOT_CONSIDERED = -1, NOT_ASSIGNED = 0, DATALINE = 1, COMMENT = 2 } |
Public Member Functions | |
void | read (std::istream &i) |
Constructors for Document Lines | |
DocLine () | |
Component access | |
double & | operator[] (size_t i) |
double | operator[] (size_t i) const |
void | set (size_t i, double val) |
void | set (const Matrix1D< double > &v) |
Structure information | |
std::string | get_text () |
int | get_key () const |
int | get_no_components () const |
void | clear () |
int | Is_comment () |
int | Is_data () |
void | set_type (Line_Type _line_type) |
Friends | |
class | DocFile |
Document file can access anything in this class. More... | |
std::ostream & | operator<< (std::ostream &o, const DocLine &DL) |
DocFile Line.
The Document file is a collection (STL list) of Document lines. This class needn't be accessed in common programs since the DocFile class offers most of the used functions. However, the class is shown in case you may need to access specifically to any of the Document Line functions alone. The DocLines can be either comments or data line, they might be of other internal used types (not assigned or to be discarded), but you may assume that if a line is not a comment nor a data line then it can be skipped.
enum DocLine::Line_Type |
Enumerator | |
---|---|
NOT_CONSIDERED | |
NOT_ASSIGNED | |
DATALINE | |
COMMENT |
|
inline |
Empty Constructor.
The document line is created with no type (neither comment or data). You must use the function set_type to assign a type
void DocLine::clear | ( | ) |
|
inline |
|
inline |
Get the number of components.
If it is a comment or it hasn't been assigned it returns -1
Definition at line 151 of file docfile.h.
|
inline |
|
inline |
True if current line is a comment.
|
inline |
True if current line is a comment.
double & DocLine::operator[] | ( | size_t | i | ) |
Set existing components.
Inside the document line the values are considered as an array (with starting index at 0). With this function you can set any EXISTING position inside the document line. If the position has not been created yet (ie, the vector is smaller) then an exception is thrown.
This function is ignored in the python wrapper. Use "set" instead.
Definition at line 34 of file docfile.cpp.
double DocLine::operator[] | ( | size_t | i | ) | const |
Constant component access.
The same as the previous function
This function is renamed as "get" in the python wrapper.
Definition at line 46 of file docfile.cpp.
void DocLine::read | ( | std::istream & | i | ) |
Read a Document Line. An exception is thrown if the line doesn't meet the Document File specifications. First the line is read in a C way, if it fails then the exact Fortran output is tried.
Definition at line 129 of file docfile.cpp.
void DocLine::set | ( | size_t | i, |
double | val | ||
) |
Set an existing or not component.
If the Document Line is not large enough to hold the required component, then it is resized
Definition at line 58 of file docfile.cpp.
void DocLine::set | ( | const Matrix1D< double > & | v | ) |
Set a vector (Matrix1D) as Document line.
It doesn't matter if it is a row or a column vector. The previous data is overwritten and the key is kept. If it was not a data line, then the new key=0.
Definition at line 73 of file docfile.cpp.
|
inline |
|
friend |
|
friend |
Show a Document Line.
Definition at line 95 of file docfile.cpp.