Go to the documentation of this file.
29 template<
class graphType>
32 if( (i < 0) || (i >= size_) )
36 "void Foam::subGraph<graphType>::"
37 "checkIndex(const label i) const"
38 ) <<
"Row index " << i
46 template<
class graphType>
60 template<
class graphType>
72 template<
class graphType>
80 template<
class graphType>
86 template<
class graphType>
89 return data_.sizeOfRow(start_+rowI);
92 template<
class graphType>
95 data_.append(start_+rowI, el);
98 template<
class graphType>
105 data_.appendIfNotIn(start_+rowI, el);
108 template<
class graphType>
115 return data_.contains(start_+rowI,
e);
118 template<
class graphType>
125 return data_.containsAtPosition(start_+rowI,
e);
130 template<
class graphType>
141 return data_(start_+i, j);
144 template<
class graphType>
151 return data_(start_+i, j);
155 template<
class graphType>
162 return data_[start_+i];
165 template<
class graphType>
169 return data_[start_+i];
172 template<
class graphType>
179 os << sg.size() <<
"\n" <<
"(";
182 os <<
"\n" << sg.sizeOfRow(i) <<
"(";
185 if( j > 0 ) os <<
" ";
graphType & data_
reference to the graph
bool contains(const label rowI, const label e) const
check if the element is in the given row (takes linear time)
const label start_
starts at row
label containsAtPosition(const label rowI, const label e) const
subGraph(graphType &, const label, const label)
Construct from graph and start row and size.
const dimensionedVector & g
void append(const label rowI, const label)
Append an element to the given row.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const label size_
number of rows in the subGraph
void appendIfNotIn(const label rowI, const label)
Append an element to the given row if it does not exist there.
label size() const
Returns the number of rows.
errorManip< error > abort(error &err)
const double e
Elementary charge.
const graphRow< const graphType > operator[](const label) const
label sizeOfRow(const label rowI) const
Returns the size of a given row.
void checkIndex(const label i) const
check index
friend Ostream & operator(Ostream &, const subGraph< graphType > &)
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...