Public Member Functions | Private Member Functions | Private Attributes | Friends
subGraph< graphType > Class Template Reference

Public Member Functions

 subGraph (graphType &, const label, const label)
 Construct from graph and start row and size. More...
 
 subGraph (const subGraph< graphType > &)
 Copy contructor. More...
 
 ~subGraph ()
 
label size () const
 Returns the number of rows. More...
 
label sizeOfRow (const label rowI) const
 Returns the size of a given row. More...
 
void append (const label rowI, const label)
 Append an element to the given row. More...
 
void appendIfNotIn (const label rowI, const label)
 Append an element to the given row if it does not exist there. More...
 
bool contains (const label rowI, const label e) const
 check if the element is in the given row (takes linear time) More...
 
label containsAtPosition (const label rowI, const label e) const
 
label operator() (const label i, const label j) const
 set and get operators More...
 
labeloperator() (const label i, const label j)
 
const graphRow< const graphType > operator[] (const label) const
 
graphRow< graphType > operator[] (const label)
 

Private Member Functions

void checkIndex (const label i) const
 check index More...
 

Private Attributes

graphType & data_
 reference to the graph More...
 
const label start_
 starts at row More...
 
const label size_
 number of rows in the subGraph More...
 

Friends

Ostreamoperator (Ostream &, const subGraph< graphType > &)
 

Detailed Description

template<class graphType>
class Foam::subGraph< graphType >

Definition at line 47 of file subGraph.H.

Constructor & Destructor Documentation

◆ subGraph() [1/2]

subGraph ( graphType &  g,
const label  start,
const label  size 
)
inline

Construct from graph and start row and size.

Definition at line 48 of file subGraphI.H.

◆ subGraph() [2/2]

subGraph ( const subGraph< graphType > &  ol)
inline

Copy contructor.

Definition at line 62 of file subGraphI.H.

◆ ~subGraph()

~subGraph
inline

Definition at line 73 of file subGraphI.H.

Member Function Documentation

◆ checkIndex()

void checkIndex ( const label  i) const
inlineprivate

check index

Definition at line 30 of file subGraphI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

◆ size()

Foam::label size
inline

Returns the number of rows.

Definition at line 81 of file subGraphI.H.

◆ sizeOfRow()

Foam::label sizeOfRow ( const label  rowI) const
inline

Returns the size of a given row.

Definition at line 87 of file subGraphI.H.

◆ append()

void append ( const label  rowI,
const label  el 
)
inline

Append an element to the given row.

Definition at line 93 of file subGraphI.H.

◆ appendIfNotIn()

void appendIfNotIn ( const label  rowI,
const label  el 
)
inline

Append an element to the given row if it does not exist there.

Definition at line 100 of file subGraphI.H.

◆ contains()

bool contains ( const label  rowI,
const label  e 
) const
inline

check if the element is in the given row (takes linear time)

Definition at line 110 of file subGraphI.H.

References Foam::e.

◆ containsAtPosition()

Foam::label containsAtPosition ( const label  rowI,
const label  e 
) const
inline

Definition at line 120 of file subGraphI.H.

References Foam::e.

◆ operator()() [1/2]

Foam::label operator() ( const label  i,
const label  j 
) const
inline

set and get operators

Definition at line 132 of file subGraphI.H.

◆ operator()() [2/2]

Foam::label & operator() ( const label  i,
const label  j 
)
inline

Definition at line 146 of file subGraphI.H.

◆ operator[]() [1/2]

const Foam::graphRow< const graphType > operator[] ( const label  i) const
inline

Definition at line 158 of file subGraphI.H.

◆ operator[]() [2/2]

Foam::graphRow< graphType > operator[] ( const label  i)
inline

Definition at line 167 of file subGraphI.H.

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream ,
const subGraph< graphType > &   
)
friend

Field Documentation

◆ data_

graphType& data_
private

reference to the graph

Definition at line 60 of file subGraph.H.

◆ start_

const label start_
private

starts at row

Definition at line 63 of file subGraph.H.

◆ size_

const label size_
private

number of rows in the subGraph

Definition at line 66 of file subGraph.H.


The documentation for this class was generated from the following files: