PlasCom2  1.0
XPACC Multi-physics simluation application
primitive_utilities.H File Reference

Basic utility header. More...

Detailed Description

Basic utility header.

Definition in file primitive_utilities.H.

#include <iostream>
#include <string>
#include <fstream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <limits>
#include "PrimitiveTypes.H"
Include dependency graph for primitive_utilities.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CmpPairs< T >
 

Namespaces

 ix
 Defines MPI-specific parallel global and program classes.
 
 ix::util
 General support utilities.
 

Typedefs

typedef int Error
 Error type. More...
 

Functions

template<typename Container >
bool LessThan (const Container &c1, const Container &c2)
 
template<typename Container >
void InvertContainer (const Container &c1, Container &c2)
 
template<typename ContainerType >
void DumpContents (std::ostream &Ostr, const ContainerType &c, std::string del="\)
 Dump container contents. More...
 
template<typename BufferDataType >
int PackBuffer (const BufferDataType *sourceBuffer, const std::vector< size_t > &sourceIndices, BufferDataType *targetBuffer, const std::vector< size_t > &targetIndices)
 Pack subset of target buffer from subset of source buffer. More...
 
template<typename ContainerType , typename T >
void CopyIntoContainer (ContainerType &cont, const T *src, size_t count)
 
template<typename OuterCont , typename OutCont , typename InnerCont , typename MapType >
void MapElements (OuterCont &src, OutCont &trg, MapType &m)
 
template<typename ListContainerType , typename ListType >
primitive::IndexType MaxNodeId (const ListContainerType &fc)
 Return the maximum of all elements of a multicontainer. More...
 
template<typename OuterCont , typename InnerCont , typename OutCont >
void Flatten (OuterCont &con, OutCont &ocon)
 Populate OutCont with a flat list of entries from a multicontainer. More...
 
template<typename OuterContType >
primitive::IndexType GetTotalSize (OuterContType &con)
 Return the total number of entries in a multicontainer. More...
 
template<typename OuterContType , typename InnerContType , typename RetCont , typename idxtype >
void MultiContainer2CSR (RetCont &xadj, RetCont &adj, OuterContType &source)
 
template<typename ListContainerType , typename ListType >
void CreateAdjacentNodeList (std::vector< std::list< primitive::IndexType > > &anodelist, ListContainerType &fc, primitive::IndexType nnodes=0)
 Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node with the nodes that are actually adjacent in the lists More...
 
template<typename ListContainerType , typename ListType >
void AdjEList (std::vector< std::list< primitive::IndexType > > &aelist, ListContainerType &dual_con, unsigned long nel=0)
 Given an array of adjacent node lists (like an array of face connectivities), this function will loop thru and create a list of unique adjacent nodes for each node Note that this is a little different from the AdjNodeList because in this version every node in each list is considered adjacent. More...
 
template<typename ConType , typename IConType >
primitive::IndexType NumberOfEdges (ConType &con)
 
template<typename ContainerType , typename Icont >
void FormGraph (const ContainerType &adjlist)
 
template<typename BufferDataType >
void ReportBufferStats (std::ostream &outStream, size_t numValues, const BufferDataType *dataBuffer)
 Reports min/max/mean/stddev for data in buffer. More...
 
template<typename Container >
bool HaveSameOrientation (Container &c1, Container &c2)
 Cyclic test. More...
 
template<typename Container >
bool HaveOppositeOrientation (Container &c1, Container &c2)
 Anti-cyclic test. More...
 
template<class T >
CmpPairs< T > CreateCmpPairs (const std::vector< T > &v)
 
template<class T >
void SortPermutation (const std::vector< T > &values, std::vector< unsigned int > &v)
 
std::string GetNextContent (std::istream &In)
 
void GetContentUntil (std::istream &In, std::string ret, const std::string &etag)
 
int NumLines (const std::string &instr)
 
int String2Buf (const std::string &instr, void **buf)
 
void Trim (std::string &instr, bool preserve_newline=false)
 Creates space delimited tokens in place. More...
 
const std::string Trimmed (const std::string &instr, bool preserve_newline=false)
 Returns space delimited tokens. More...
 
const std::string stripdirs (const std::string &pname)
 Strip absolute path. More...
 
void TokenizeString (std::vector< std::string > &tokens, const std::string &source)
 Tokenize string. More...
 
void TokenizeString (std::vector< std::string > &tokens, const std::string &source, const char delim)
 Tokenize string w/ delimiter. More...
 
template<typename NumType >
void ProcessRange (NumType &t1, NumType &t2, const std::string stinter)
 Process a range in the format "t1:t2". More...
 
int OpenFile (std::ifstream &Inf, const std::string &filename)
 File opener. More...
 
void Vectorize (std::vector< std::string > &retVal, const char **in)
 
void Vectorize (std::vector< std::string > &retVal, const char **in, int n)
 
void RenewStream (std::ostringstream &outStream)
 
void RenewStream (std::istringstream &inStream)