ATLAS Offline Software
Classes | Functions
MultiDimArray.h File Reference
#include <iostream>
#include <sstream>
#include <limits.h>
#include <float.h>
Include dependency graph for MultiDimArray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  MultiDimArray< T, N >
 Multi-dimensional array with a compile-time number of dimensions, and a run-time complete freedom over the size of the dimensions. More...
 
class  MultiDimArrayTypes< T, I >
 General recursive subtyping trait. More...
 
class  MultiDimArrayTypes< T, 0 >
 General recursive subtyping trait. More...
 
class  MultiDimArrayTypes< T, 1 >
 General recursive subtyping trait. More...
 
class  MultiDimArray< T, N >
 Multi-dimensional array with a compile-time number of dimensions, and a run-time complete freedom over the size of the dimensions. More...
 

Functions

template<class T , unsigned int N>
void dump (const MultiDimArray< T, N > &idh, std::ostream &os=std::cout, const std::string &prefix="(")
 
template<class T >
void dump (const MultiDimArray< T, 1 > &idh, std::ostream &os=std::cout, const std::string &prefix="(")
 
template<class T , unsigned int N, class K >
void dumpOneEntry (const MultiDimArray< T, N > &idh, const K &indices, std::ostream &os=std::cout, const std::string &prefix="(")
 
template<class T , class K >
void dumpOneEntry (const MultiDimArray< T, 1 > &idh, const K &indices, std::ostream &os=std::cout, const std::string &prefix="(")
 
template<class T , unsigned int N>
std::ostream & operator<< (std::ostream &os, const MultiDimArray< T, N > &idh)
 

Function Documentation

◆ dump() [1/2]

template<class T >
void dump ( const MultiDimArray< T, 1 > &  idh,
std::ostream &  os = std::cout,
const std::string &  prefix = "(" 
)

Definition at line 370 of file MultiDimArray.h.

371  {
372  int idxMin = idh.minIndex();
373  int idxMax = idh.maxIndex();
374  for ( int idx = idxMin; idx <= idxMax; ++idx ) {
375  os << prefix << idx << "): hash=" << idh[idx] << "\n";
376  }
377 }

◆ dump() [2/2]

template<class T , unsigned int N>
void dump ( const MultiDimArray< T, N > &  idh,
std::ostream &  os = std::cout,
const std::string &  prefix = "(" 
)

Definition at line 358 of file MultiDimArray.h.

359  {
360  int idxMin = idh.minIndex();
361  int idxMax = idh.maxIndex();
362  for ( int idx = idxMin; idx <= idxMax; ++idx ) {
363  std::ostringstream oss;
364  oss << idx << ",";
365  dump( idh[idx], os, prefix + oss.str() );
366  }
367 }

◆ dumpOneEntry() [1/2]

template<class T , class K >
void dumpOneEntry ( const MultiDimArray< T, 1 > &  idh,
const K &  indices,
std::ostream &  os = std::cout,
const std::string &  prefix = "(" 
)

Definition at line 415 of file MultiDimArray.h.

416  {
417  int idx = indices[0];
418  os << prefix << idx << ")=" << idh[idx];
419 }

◆ dumpOneEntry() [2/2]

template<class T , unsigned int N, class K >
void dumpOneEntry ( const MultiDimArray< T, N > &  idh,
const K &  indices,
std::ostream &  os = std::cout,
const std::string &  prefix = "(" 
)

Definition at line 406 of file MultiDimArray.h.

407  {
408  int idx = indices[N-1];
409  std::ostringstream oss;
410  oss << idx << ",";
411  dumpOneEntry( idh[idx], indices, os, prefix + oss.str() );
412 }

◆ operator<<()

template<class T , unsigned int N>
std::ostream& operator<< ( std::ostream &  os,
const MultiDimArray< T, N > &  idh 
)

Definition at line 437 of file MultiDimArray.h.

437  {
438  dump( idh, os );
439  return os;
440 }
MultiDimArray::minIndex
int minIndex() const
Definition: MultiDimArray.h:203
Trk::indices
std::pair< long int, long int > indices
Definition: AlSymMatBase.h:24
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
MultiDimArray::maxIndex
int maxIndex() const
Definition: MultiDimArray.h:208
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
dumpOneEntry
void dumpOneEntry(const MultiDimArray< T, N > &idh, const K &indices, std::ostream &os=std::cout, const std::string &prefix="(")
Definition: MultiDimArray.h:406
dump
void dump(const MultiDimArray< T, N > &idh, std::ostream &os=std::cout, const std::string &prefix="(")
Definition: MultiDimArray.h:358
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69