Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
lem::HeadsTranspose Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-23/LEM/func/Heads.h"

Public Member Functions

 ~HeadsTranspose ()
 
int NHeads () const
 
int HeadIdx (int i) const
 
intpHeadSeqs () const
 

Static Public Member Functions

static HeadsTransposeFromMMap (const std::string &libPath)
 
static HeadsTransposeFromMMapOnDemand (const std::string &libPath)
 

Protected Member Functions

 HeadsTranspose ()
 
 HeadsTranspose (const HeadsTranspose &)
 
HeadsTransposeoperator= (const HeadsTranspose &)
 

Protected Attributes

int fNHeads
 
int fLibSize
 
intfHeadIdxs
 
intfPSeqs
 
long fMappingSize
 

Friends

std::ostream & operator<< (std::ostream &, const lem::HeadsTranspose &)
 

Detailed Description

Definition at line 46 of file Heads.h.

Constructor & Destructor Documentation

lem::HeadsTranspose::~HeadsTranspose ( )

Definition at line 134 of file Heads.cxx.

References lem::Heads::fMappingSize.

135  {
136  munmap(kHeadsAddr, fMappingSize);
137  }
long fMappingSize
Definition: Heads.h:71
lem::HeadsTranspose::HeadsTranspose ( )
inlineprotected

Definition at line 62 of file Heads.h.

References lem::Heads::operator=().

62 {}
lem::HeadsTranspose::HeadsTranspose ( const HeadsTranspose )
protected

Member Function Documentation

HeadsTranspose * lem::HeadsTranspose::FromMMap ( const std::string libPath)
static

Definition at line 99 of file Heads.cxx.

References fHeadIdxs, fLibSize, fMappingSize, fNHeads, fPSeqs, makeTrainCVSamples::int, and lem::MMapFileAtAddress().

Referenced by lem::FindMatchesTranspose::endRun().

100  {
101  HeadsTranspose* heads = new HeadsTranspose;
102 
103  heads->fMappingSize = MMapFileAtAddress(libPath+"/heads_map_transpose.bin", kHeadsAddr, false);
104 
105  heads->fNHeads = ((int*)kHeadsAddr)[0];
106  heads->fLibSize = ((int*)kHeadsAddr)[1];
107 
108  heads->fHeadIdxs = ((int*)kHeadsAddr)+2;
109 
110  heads->fPSeqs = (int*)((char*)heads->fHeadIdxs+sizeof(int)*heads->fNHeads);
111 
112  return heads;
113  }
long MMapFileAtAddress(const std::string &fname, void *addr, bool touchAll, const std::string &lockName)
Definition: Util.cxx:18
HeadsTranspose * lem::HeadsTranspose::FromMMapOnDemand ( const std::string libPath)
static

Definition at line 116 of file Heads.cxx.

References lem::CreateOnDemandMapping(), fHeadIdxs, fLibSize, fMappingSize, fNHeads, fPSeqs, and makeTrainCVSamples::int.

Referenced by lem::FindMatchesTranspose::endRun().

117  {
118  CreateOnDemandMapping((libPath+"/heads_map_transpose.bin").c_str(), kHeadsAddr);
119 
120  HeadsTranspose* heads = new HeadsTranspose;
121  heads->fMappingSize = 0;
122 
123  heads->fNHeads = ((int*)kHeadsAddr)[0];
124  heads->fLibSize = ((int*)kHeadsAddr)[1];
125 
126  heads->fHeadIdxs = ((int*)kHeadsAddr)+2;
127 
128  heads->fPSeqs = (int*)((char*)heads->fHeadIdxs+sizeof(int)*heads->fNHeads);
129 
130  return heads;
131  }
void CreateOnDemandMapping(const std::string &fname, const char *base)
Definition: OnDemand.cxx:123
int lem::HeadsTranspose::HeadIdx ( int  i) const
inline

Definition at line 57 of file Heads.h.

References lem::Heads::fHeadIdxs, and MECModelEnuComparisons::i.

Referenced by lem::FindMatchesTranspose::endRun().

int lem::HeadsTranspose::NHeads ( ) const
inline

Definition at line 56 of file Heads.h.

References lem::Heads::fNHeads.

Referenced by lem::FindMatchesTranspose::endRun().

56 {return fNHeads;}
HeadsTranspose& lem::HeadsTranspose::operator= ( const HeadsTranspose )
protected
int* lem::HeadsTranspose::pHeadSeqs ( ) const
inline

Definition at line 59 of file Heads.h.

Referenced by lem::FindMatchesTranspose::endRun().

59 {return fPSeqs;}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const lem::HeadsTranspose  
)
friend

Definition at line 147 of file Heads.cxx.

148  {
149  os << hs.fNHeads << " heads, for a librar of " << hs.fLibSize << " events.";
150  return os;
151  }

Member Data Documentation

int* lem::HeadsTranspose::fHeadIdxs
protected

Definition at line 68 of file Heads.h.

Referenced by FromMMap(), and FromMMapOnDemand().

int lem::HeadsTranspose::fLibSize
protected

Definition at line 67 of file Heads.h.

Referenced by FromMMap(), FromMMapOnDemand(), and lem::operator<<().

long lem::HeadsTranspose::fMappingSize
protected

Definition at line 71 of file Heads.h.

Referenced by FromMMap(), and FromMMapOnDemand().

int lem::HeadsTranspose::fNHeads
protected

Definition at line 66 of file Heads.h.

Referenced by FromMMap(), FromMMapOnDemand(), and lem::operator<<().

int* lem::HeadsTranspose::fPSeqs
protected

Definition at line 69 of file Heads.h.

Referenced by FromMMap(), and FromMMapOnDemand().


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