libgrape-lite
A C++ library for parallel graph processing
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
grape::FragmentBase< OID_T, VDATA_T, EDATA_T > Class Template Referenceabstract

FragmentBase is the base class for fragments. More...

#include <fragment_base.h>

Inheritance diagram for grape::FragmentBase< OID_T, VDATA_T, EDATA_T >:
grape::EdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, TRAITS_T > grape::CSREdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, ImmutableEdgecutFragmentTraits< OID_T, VID_T, VDATA_T, EDATA_T > > grape::CSREdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, MutableEdgecutFragmentTraits< OID_T, VID_T, VDATA_T, EDATA_T > > grape::CSREdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, TRAITS_T > grape::ImmutableEdgecutFragment< OID_T, VID_T, VDATA_T, EDATA_T, grape::LoadStrategy::kOnlyOut > grape::ImmutableEdgecutFragment< OID_T, VID_T, VDATA_T, EDATA_T, _load_strategy > grape::MutableEdgecutFragment< OID_T, VID_T, VDATA_T, EDATA_T, _load_strategy > grape::cuda::HostFragment< OID_T, VID_T, VDATA_T, EDATA_T, _load_strategy >

Public Member Functions

bool directed () const
 Returns true if the fragment is directed, false otherwise. More...
 
fid_t fid () const
 Returns the ID of this fragment. More...
 
fid_t fnum () const
 Returns the number of fragments. More...
 
virtual size_t GetEdgeNum () const =0
 Returns the number of edges in this fragment. More...
 
virtual size_t GetVerticesNum () const =0
 Returns the number of vertices in this fragment. More...
 
virtual size_t GetTotalVerticesNum () const =0
 Returns the number of vertices in the entire graph. More...
 
virtual void PrepareToRunApp (const CommSpec &comm_spec, PrepareConf conf, const ParallelEngineSpec &pe_spec)=0
 For some kind of applications, specific data structures will be generated. More...
 

Protected Member Functions

void init (fid_t fid, fid_t fnum, bool directed)
 
template<typename IOADAPTOR_T >
void serialize (std::unique_ptr< IOADAPTOR_T > &writer)
 
template<typename IOADAPTOR_T >
void deserialize (std::unique_ptr< IOADAPTOR_T > &reader)
 

Protected Attributes

fid_t fid_
 
fid_t fnum_
 
bool directed_
 

Detailed Description

template<typename OID_T, typename VDATA_T, typename EDATA_T>
class grape::FragmentBase< OID_T, VDATA_T, EDATA_T >

FragmentBase is the base class for fragments.

Note
: The pure virtual functions in the class work as interfaces, instructing sub-classes to implement. The override functions in the derived classes would be invoked directly, not via virtual functions.
Template Parameters
OID_T
VDATA_T
EDATA_T

Member Function Documentation

◆ directed()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
bool grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::directed ( ) const
inline

Returns true if the fragment is directed, false otherwise.

Returns
true if the fragment is directed, false otherwise.

◆ fid()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
fid_t grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::fid ( ) const
inline

Returns the ID of this fragment.

Returns
The ID of this fragment.

◆ fnum()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
fid_t grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::fnum ( ) const
inline

Returns the number of fragments.

Returns
The number of fragments.

◆ GetEdgeNum()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
virtual size_t grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::GetEdgeNum ( ) const
pure virtual

◆ GetTotalVerticesNum()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
virtual size_t grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::GetTotalVerticesNum ( ) const
pure virtual

Returns the number of vertices in the entire graph.

Returns
The number of vertices in the entire graph.

Implemented in grape::ImmutableVertexcutFragment< uint64_t, EmptyType, EmptyType >, and grape::EdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, TRAITS_T >.

◆ GetVerticesNum()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
virtual size_t grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::GetVerticesNum ( ) const
pure virtual

Returns the number of vertices in this fragment.

Returns
The number of vertices in this fragment.

Implemented in grape::ImmutableVertexcutFragment< uint64_t, EmptyType, EmptyType >, and grape::EdgecutFragmentBase< OID_T, VID_T, VDATA_T, EDATA_T, TRAITS_T >.

◆ PrepareToRunApp()

template<typename OID_T , typename VDATA_T , typename EDATA_T >
virtual void grape::FragmentBase< OID_T, VDATA_T, EDATA_T >::PrepareToRunApp ( const CommSpec comm_spec,
PrepareConf  conf,
const ParallelEngineSpec pe_spec 
)
pure virtual