CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
A namespace for all utility methods. More...
Namespaces | |
hash | |
namespace for hash generation tools | |
math | |
math typedef for matrix coefficients of a single element | |
Data Structures | |
struct | Function |
function caller : abstract base, only contains an variadic operator() More... | |
struct | ResultOfImpl |
Simply to indicate that ResultOfImpl will be a template to be specialized. More... | |
struct | ResultOfImpl< Function< _Res(_Args...)> > |
Used to get the return type of a Function struct. More... | |
struct | ResultOfImpl< _DerivedFn< _Signature > > |
Used to get the return type of a function. More... | |
struct | Function< _Res(_Args...)> |
base Function type for ceps. It's an abstract class which contains only a variadic operator parenthesis. Specialized to signature _Res(_Args...) More... | |
struct | MemberFunction |
Just to say that MemberFunction will be templated. More... | |
struct | MemberFunction< _Class, _Res(_Class::*)(_Args...)> |
A struct that can be used to convert member functions into ceps::Function. More... | |
struct | MemberFunction< _Class *, _Res(_Class::*)(_Args...)> |
A struct that can be used to convert member functions into ceps::Function pointer specialization. More... | |
struct | ConstantFunction |
Specialization of ceps::Function that returns constant values. More... | |
struct | ConstantFunction< _Res(_Args...)> |
Specialization of ceps::Function that returns constant values. More... | |
struct | PiecewiseFunction |
Specialization of ceps::Function with several constant values. More... | |
struct | PiecewiseFunction< _N, _Object, _Res(_Args...)> |
Specialization of ceps::Function with several constant values. More... | |
struct | ResultOfOperationStruct |
struct | ResultOfOperationStruct<'+', _T1, _T2 > |
Gives the type of result of addition. More... | |
struct | ResultOfOperationStruct<'-', _T1, _T2 > |
Gives the type of result of substraction. More... | |
struct | ResultOfOperationStruct<' *', _T1, _T2 > |
Gives the type of result of multiplication. More... | |
struct | ResultOfOperationStruct<'/', _T1, _T2 > |
Gives the type of result of division. More... | |
struct | FunctionOperation |
The product of two functions, a function mult(_Res1,_Res2) must be implemented to be able to deduce the type of the product. More... | |
class | HoldsAttributes |
An abstract class from which all objects that contain region attributes should derive. More... | |
class | HoldsBoundary |
Abstract class to describe if an entity is on a boundary or not Objects that can be located in a mesh should inherit from this class. More... | |
class | HoldsCells |
An abstract class for objects that regroup pointers to cells (eg a mesh, a finite elements discretization, a finite volume discretization) More... | |
class | HoldsDimension |
Abstract class for objects that have a dimensionality (0D to 3D) More... | |
class | HoldsGeomObject |
For objects that have pointers to either a node or a cell. More... | |
class | HoldsGlobalIndex |
Abstract class for objects that have a global index. More... | |
class | HoldsNodes |
class | HoldsProcIds |
Abstract class for objects that contain a CPU Id. More... | |
Typedefs | |
template<class _Fn > | |
using | ResultOf = typename ResultOfImpl< _Fn >::type |
Used to get the return type of a function. More... | |
template<char _Op, typename _T1 , typename _T2 > | |
using | ResultOfOperation = typename ResultOfOperationStruct< _Op, _T1, _T2 >::type |
Shortcut for type of result of operation. More... | |
Functions | |
template<class _Class , class _Res , class... _Args> | |
auto | asFunction (_Class obj, _Res(_Class::*fn)(_Args...)) noexcept |
Transforms a member function of class into a MemberFunction struct. More... | |
template<class _Class , class _Res , class... _Args> | |
auto | asFunction (_Class *obj, _Res(_Class::*fn)(_Args...)) noexcept |
Transforms a member function of class into a MemberFunction struct, version with a pointer to th class. More... | |
template<class _Class , class _Res , class... _Args> | |
auto | newFunction (_Class obj, _Res(_Class::*fn)(_Args...)) noexcept |
Transforms a member function of class into a MemberFunction struct. More... | |
template<class _Class , class _Res , class... _Args> | |
auto | newFunction (_Class *obj, _Res(_Class::*fn)(_Args...)) noexcept |
Transforms a member function of class into a MemberFunction struct, version with a pointer to th class. More... | |
template<class _Res , class... _Args> | |
ConstantFunction< _Res(_Args...)> | asFunction (const _Res &arg) noexcept |
Convert a constant into a ceps function that returns it. More... | |
template<typename T > | |
int | allGatherv (const CepsVector< T > &localTab, int localSize, CepsVector< T > &globalTab, CepsBool masterOnly=false) |
Gather all the local orig vector in the global dest vector. More... | |
int | allGatherv (const std::unordered_map< CepsUInt, CepsUInt > &orig, std::unordered_map< CepsUInt, CepsUInt > &dest) |
gather all the local orig hashtable in the global dest hastable More... | |
template<typename _Key , typename _Val , template< typename, typename > typename _Container> | |
int | broadcastMap (const CepsUInt &sender, _Container< _Key, _Val > &table) |
broadcast map or multimap More... | |
template<typename _Key , typename _Val , template< typename, typename > typename _Container> | |
int | sendMap (const CepsUInt &sender, const CepsUInt &receiver, _Container< _Key, _Val > &table, const CepsUInt &nComms=1, const CepsUInt &commId=1) |
send a map or mutlimap from a cpu to another More... | |
template<typename T > | |
void | sendRecvWithMatrix (const Eigen::Matrix< CepsUInt, Eigen::Dynamic, Eigen::Dynamic > &commMat, CepsVector< CepsVector< T >> &sendBuffers, CepsVector< CepsVector< T >> &recvBuffers) |
Pair to pair communication (using matrix) More... | |
template<typename _Key , typename _Tp , typename _Comp , typename _Alloc > | |
CepsVector< _Key > | keysOf (const CepsMap< _Key, _Tp, _Comp, _Alloc > &m) |
Get the keys of a map as a vector. More... | |
template<typename _Key , typename _Tp , typename _Comp , typename _Alloc > | |
CepsVector< _Tp > | valuesOf (const CepsMap< _Key, _Tp, _Comp, _Alloc > &m) |
Get the values of a map as a vector. More... | |
template<typename _Key , typename _Tp , typename _Hash , typename _Eq , typename _Alloc > | |
CepsVector< _Key > | keysOf (const CepsMultiMap< _Key, _Tp, _Hash, _Eq, _Alloc > &m) |
Get the keys of a map as a vector. More... | |
template<typename _Key , typename _Tp , typename _Hash , typename _Eq , typename _Alloc > | |
CepsVector< _Tp > | valuesOf (const CepsMultiMap< _Key, _Tp, _Hash, _Eq, _Alloc > &m) |
Get the values of a map as a vector. More... | |
template<typename _Key , typename _Tp , typename _Compare , typename _Alloc > | |
void | destroy (CepsMap< _Key, _Tp, _Compare, _Alloc > &map, CepsBool deleteAll=true) |
Deletes all elements of the map properly, even if created with new. More... | |
template<typename _Key , typename _Tp , typename _Key2 > | |
CepsVector< _Tp > | getValues (const CepsMultiMap< _Key, _Tp > &m, const _Key2 &key) |
extract values from multimap More... | |
template<class _Type , class _Alloc > | |
void | destroy (CepsVector< _Type, _Alloc > &vec, CepsBool deleteAll=true) |
Clears the vector with delete if objects were created with new. More... | |
template<class _Type , class _Alloc > | |
CepsBool | contains (const CepsVector< _Type, _Alloc > &vec, const _Type &item) |
Tells if vectors contains a given item. More... | |
template<class _Type , class _Alloc > | |
CepsBool | contains (const CepsVector< _Type, _Alloc > &vec, _Type &&item) |
Tells if vectors contains a given item. More... | |
template<class _Type , class _Alloc , class InputIt > | |
void | pushBack (CepsVector< _Type, _Alloc > &vec, InputIt first, InputIt last) |
Classic push back for several elements. More... | |
template<class _Type , class _Alloc , class InputIt > | |
void | insertIf (CepsVector< _Type, _Alloc > &vec, InputIt first, InputIt last, std::function< CepsBool(const _Type &)> func) |
Conditional insertion of several elements. More... | |
template<class _Type , class _Alloc > | |
void | insert (CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Conditional insertion of several elements. More... | |
template<class _Type , class _Alloc , class InputIt > | |
void | insertUnique (CepsVector< _Type, _Alloc > &vec, InputIt first, InputIt last) |
Set behaviour: insert if elements does not exist in vector. More... | |
template<class _Type , class _Alloc > | |
CepsBool | insertUnique (CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Set behaviour: insert if element does not exist in vector. More... | |
template<class _Type , class _Alloc > | |
CepsBool | insertUnique (CepsVector< _Type, _Alloc > &vec, _Type &&value) |
Set behaviour: insert if element does not exist in vector. More... | |
template<class _Type , class _Alloc > | |
void | eraseValue (CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Removes a value from a vector. More... | |
template<class _Type , class _Alloc , class InputIt > | |
void | eraseValues (CepsVector< _Type, _Alloc > &vec, InputIt first, InputIt last) |
Removes several values from a vector. More... | |
template<class _Type , class _Alloc > | |
CepsVector< _Type, _Alloc >::iterator | find (CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Returns the result of find in the whole vector. More... | |
template<class _Type , class _Alloc > | |
CepsVector< _Type, _Alloc >::const_iterator | find (const CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Returns the result of find in the whole vector. More... | |
template<class _Type , class _Alloc > | |
std::pair< CepsBool, CepsUInt > | indexOf (const CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Returns T/F and an index of the position of element in the vector. More... | |
template<class _Type , class _Alloc > | |
CepsInt | argVector (const CepsVector< _Type, _Alloc > &vec, const _Type &value) |
Get position of element in vector, -1 if not found. More... | |
template<class _Type , class _Alloc > | |
CepsUInt | countWithPredicate (const CepsVector< _Type, _Alloc > &vec, std::function< CepsBool(const _Type &x)> predicate) |
Count the number of elements of a vector that satisfy a condition. More... | |
template<class _Type , class _Alloc > | |
CepsUInt | countWithPredicate (const CepsVector< _Type *, _Alloc > &vec, std::function< CepsBool(_Type *x)> predicate) |
Count the number of elements of a vector that satisfy a condition Specialization for pointers. More... | |
template<class _Type , class _Alloc , typename _Compare > | |
void | sort (CepsVector< _Type, _Alloc > &vec, _Compare compare) |
Sort whole vector with specified comparator. More... | |
template<class _Type , class _Alloc > | |
void | sort (CepsVector< _Type, _Alloc > &vec) |
Basic sorting of whole vector, increasing values. More... | |
template<class _Type , class _Alloc , typename _Compare > | |
CepsVector< CepsUInt > | getSortPermutation (const CepsVector< _Type, _Alloc > &vec, _Compare compare) |
Get the permutation that would be applied to sort the whole vector with specific comparator. More... | |
template<class _Type , class _Alloc > | |
CepsVector< CepsUInt > | getSortPermutation (CepsVector< _Type, _Alloc > &vec) |
Get the permutation that would be applied to sort the whole vector. More... | |
template<class _Type , class _Alloc > | |
void | applyPermutation (CepsVector< _Type, _Alloc > &vec, const CepsVector< CepsUInt > &p) |
Apply a permutation to a vector. More... | |
template<class _Type , class _Alloc > | |
CepsVector< CepsUInt > | getIndicesInVector (const CepsVector< _Type, _Alloc > &origin, const CepsVector< _Type, _Alloc > &target) |
Compute indices of target elements into the origin vector. More... | |
template<class _Type , class _Alloc > | |
void | rightRotate (CepsVector< _Type, _Alloc > &vec, CepsUInt n=1) |
Rotate n times the whole vector to the right. More... | |
template<class _Type , class _Alloc > | |
void | leftRotate (CepsVector< _Type, _Alloc > &vec, CepsUInt n=1) |
Rotate n times the whole vector to the left. More... | |
template<class _Type , class _Alloc > | |
CepsUInt | argmin (CepsVector< _Type, _Alloc > &vec) |
Returns the position of the minimum in a whole vector. More... | |
template<class _Type , class _Alloc , typename _Res > | |
CepsUInt | argmin (CepsVector< _Type, _Alloc > &vec, std::function< _Res(const _Type &)> func) |
Returns the position of the minimum of func(item) in whole vector,. More... | |
template<class _Type , class _Alloc > | |
CepsUInt | argmax (CepsVector< _Type, _Alloc > &vec) |
Returns the position of the maximum in a whole vector. More... | |
template<class _Type , class _Alloc , typename _Res > | |
CepsUInt | argmax (CepsVector< _Type, _Alloc > &vec, std::function< _Res(const _Type &)> func) |
Returns the position of the maximum of func(item) in whole vector,. More... | |
template<class _Type , class _Alloc > | |
const _Type & | min (const CepsVector< _Type, _Alloc > &vec) |
Returns the minimum of the vector, const version. More... | |
template<class _Type , class _Alloc > | |
_Type & | min (CepsVector< _Type, _Alloc > &vec) |
Returns the minimum of the vector. More... | |
template<class _Type , class _Alloc > | |
const _Type & | max (const CepsVector< _Type, _Alloc > &vec) |
Returns the maximum of the vector, const version. More... | |
template<class _Type , class _Alloc > | |
_Type & | max (CepsVector< _Type, _Alloc > &vec) |
Returns the maximum of the vector. More... | |
template<class _Type , class _Alloc > | |
void | cumSum (const CepsVector< _Type, _Alloc > &vec, CepsVector< _Type, _Alloc > &vecOut) |
Cumulated sum of values. More... | |
template<class _Type , class _Alloc > | |
CepsVector< _Type, _Alloc > | cumSum (const CepsVector< _Type, _Alloc > &vec) |
Cumulated sum of values. More... | |
template<typename _Input1 , typename _Input2 > | |
void | setIntersectionIndices (_Input1 first1, _Input1 last1, _Input2 first2, _Input2 last2, CepsVector< CepsUInt > &indices1, CepsVector< CepsUInt > &indices2) |
Returns the indices in two containers of the elements that are present in both containers. More... | |
template<class _Key , class _Value > | |
void | extractValues (const CepsVector< _Key > &keys1, const CepsVector< _Value > &vals1, const CepsVector< _Key > &keys2, CepsVector< _Value > &vals2, _Value defaultValue=_Value()) |
Get the values from vals1, indexed by keys1, following the keys given in keys2. Result put in vals2. If a key from keys2 is not found in keys1, replace with defaultValue. More... | |
template<typename _Type > | |
void | popFront (CepsVector< _Type > &vec) |
Remove first element. More... | |
template<class _Type > | |
void | distribute (const CepsVector< _Type > &vec, CepsVector< CepsVector< _Type >> &vecs, CepsUInt s, CepsBool eqDistrib=true) |
Divides the content of a vector into vectors of size s. Result is put in vecs. If eqDistrib is true, all the resulting subvectors have the same size. More... | |
template<class _Type , class _Res > | |
_Res | applyAlong (const CepsVector< _Type > &vec, std::function< void(const _Type &, _Res &)> f, _Res init=_Res()) |
Applies f(elem,init) to each element of a vector. More... | |
template<typename _Enum > | |
constexpr auto | toIntegral (_Enum e) -> typename std::underlying_type< _Enum >::type |
Converts an enum type variable to an integer. More... | |
std::ofstream & | debugLog () |
Get the DebugLog used in Ceps. More... | |
std::ofstream & | profilingLog () |
Get the ProfilingLog used in Ceps. More... | |
CepsBool | isProfiling () |
Check if we are currently profiling on the master proc (always false on slave procs). More... | |
CepsBool | isVerbose () |
Check if the verbosity is enabled on the master proc (always false on slave procs). More... | |
CepsBool | isWarnings () |
Check if we enable the warnings on the master proc (always false on slave procs). More... | |
CepsBool | isDebug () |
Check if we enable the debug on the master proc (always false on slave procs). More... | |
void | disableAbortOnError () |
Set testing to true. Exceptions do not terminate program. More... | |
void | enableAbortOnError () |
Set testing to false. Exceptions terminate program. More... | |
template<typename _Type > | |
CepsBool | isNullPtr (_Type *ptr) |
Tells if passed pointer is null. More... | |
template<typename _Type > | |
CepsBool | isNullPtr (std::shared_ptr< _Type > ptr) |
Tells if passed pointer is null. More... | |
template<typename _Type > | |
CepsBool | isValidPtr (_Type *ptr) |
Tells if pointer is not null. More... | |
template<typename _Type > | |
CepsBool | isValidPtr (std::shared_ptr< _Type > ptr) |
Tells if pointer is not null. More... | |
template<typename _Type , typename U > | |
CepsBool | isSamePtr (_Type *xptr, U *yptr) |
Tells if two pointers designate the same address. More... | |
template<typename _Type , typename U > | |
CepsBool | isDifferentPtr (_Type *xptr, U *yptr) |
Tells if two pointers designate two different addresses. More... | |
template<typename _Derived , class _Base > | |
_Derived | runtimeCast (_Base x) |
Perform a runtime cast between base type and derived type if we can. More... | |
template<typename _Type > | |
void | destroyObject (_Type &) |
Destroy[delete] any type. More... | |
template<typename _Type > | |
void | destroyObject (_Type *&obj) |
Specialization if is_pointer : Destroy[delete] any type. More... | |
template<typename _Type > | |
void | destroyObject (const _Type *obj) |
Specialization if is_pointer : Destroy[delete] any type. More... | |
template<typename _Type > | |
void | destroyTabular (_Type &) |
Destroy[delete] any type. More... | |
template<typename _Type > | |
void | destroyTabular (_Type *&obj) |
Specialization if is_pointer : Destroy[delete] any type. More... | |
template<typename _Type , typename... _Args> | |
_Type * | getNew (_Args... args) |
Allocates memory for one object. Be careful, the expansion of arguments may produce some weird results when pointers and const references are passed. More... | |
template<typename _Type > | |
_Type * | newArray (long unsigned int n, _Type fill=_Type()) |
Creates a C-array with optional init value. More... | |
template<typename _Type > | |
_Type * | newCopyArray (_Type *src, long unsigned int n) |
Generates a C-style copy of a C-style array. More... | |
CepsUInt | initialize (int argc, char *argv[]) |
Initializes parallel environment. More... | |
void | finalize () |
Finalizes parallel environment. More... | |
void | finalizeWithError () |
Calls MPI_Abort, function used instead of std::terminate() More... | |
CepsUInt | getRank () |
Returns current processor rank. More... | |
CepsUInt | getGridSize () |
Returns the number of process on the computing grid. More... | |
CepsBool | isMaster () |
Is calling process the master ? More... | |
CepsBool | isLast () |
Is calling process last in computing grid ? More... | |
CepsBool | isParallel () |
Is there more than 1 process currently working ? More... | |
void | barrier () |
Explicit barrier: wait for all processors before continuing. More... | |
void | beginSequential () |
Begins a sequential block. More... | |
void | endSequential () |
End a sequential block. More... | |
MPI_Comm | getCommunicator () |
Get the communicator. More... | |
MPI_Comm * | getPtrCommunicator () |
Get pointer to the communicator. More... | |
CepsString | execute (CepsString command, CepsBool withErr=false, CepsBool abortOnErr=false) |
Not really a parallel thing. Calls system() and deals with return code. More... | |
template<typename _Result > | |
_Result | convertReal (CepsReal *data) |
A small utility to convert a vector of reals into the appropriate (scalar,vector,tensor) More... | |
void | checkNanOrInf (CepsReal v, CepsString message="") |
Stops if value is NaN or infty. More... | |
CepsBool | equals (CepsReal a, CepsReal b, CepsReal error=1.0) |
CepsReal equality up to machine precision. More... | |
CepsBool | approxEquals (CepsReal a, CepsReal b, CepsReal epsilon) |
Approximate equality with epsilon tolerance. More... | |
CepsBool | approxEquals (CepsReal *a, CepsReal *b, CepsUInt n, CepsReal epsilon) |
Approximate equality with epsilon tolerance for n floating point numbers. Inequality tested in the linfty norm. More... | |
CepsBool | greaterThan (CepsReal a, CepsReal b, CepsReal epsilon=FLOATING_POINT_EPSILON) |
Greater than comparison with epsilon tolerance. More... | |
CepsBool | lesserThan (CepsReal a, CepsReal b, CepsReal epsilon=FLOATING_POINT_EPSILON) |
Lesser than comparison with epsilon tolerance. More... | |
CepsVector< CepsString > | split (const CepsString &s, const CepsString &delimiters=CepsString(" \t")) |
Splits a string using mulitple delimiters in a single string. More... | |
CepsMap< CepsString, CepsVector< CepsString > > | split (const CepsMap< CepsString, CepsString > &map, const CepsString &delimiters=CepsString(" \t")) |
Apply split function on all string stored. More... | |
CepsVector< CepsVector< CepsString > > | split (const CepsVector< CepsString > &vec, const CepsString &delimiters=CepsString(" \t")) |
Apply split function on all string stored. More... | |
CepsString | join (const CepsVector< CepsString > &vec, const CepsChar &delimeter=' ') |
Join multiple strings into one. More... | |
CepsString | trim (const CepsString &s) |
Removes trailing and preceeding spaces. More... | |
CepsString | removeSpaces (const CepsString &s) |
Removes spaces and tabs. More... | |
CepsString | substract (const CepsString &s, const CepsString &toErase) |
Substract all occurences of another CepsString. More... | |
CepsString | substract (const CepsString &s, const CepsVector< CepsString > &toErase) |
Substract all occurences of different CepsString. More... | |
CepsString | toUpper (const CepsString &s) |
Switches all characters to upper case. More... | |
CepsString | toLower (const CepsString &s) |
Switches all characters to lower case. More... | |
CepsBool | isPathInOneWord (const CepsString &s) |
Checks if given path is in one word (it may not exist yet) More... | |
CepsString | toKey (const CepsString &s) |
Transform to key type a std::string, upper case and no spaces. More... | |
CepsVector< CepsString > | toKey (const CepsVector< CepsString > &vec) |
Transform to key type a vector of std::string, upper case and no spaces. More... | |
void | toKeyInPlace (CepsVector< CepsString > &vec) |
Transform to key type a vector of std::string, upper case and no spaces. More... | |
CepsBool | toBool (const CepsString &s) |
Cast CepsString to CepsBool. More... | |
CepsReal | toReal (const CepsString &s) |
Cast CepsString to CepsReal. More... | |
CepsSet< CepsReal > | toReals (const CepsString &s) |
Cast CepsString to a set of CepsReal. More... | |
CepsMathScalar | toMathScalar (const CepsVector< CepsString > &vec) |
Cast a CepsVector of CepsString to CepsMathScalar same effect as ceps::toReal(vec[0]) More... | |
CepsMathVertex | toMathVertex (const CepsVector< CepsString > &vec) |
Cast a CepsVector of CepsString to CepsMathVertex. More... | |
CepsMathTensor | toMathTensor (const CepsVector< CepsString > &vec) |
Cast a CepsVector of CepsString to CepsMathTensor. More... | |
CepsInt | toInt (const CepsString &s) |
Cast CepsString to CepsInt. More... | |
CepsSet< CepsInt > | toInts (const CepsString &s) |
Cast CepsString to a set of CepsInt. More... | |
CepsUInt | toUInt (const CepsString &s) |
Cast CepsString to CepsUInt. More... | |
CepsSet< CepsUInt > | toUInts (const CepsString &s) |
Cast CepsString to a set of CepsUInt. More... | |
CepsBool | isNumber (const CepsString &s) |
Check if the string contains only digit numbers. More... | |
CepsBool | startsWith (const CepsString &s, const CepsString &comp) |
Check if the string 'str' starts with 'comp'. More... | |
CepsBool | startsWithOneOf (const CepsString &s, const CepsVector< CepsString > &comps) |
Check if the string 'str' starts with one of 'comps'. More... | |
CepsBool | endsWith (const CepsString &s, const CepsString &comp) |
Check if the string 'str' ends with 'comp'. More... | |
CepsBool | endsWithOneOf (const CepsString &s, const CepsVector< CepsString > &comps) |
Check if the string 'str' ends with one of 'comps'. More... | |
CepsMap< CepsString, CepsVector< CepsString > > | splitByKeyword (const CepsString &s, const CepsSet< CepsString > &tags) |
Extract parameters in the CepsString given by tags. Builds a map of keywords and parameter words according to tags. If splitted string s is "FOO 1 2 BAR toto" extractParam(vec,{"FOO","BAR"}) returns {"BAR":"toto","FOO":"1 2"}. More... | |
CepsVector< CepsString > | splitAtNthDelimiter (const CepsString &s, CepsUInt n, CepsString delimiters=CepsString(" \t")) |
Split a string a the n-th delimeter. This ignores the doubled delimiter (eg multiple spaces count as one) More... | |
CepsVector< CepsString > | splitUntilNthDelimiter (const CepsString &s, const CepsUInt &n, CepsString delimiters=CepsString(" \t")) |
Split a string for the first n delimeters. More... | |
CepsString | readParams (const CepsVector< CepsString > &scope, const CepsString &tag, const CepsString &def="", const CepsUInt &pad=1) |
Read parameters into a map. More... | |
CepsString | removeDoubleSlashes (const CepsString &path) |
Replaces double slashes in a string with a single slash. Used for clean paths. More... | |
CepsString | getDir (const CepsString &str) |
Get a substring of s, from beginning of s to the last '/' character. Example: "/home/someone/file.txt" returns "/home/someone/". More... | |
CepsString | getFilename (const CepsString &str) |
Returns a substring corresponding to the string after the last '/' character. Example: "/home/someone/file.txt" returns "file.txt". More... | |
CepsString | getBaseName (const CepsString &str) |
Extracts the base of a file name, without path, nor extension. Ex: getBaseName ("/path/to/myfile.dat") returns myfile Ex: getBaseName ("./path.with.dots//farboo") returns farboo . More... | |
CepsString | getExtension (const CepsString &str) |
Returns the extension of a file, if any. More... | |
CepsString | changeExtension (const CepsString &str, const CepsString &ext) |
Change the extension of a file name (does not check if file exists). More... | |
template<typename _Tp > | |
CepsString | toString (_Tp value) |
Convert a given value to a string (input has to be compatible with std::to_string) More... | |
CepsBool | fileExists (const CepsString &fileName, const CepsString &directory) |
CepsBool | fileExists (const CepsString &fileName) |
CepsBool | isSameFile (const CepsString &f1, const CepsString &f2) |
Tells if given paths refer to the same file. More... | |
CepsVector< CepsString > | cleanup (const CepsVector< CepsString > &vec) |
Clean a vector of string, remove empty and " " string. More... | |
CepsReal | readReal (std::istream &file, const CepsString &errorMessage="") |
Reads a floating point number from an istream, aborts if conversion fails advances the stream by 1 word. More... | |
CepsInt | readInt (std::istream &file, const CepsString &errorMessage="") |
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word. More... | |
CepsReal3D | readVertex (std::istream &file, const CepsString &errorMessage="") |
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word. More... | |
CepsMathTensor | readTensor (std::istream &file, const CepsString &errorMessage="") |
Reads 9 floating point numbers from an istream, aborts if conversion fails advances the stream by 9 words. More... | |
template<CepsUInt n> | |
CepsArray< CepsMathScalar, n > | readReals (std::istream &file, const CepsString &errorMessage="") |
Reads n floating point numbers from an istream, aborts if conversion fails. More... | |
void | linearRegression (std::vector< CepsReal > &xs, std::vector< CepsReal > &fs, CepsReal &a, CepsReal &b) |
Performs a linear regression with least squares, put results in a and b coefficients. More... | |
template<typename _Result > | |
CepsEnum | getFlagsOf (ArraySAFunc< _Result > *f) |
get functor options More... | |
CepsEnum | getFlagsOf (FileInterpolatorSAFunc *f) |
get functor options More... | |
template<typename _Result > | |
CepsEnum | getFlagsOf (CoeffInterpolatorSAFunc< _Result > *f) |
get functor options More... | |
template<typename _Result > | |
CepsEnum | getFlagsOf (CstPiecewiseSAFunc< _Result > *f) |
get functor options More... | |
template<typename _Result > | |
CepsEnum | getFlagsOf (FctPiecewiseSAFunc< _Result > *f) |
get functor options More... | |
template<typename _Fn > | |
CepsEnum | getFlagsOf (_Fn f) |
Tell that this function is template, nothing more. More... | |
template<typename _Result > | |
CepsEnum | getFlagsOf (Function< _Result(CepsStandardArgs)> *f) |
Get flags of dereferenced object ptr. More... | |
CepsEnum | getFlagsOf (SolVecSAFunc *f) |
get functor options More... | |
A namespace for all utility methods.
Mathematical utilities and stimulation functions.
using ceps::ResultOf = typedef typename ResultOfImpl<_Fn>::type |
Used to get the return type of a function.
Definition at line 79 of file CepsFunction.hpp.
using ceps::ResultOfOperation = typedef typename ResultOfOperationStruct<_Op, _T1, _T2>::type |
Shortcut for type of result of operation.
Definition at line 359 of file CepsFunction.hpp.
int ceps::allGatherv | ( | const CepsVector< T > & | localTab, |
int | localSize, | ||
CepsVector< T > & | globalTab, | ||
CepsBool | masterOnly = false |
||
) |
Gather all the local orig vector in the global dest vector.
[in] | localTab | local vector to put in the global vector |
[in] | localSize | number of local elements we want to put in the global Tab |
[out] | globalTab | global output vector gather all the local vectors |
[in] | masterOnly | use MPI_Gatherv to root, instead of AllgatherV |
Definition at line 114 of file CepsContainerCommunication.hpp.
int ceps::allGatherv | ( | const std::unordered_map< CepsUInt, CepsUInt > & | orig, |
std::unordered_map< CepsUInt, CepsUInt > & | dest | ||
) |
gather all the local orig hashtable in the global dest hastable
[in] | orig | local hashtable |
[out] | dest | global hastable |
Definition at line 35 of file CepsContainerCommunication.cpp.
_Res ceps::applyAlong | ( | const CepsVector< _Type > & | vec, |
std::function< void(const _Type &, _Res &)> | f, | ||
_Res | init = _Res () |
||
) |
Applies f(elem,init) to each element of a vector.
Definition at line 638 of file CepsVector.hpp.
void ceps::applyPermutation | ( | CepsVector< _Type, _Alloc > & | vec, |
const CepsVector< CepsUInt > & | p | ||
) |
Apply a permutation to a vector.
Definition at line 278 of file CepsVector.hpp.
Approximate equality with epsilon tolerance for n floating point numbers. Inequality tested in the linfty norm.
a | CepsReal to compare |
b | CepsReal to compare |
n | number of reals to compare |
epsilon | additional error factor |
Definition at line 82 of file Precision.hpp.
Approximate equality with epsilon tolerance.
a | CepsReal to compare |
b | CepsReal to compare |
epsilon | additional error factor |
Definition at line 67 of file Precision.hpp.
CepsUInt ceps::argmax | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Returns the position of the maximum in a whole vector.
Definition at line 402 of file CepsVector.hpp.
CepsUInt ceps::argmax | ( | CepsVector< _Type, _Alloc > & | vec, |
std::function< _Res(const _Type &)> | func | ||
) |
Returns the position of the maximum of func(item) in whole vector,.
Definition at line 422 of file CepsVector.hpp.
CepsUInt ceps::argmin | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Returns the position of the minimum in a whole vector.
Definition at line 356 of file CepsVector.hpp.
CepsUInt ceps::argmin | ( | CepsVector< _Type, _Alloc > & | vec, |
std::function< _Res(const _Type &)> | func | ||
) |
Returns the position of the minimum of func(item) in whole vector,.
Definition at line 376 of file CepsVector.hpp.
CepsInt ceps::argVector | ( | const CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Get position of element in vector, -1 if not found.
Definition at line 200 of file CepsVector.hpp.
|
inlinenoexcept |
Transforms a member function of class into a MemberFunction struct, version with a pointer to th class.
Definition at line 219 of file CepsFunction.hpp.
|
inlinenoexcept |
Transforms a member function of class into a MemberFunction struct.
Definition at line 210 of file CepsFunction.hpp.
|
inlinenoexcept |
Convert a constant into a ceps function that returns it.
Definition at line 279 of file CepsFunction.hpp.
void ceps::barrier | ( | ) |
Explicit barrier: wait for all processors before continuing.
Definition at line 198 of file CepsParallelTools.cpp.
void ceps::beginSequential | ( | ) |
Begins a sequential block.
All the instructions between the beginning and the end of a sequential block will be run by each process one after the other. The hand is given to process 0, then process 1 etc. Users should be careful when using beginSequential and endSequential: every call to beginSequential must be coupled with a call to endSequential. Invalid use of these methods will create deadlocks.
Definition at line 208 of file CepsParallelTools.cpp.
int ceps::broadcastMap | ( | const CepsUInt & | sender, |
_Container< _Key, _Val > & | table | ||
) |
broadcast map or multimap
[in] | sender | rank of sender cpu |
[in] | table | hashtable to share |
Definition at line 154 of file CepsContainerCommunication.hpp.
CepsString ceps::changeExtension | ( | const CepsString & | str, |
const CepsString & | ext | ||
) |
Change the extension of a file name (does not check if file exists).
str | the CepsString to consider |
ext | extension to replace with |
Definition at line 588 of file CepsString.cpp.
void ceps::checkNanOrInf | ( | CepsReal | v, |
CepsString | message = "" |
||
) |
Stops if value is NaN or infty.
Definition at line 61 of file CepsTypeTools.cpp.
CepsVector< CepsString > ceps::cleanup | ( | const CepsVector< CepsString > & | vec | ) |
Clean a vector of string, remove empty and " " string.
vec | the vector of string to clean |
Definition at line 647 of file CepsString.cpp.
CepsBool ceps::contains | ( | const CepsVector< _Type, _Alloc > & | vec, |
_Type && | item | ||
) |
Tells if vectors contains a given item.
Definition at line 65 of file CepsVector.hpp.
CepsBool ceps::contains | ( | const CepsVector< _Type, _Alloc > & | vec, |
const _Type & | item | ||
) |
Tells if vectors contains a given item.
Definition at line 56 of file CepsVector.hpp.
_Result ceps::convertReal | ( | CepsReal * | data | ) |
A small utility to convert a vector of reals into the appropriate (scalar,vector,tensor)
CepsUInt ceps::countWithPredicate | ( | const CepsVector< _Type *, _Alloc > & | vec, |
std::function< CepsBool(_Type *x)> | predicate | ||
) |
Count the number of elements of a vector that satisfy a condition Specialization for pointers.
Definition at line 223 of file CepsVector.hpp.
CepsUInt ceps::countWithPredicate | ( | const CepsVector< _Type, _Alloc > & | vec, |
std::function< CepsBool(const _Type &x)> | predicate | ||
) |
Count the number of elements of a vector that satisfy a condition.
Definition at line 211 of file CepsVector.hpp.
CepsVector<_Type,_Alloc> ceps::cumSum | ( | const CepsVector< _Type, _Alloc > & | vec | ) |
Cumulated sum of values.
for a given vector computes a vector of size such that
Definition at line 503 of file CepsVector.hpp.
void ceps::cumSum | ( | const CepsVector< _Type, _Alloc > & | vec, |
CepsVector< _Type, _Alloc > & | vecOut | ||
) |
Cumulated sum of values.
for a given vector computes a vector of size such that
[out] | vec | to sum |
[out] | vecOut | cumulated sums |
Definition at line 487 of file CepsVector.hpp.
std::ofstream & ceps::debugLog | ( | ) |
void ceps::destroy | ( | CepsMap< _Key, _Tp, _Compare, _Alloc > & | map, |
CepsBool | deleteAll = true |
||
) |
Deletes all elements of the map properly, even if created with new.
Definition at line 93 of file CepsMap.hpp.
void ceps::destroy | ( | CepsVector< _Type, _Alloc > & | vec, |
CepsBool | deleteAll = true |
||
) |
Clears the vector with delete if objects were created with new.
Definition at line 45 of file CepsVector.hpp.
void ceps::destroyObject | ( | _Type & | ) |
Destroy[delete] any type.
Definition at line 116 of file CepsMemory.hpp.
void ceps::destroyObject | ( | _Type *& | obj | ) |
Specialization if is_pointer : Destroy[delete] any type.
Definition at line 124 of file CepsMemory.hpp.
void ceps::destroyObject | ( | const _Type * | obj | ) |
Specialization if is_pointer : Destroy[delete] any type.
Definition at line 137 of file CepsMemory.hpp.
void ceps::destroyTabular | ( | _Type & | ) |
Destroy[delete] any type.
Definition at line 149 of file CepsMemory.hpp.
void ceps::destroyTabular | ( | _Type *& | obj | ) |
Specialization if is_pointer : Destroy[delete] any type.
Definition at line 158 of file CepsMemory.hpp.
void ceps::disableAbortOnError | ( | ) |
Set testing to true. Exceptions do not terminate program.
Definition at line 285 of file CepsFlags.cpp.
void ceps::distribute | ( | const CepsVector< _Type > & | vec, |
CepsVector< CepsVector< _Type >> & | vecs, | ||
CepsUInt | s, | ||
CepsBool | eqDistrib = true |
||
) |
Divides the content of a vector into vectors of size s. Result is put in vecs. If eqDistrib is true, all the resulting subvectors have the same size.
Definition at line 605 of file CepsVector.hpp.
void ceps::enableAbortOnError | ( | ) |
Set testing to false. Exceptions terminate program.
Definition at line 291 of file CepsFlags.cpp.
void ceps::endSequential | ( | ) |
End a sequential block.
All the instructions between the beginning and the end of a sequential block will be run by each process one after the other. The hand is given to process 0, then process 1 etc.
Definition at line 224 of file CepsParallelTools.cpp.
CepsBool ceps::endsWith | ( | const CepsString & | s, |
const CepsString & | comp | ||
) |
Check if the string 'str' ends with 'comp'.
Definition at line 363 of file CepsString.cpp.
CepsBool ceps::endsWithOneOf | ( | const CepsString & | s, |
const CepsVector< CepsString > & | comps | ||
) |
Check if the string 'str' ends with one of 'comps'.
Definition at line 374 of file CepsString.cpp.
CepsReal equality up to machine precision.
Equality with tolerance based on numerical limit of CepsReal precision (single or double), and an error factor that can arise from iterative computation. Not really fast, but reliable for what we intend to compute.
a | CepsReal to compare |
b | CepsReal to compare |
error | additional error factor |
Definition at line 54 of file Precision.hpp.
void ceps::eraseValue | ( | CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Removes a value from a vector.
Definition at line 151 of file CepsVector.hpp.
void ceps::eraseValues | ( | CepsVector< _Type, _Alloc > & | vec, |
InputIt | first, | ||
InputIt | last | ||
) |
Removes several values from a vector.
Definition at line 160 of file CepsVector.hpp.
CepsString ceps::execute | ( | CepsString | command, |
CepsBool | withErr = false , |
||
CepsBool | abortOnErr = false |
||
) |
Not really a parallel thing. Calls system() and deals with return code.
withErr | adds the stderr to the stdoutput. Command will be appended with 2&>1 |
abortOnErr | stops CEPS if command fails |
Definition at line 256 of file CepsParallelTools.cpp.
void ceps::extractValues | ( | const CepsVector< _Key > & | keys1, |
const CepsVector< _Value > & | vals1, | ||
const CepsVector< _Key > & | keys2, | ||
CepsVector< _Value > & | vals2, | ||
_Value | defaultValue = _Value () |
||
) |
Get the values from vals1, indexed by keys1, following the keys given in keys2. Result put in vals2. If a key from keys2 is not found in keys1, replace with defaultValue.
Definition at line 557 of file CepsVector.hpp.
CepsBool ceps::fileExists | ( | const CepsString & | fileName | ) |
Returns true if the given file. File is searched in getDir(fileName)
[in] | fileName | the file |
Definition at line 631 of file CepsString.cpp.
CepsBool ceps::fileExists | ( | const CepsString & | fileName, |
const CepsString & | directory | ||
) |
Returns true if the given file is in the specified directory
[in] | fileName | the file |
[in] | directory | absolute path to the directory |
Definition at line 595 of file CepsString.cpp.
void ceps::finalize | ( | ) |
Finalizes parallel environment.
As with ceps::initialize(), implementation differs whether PETSc is used or not.
Definition at line 106 of file CepsParallelTools.cpp.
void ceps::finalizeWithError | ( | ) |
Calls MPI_Abort, function used instead of std::terminate()
Definition at line 124 of file CepsParallelTools.cpp.
CepsVector<_Type,_Alloc>::iterator ceps::find | ( | CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Returns the result of find in the whole vector.
Definition at line 173 of file CepsVector.hpp.
CepsVector<_Type,_Alloc>::const_iterator ceps::find | ( | const CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Returns the result of find in the whole vector.
Definition at line 181 of file CepsVector.hpp.
CepsString ceps::getBaseName | ( | const CepsString & | str | ) |
Extracts the base of a file name, without path, nor extension. Ex: getBaseName
("/path/to/myfile.dat") returns myfile
Ex: getBaseName
("./path.with.dots//farboo") returns farboo
.
str | the CepsString to consider |
Definition at line 563 of file CepsString.cpp.
MPI_Comm ceps::getCommunicator | ( | ) |
Get the communicator.
Definition at line 240 of file CepsParallelTools.cpp.
CepsString ceps::getDir | ( | const CepsString & | str | ) |
Get a substring of s, from beginning of s to the last '/' character. Example: "/home/someone/file.txt" returns "/home/someone/".
str | the CepsString to consider |
Definition at line 521 of file CepsString.cpp.
CepsString ceps::getExtension | ( | const CepsString & | str | ) |
Returns the extension of a file, if any.
str | the CepsString to consider |
Definition at line 580 of file CepsString.cpp.
CepsString ceps::getFilename | ( | const CepsString & | str | ) |
Returns a substring corresponding to the string after the last '/' character. Example: "/home/someone/file.txt" returns "file.txt".
str | the CepsString to consider |
Definition at line 556 of file CepsString.cpp.
CepsEnum ceps::getFlagsOf | ( | _Fn | f | ) |
Tell that this function is template, nothing more.
CepsEnum ceps::getFlagsOf | ( | ArraySAFunc< _Result > * | f | ) |
get functor options
CepsEnum ceps::getFlagsOf | ( | CoeffInterpolatorSAFunc< _Result > * | f | ) |
get functor options
CepsEnum ceps::getFlagsOf | ( | CstPiecewiseSAFunc< _Result > * | f | ) |
get functor options
CepsEnum ceps::getFlagsOf | ( | FctPiecewiseSAFunc< _Result > * | f | ) |
get functor options
CepsEnum ceps::getFlagsOf | ( | FileInterpolatorSAFunc * | f | ) |
get functor options
Definition at line 150 of file FileInterpolatorSAFunc.cpp.
CepsEnum ceps::getFlagsOf | ( | Function< _Result(CepsStandardArgs)> * | f | ) |
Get flags of dereferenced object ptr.
CepsEnum ceps::getFlagsOf | ( | SolVecSAFunc * | f | ) |
get functor options
Definition at line 58 of file SolVecSAFunc.cpp.
CepsUInt ceps::getGridSize | ( | ) |
Returns the number of process on the computing grid.
Definition at line 167 of file CepsParallelTools.cpp.
CepsVector<CepsUInt> ceps::getIndicesInVector | ( | const CepsVector< _Type, _Alloc > & | origin, |
const CepsVector< _Type, _Alloc > & | target | ||
) |
Compute indices of target elements into the origin vector.
Definition at line 303 of file CepsVector.hpp.
_Type* ceps::getNew | ( | _Args... | args | ) |
Allocates memory for one object. Be careful, the expansion of arguments may produce some weird results when pointers and const references are passed.
Definition at line 170 of file CepsMemory.hpp.
MPI_Comm * ceps::getPtrCommunicator | ( | ) |
Get pointer to the communicator.
Definition at line 246 of file CepsParallelTools.cpp.
CepsUInt ceps::getRank | ( | ) |
Returns current processor rank.
Definition at line 155 of file CepsParallelTools.cpp.
CepsVector<CepsUInt> ceps::getSortPermutation | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Get the permutation that would be applied to sort the whole vector.
Definition at line 270 of file CepsVector.hpp.
CepsVector<CepsUInt> ceps::getSortPermutation | ( | const CepsVector< _Type, _Alloc > & | vec, |
_Compare | compare | ||
) |
Get the permutation that would be applied to sort the whole vector with specific comparator.
Definition at line 254 of file CepsVector.hpp.
CepsVector<_Tp> ceps::getValues | ( | const CepsMultiMap< _Key, _Tp > & | m, |
const _Key2 & | key | ||
) |
extract values from multimap
Definition at line 106 of file CepsMap.hpp.
|
inline |
Greater than comparison with epsilon tolerance.
a | CepsReal to compare |
b | CepsReal to compare |
epsilon | maximum tolerance admitted |
Definition at line 98 of file Precision.hpp.
std::pair<CepsBool, CepsUInt> ceps::indexOf | ( | const CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Returns T/F and an index of the position of element in the vector.
Definition at line 189 of file CepsVector.hpp.
CepsUInt ceps::initialize | ( | int | argc, |
char * | argv[] | ||
) |
Initializes parallel environment.
If PETSc is used then the PETSc method PetscTools::PetscInitialize(...) is used. Else, use default MPI initialization method. Also parses command line arguments.
[in] | argc | number of arguments |
[in] | argv | program arguments |
Definition at line 44 of file CepsParallelTools.cpp.
void ceps::insert | ( | CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Conditional insertion of several elements.
Definition at line 105 of file CepsVector.hpp.
void ceps::insertIf | ( | CepsVector< _Type, _Alloc > & | vec, |
InputIt | first, | ||
InputIt | last, | ||
std::function< CepsBool(const _Type &)> | func | ||
) |
Conditional insertion of several elements.
Definition at line 85 of file CepsVector.hpp.
CepsBool ceps::insertUnique | ( | CepsVector< _Type, _Alloc > & | vec, |
_Type && | value | ||
) |
Set behaviour: insert if element does not exist in vector.
Definition at line 140 of file CepsVector.hpp.
CepsBool ceps::insertUnique | ( | CepsVector< _Type, _Alloc > & | vec, |
const _Type & | value | ||
) |
Set behaviour: insert if element does not exist in vector.
Definition at line 129 of file CepsVector.hpp.
void ceps::insertUnique | ( | CepsVector< _Type, _Alloc > & | vec, |
InputIt | first, | ||
InputIt | last | ||
) |
Set behaviour: insert if elements does not exist in vector.
Definition at line 114 of file CepsVector.hpp.
CepsBool ceps::isDebug | ( | ) |
Check if we enable the debug on the master proc (always false on slave procs).
Definition at line 275 of file CepsFlags.cpp.
CepsBool ceps::isDifferentPtr | ( | _Type * | xptr, |
U * | yptr | ||
) |
Tells if two pointers designate two different addresses.
Definition at line 86 of file CepsMemory.hpp.
CepsBool ceps::isLast | ( | ) |
Is calling process last in computing grid ?
Definition at line 185 of file CepsParallelTools.cpp.
CepsBool ceps::isMaster | ( | ) |
Is calling process the master ?
Definition at line 179 of file CepsParallelTools.cpp.
CepsBool ceps::isNullPtr | ( | _Type * | ptr | ) |
Tells if passed pointer is null.
Definition at line 45 of file CepsMemory.hpp.
CepsBool ceps::isNullPtr | ( | std::shared_ptr< _Type > | ptr | ) |
Tells if passed pointer is null.
Definition at line 53 of file CepsMemory.hpp.
CepsBool ceps::isNumber | ( | const CepsString & | s | ) |
Check if the string contains only digit numbers.
s |
Definition at line 322 of file CepsString.cpp.
CepsBool ceps::isParallel | ( | ) |
Is there more than 1 process currently working ?
Definition at line 191 of file CepsParallelTools.cpp.
CepsBool ceps::isPathInOneWord | ( | const CepsString & | s | ) |
Checks if given path is in one word (it may not exist yet)
Definition at line 144 of file CepsString.cpp.
CepsBool ceps::isProfiling | ( | ) |
Check if we are currently profiling on the master proc (always false on slave procs).
Definition at line 257 of file CepsFlags.cpp.
CepsBool ceps::isSameFile | ( | const CepsString & | f1, |
const CepsString & | f2 | ||
) |
Tells if given paths refer to the same file.
f1 | |
f2 |
Definition at line 637 of file CepsString.cpp.
CepsBool ceps::isSamePtr | ( | _Type * | xptr, |
U * | yptr | ||
) |
Tells if two pointers designate the same address.
Definition at line 78 of file CepsMemory.hpp.
CepsBool ceps::isValidPtr | ( | _Type * | ptr | ) |
Tells if pointer is not null.
Definition at line 61 of file CepsMemory.hpp.
CepsBool ceps::isValidPtr | ( | std::shared_ptr< _Type > | ptr | ) |
Tells if pointer is not null.
Definition at line 70 of file CepsMemory.hpp.
CepsBool ceps::isVerbose | ( | ) |
Check if the verbosity is enabled on the master proc (always false on slave procs).
Definition at line 263 of file CepsFlags.cpp.
CepsBool ceps::isWarnings | ( | ) |
Check if we enable the warnings on the master proc (always false on slave procs).
Definition at line 269 of file CepsFlags.cpp.
CepsString ceps::join | ( | const CepsVector< CepsString > & | vec, |
const CepsChar & | delimeter = ' ' |
||
) |
Join multiple strings into one.
vec | the vector of strings |
delimeter | delimiter to use |
Definition at line 63 of file CepsString.cpp.
CepsVector<_Key> ceps::keysOf | ( | const CepsMap< _Key, _Tp, _Comp, _Alloc > & | m | ) |
Get the keys of a map as a vector.
Definition at line 45 of file CepsMap.hpp.
CepsVector<_Key> ceps::keysOf | ( | const CepsMultiMap< _Key, _Tp, _Hash, _Eq, _Alloc > & | m | ) |
Get the keys of a map as a vector.
Definition at line 69 of file CepsMap.hpp.
void ceps::leftRotate | ( | CepsVector< _Type, _Alloc > & | vec, |
CepsUInt | n = 1 |
||
) |
Rotate n times the whole vector to the left.
Definition at line 338 of file CepsVector.hpp.
|
inline |
Lesser than comparison with epsilon tolerance.
a | CepsReal to compare |
b | CepsReal to compare |
epsilon | maximum tolerance admitted |
Definition at line 111 of file Precision.hpp.
void ceps::linearRegression | ( | std::vector< CepsReal > & | xs, |
std::vector< CepsReal > & | fs, | ||
CepsReal & | a, | ||
CepsReal & | b | ||
) |
Performs a linear regression with least squares, put results in a and b coefficients.
xs | samples positions |
fs | samples values |
a | result slope |
b | result vertical shift |
Definition at line 34 of file LeastSquares.cpp.
_Type& ceps::max | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Returns the maximum of the vector.
Definition at line 472 of file CepsVector.hpp.
const _Type& ceps::max | ( | const CepsVector< _Type, _Alloc > & | vec | ) |
Returns the maximum of the vector, const version.
Definition at line 464 of file CepsVector.hpp.
_Type& ceps::min | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Returns the minimum of the vector.
Definition at line 456 of file CepsVector.hpp.
const _Type& ceps::min | ( | const CepsVector< _Type, _Alloc > & | vec | ) |
Returns the minimum of the vector, const version.
Definition at line 448 of file CepsVector.hpp.
_Type* ceps::newArray | ( | long unsigned int | n, |
_Type | fill = _Type() |
||
) |
Creates a C-array with optional init value.
Definition at line 183 of file CepsMemory.hpp.
_Type* ceps::newCopyArray | ( | _Type * | src, |
long unsigned int | n | ||
) |
Generates a C-style copy of a C-style array.
Definition at line 197 of file CepsMemory.hpp.
|
inlinenoexcept |
Transforms a member function of class into a MemberFunction struct, version with a pointer to th class.
Definition at line 236 of file CepsFunction.hpp.
|
inlinenoexcept |
Transforms a member function of class into a MemberFunction struct.
Definition at line 227 of file CepsFunction.hpp.
void ceps::popFront | ( | CepsVector< _Type > & | vec | ) |
Remove first element.
Definition at line 592 of file CepsVector.hpp.
std::ofstream & ceps::profilingLog | ( | ) |
Get the ProfilingLog used in Ceps.
Definition at line 251 of file CepsFlags.cpp.
void ceps::pushBack | ( | CepsVector< _Type, _Alloc > & | vec, |
InputIt | first, | ||
InputIt | last | ||
) |
Classic push back for several elements.
Definition at line 74 of file CepsVector.hpp.
CepsInt ceps::readInt | ( | std::istream & | file, |
const CepsString & | errorMessage = "" |
||
) |
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word.
Definition at line 677 of file CepsString.cpp.
CepsString ceps::readParams | ( | const CepsVector< CepsString > & | scope, |
const CepsString & | tag, | ||
const CepsString & | def = "" , |
||
const CepsUInt & | pad = 1 |
||
) |
Read parameters into a map.
scope | scope key |
tag | tag key |
def | default value |
pad | pad into argument |
Definition at line 496 of file CepsString.cpp.
CepsReal ceps::readReal | ( | std::istream & | file, |
const CepsString & | errorMessage = "" |
||
) |
Reads a floating point number from an istream, aborts if conversion fails advances the stream by 1 word.
Definition at line 661 of file CepsString.cpp.
CepsArray< CepsMathScalar, n > ceps::readReals | ( | std::istream & | file, |
const CepsString & | errorMessage = "" |
||
) |
Reads n floating point numbers from an istream, aborts if conversion fails.
Definition at line 481 of file CepsString.hpp.
CepsMathTensor ceps::readTensor | ( | std::istream & | file, |
const CepsString & | errorMessage = "" |
||
) |
Reads 9 floating point numbers from an istream, aborts if conversion fails advances the stream by 9 words.
Definition at line 704 of file CepsString.cpp.
CepsReal3D ceps::readVertex | ( | std::istream & | file, |
const CepsString & | errorMessage = "" |
||
) |
Reads an integral number from an istream, aborts if conversion fails advances the stream by 1 word.
Definition at line 693 of file CepsString.cpp.
CepsString ceps::removeDoubleSlashes | ( | const CepsString & | path | ) |
Replaces double slashes in a string with a single slash. Used for clean paths.
Definition at line 510 of file CepsString.cpp.
CepsString ceps::removeSpaces | ( | const CepsString & | s | ) |
void ceps::rightRotate | ( | CepsVector< _Type, _Alloc > & | vec, |
CepsUInt | n = 1 |
||
) |
Rotate n times the whole vector to the right.
Definition at line 329 of file CepsVector.hpp.
_Derived ceps::runtimeCast | ( | _Base | x | ) |
Perform a runtime cast between base type and derived type if we can.
Definition at line 94 of file CepsMemory.hpp.
int ceps::sendMap | ( | const CepsUInt & | sender, |
const CepsUInt & | receiver, | ||
_Container< _Key, _Val > & | table, | ||
const CepsUInt & | nComms = 1 , |
||
const CepsUInt & | commId = 1 |
||
) |
send a map or mutlimap from a cpu to another
[in] | sender | rank of sender cpu |
[in] | receiver | rank of sender cpu |
[in] | table | hashtable to share |
[in] | nComms | expected number of simultaneous calls to this function, used to define tag |
[in] | commId | Id-th/nComms communication |
Definition at line 185 of file CepsContainerCommunication.hpp.
void ceps::sendRecvWithMatrix | ( | const Eigen::Matrix< CepsUInt, Eigen::Dynamic, Eigen::Dynamic > & | commMat, |
CepsVector< CepsVector< T >> & | sendBuffers, | ||
CepsVector< CepsVector< T >> & | recvBuffers | ||
) |
Pair to pair communication (using matrix)
[in] | commMat | commMat(i,j) indicate the size of the vector to send from process i to process j |
[in] | sendBuffers | vector of vector of buffers to send |
[out] | recvBuffers | vector of vector FIXME find the size limit of communications. ~5M uint_ts on mac OS CI machine |
Definition at line 243 of file CepsContainerCommunication.hpp.
void ceps::setIntersectionIndices | ( | _Input1 | first1, |
_Input1 | last1, | ||
_Input2 | first2, | ||
_Input2 | last2, | ||
CepsVector< CepsUInt > & | indices1, | ||
CepsVector< CepsUInt > & | indices2 | ||
) |
Returns the indices in two containers of the elements that are present in both containers.
_Input1 | iterators of a vector, set, etc |
_Input2 | iterators of a vector, set, etc |
first1 | where to begin in container 1 |
last1 | where to end in container 1 |
first2 | where to begin in container 2 |
last2 | where to end in container 2 |
indices1 | indices of common elements in container 1 |
indices2 | indices of common elements in container 2 |
Definition at line 522 of file CepsVector.hpp.
void ceps::sort | ( | CepsVector< _Type, _Alloc > & | vec | ) |
Basic sorting of whole vector, increasing values.
Definition at line 243 of file CepsVector.hpp.
void ceps::sort | ( | CepsVector< _Type, _Alloc > & | vec, |
_Compare | compare | ||
) |
Sort whole vector with specified comparator.
Definition at line 234 of file CepsVector.hpp.
CepsMap< CepsString, CepsVector< CepsString > > ceps::split | ( | const CepsMap< CepsString, CepsString > & | map, |
const CepsString & | delimiters = CepsString (" \t") |
||
) |
Apply split function on all string stored.
Definition at line 44 of file CepsString.cpp.
CepsVector< CepsString > ceps::split | ( | const CepsString & | s, |
const CepsString & | delimiters = CepsString (" \t") |
||
) |
Splits a string using mulitple delimiters in a single string.
Warning: this does not consider the whole argument as being a separator, but each of its character to act as one. Each created substring will be trimmed from white spaces. Beginning and trailing empty fields are still added to the result vector. Example: split
(" ,: far ,,boo:,",",:") will return the vector with strings ""
,"","far","","boo","",""
s | string to parse |
delimiters | delimiters to use |
Definition at line 38 of file CepsString.cpp.
CepsVector< CepsVector< CepsString > > ceps::split | ( | const CepsVector< CepsString > & | vec, |
const CepsString & | delimiters = CepsString (" \t") |
||
) |
Apply split function on all string stored.
Definition at line 53 of file CepsString.cpp.
CepsVector< CepsString > ceps::splitAtNthDelimiter | ( | const CepsString & | s, |
CepsUInt | n, | ||
CepsString | delimiters = CepsString (" \t") |
||
) |
Split a string a the n-th delimeter. This ignores the doubled delimiter (eg multiple spaces count as one)
s | the considered string |
n | where to split |
delimiters | all delimeters |
Definition at line 419 of file CepsString.cpp.
CepsMap< CepsString, CepsVector< CepsString > > ceps::splitByKeyword | ( | const CepsString & | s, |
const CepsSet< CepsString > & | tags | ||
) |
Extract parameters in the CepsString given by tags. Builds a map of keywords and parameter words according to tags. If splitted string s is "FOO 1 2 BAR toto" extractParam(vec,{"FOO","BAR"}) returns {"BAR":"toto","FOO":"1 2"}.
s | string to parse |
tags | keywords |
Definition at line 384 of file CepsString.cpp.
CepsVector< CepsString > ceps::splitUntilNthDelimiter | ( | const CepsString & | s, |
const CepsUInt & | n, | ||
CepsString | delimiters = CepsString (" \t") |
||
) |
Split a string for the first n delimeters.
s | the considered string |
n | split action count |
delimiters | all delimeters |
Definition at line 441 of file CepsString.cpp.
CepsBool ceps::startsWith | ( | const CepsString & | s, |
const CepsString & | comp | ||
) |
Check if the string 'str' starts with 'comp'.
s | string to parse |
comp | start string |
Definition at line 342 of file CepsString.cpp.
CepsBool ceps::startsWithOneOf | ( | const CepsString & | s, |
const CepsVector< CepsString > & | comps | ||
) |
Check if the string 'str' starts with one of 'comps'.
s | string to parse |
comps | start strings |
Definition at line 353 of file CepsString.cpp.
CepsString ceps::substract | ( | const CepsString & | s, |
const CepsString & | toErase | ||
) |
Substract all occurences of another CepsString.
s | base string considered |
toErase | string to erase |
Definition at line 95 of file CepsString.cpp.
CepsString ceps::substract | ( | const CepsString & | s, |
const CepsVector< CepsString > & | toErase | ||
) |
Substract all occurences of different CepsString.
s | base string considered |
toErase | vector of strings to erase |
Definition at line 108 of file CepsString.cpp.
CepsBool ceps::toBool | ( | const CepsString & | s | ) |
CepsInt ceps::toInt | ( | const CepsString & | s | ) |
|
constexpr |
Converts an enum type variable to an integer.
_Enum |
e |
Definition at line 42 of file CepsEnums.hpp.
CepsSet< CepsInt > ceps::toInts | ( | const CepsString & | s | ) |
CepsString ceps::toKey | ( | const CepsString & | s | ) |
Transform to key type a std::string, upper case and no spaces.
Definition at line 157 of file CepsString.cpp.
CepsVector< CepsString > ceps::toKey | ( | const CepsVector< CepsString > & | vec | ) |
Transform to key type a vector of std::string, upper case and no spaces.
Definition at line 168 of file CepsString.cpp.
void ceps::toKeyInPlace | ( | CepsVector< CepsString > & | vec | ) |
Transform to key type a vector of std::string, upper case and no spaces.
Definition at line 178 of file CepsString.cpp.
CepsString ceps::toLower | ( | const CepsString & | s | ) |
Switches all characters to lower case.
Definition at line 134 of file CepsString.cpp.
CepsMathScalar ceps::toMathScalar | ( | const CepsVector< CepsString > & | vec | ) |
Cast a CepsVector of CepsString to CepsMathScalar same effect as ceps::toReal(vec[0])
Definition at line 219 of file CepsString.cpp.
CepsMathTensor ceps::toMathTensor | ( | const CepsVector< CepsString > & | vec | ) |
Cast a CepsVector of CepsString to CepsMathTensor.
If vector is of size 1 : returns Identity*scalar 3 : returns diag(vec) 6 : returns symmetric tensor v[0] v[1] v[2], v[1] v[3] v[4], v[2] v[4] v[5] 9 : returns tensor with 9 coeffs set line per line
Definition at line 237 of file CepsString.cpp.
CepsMathVertex ceps::toMathVertex | ( | const CepsVector< CepsString > & | vec | ) |
Cast a CepsVector of CepsString to CepsMathVertex.
Definition at line 227 of file CepsString.cpp.
CepsReal ceps::toReal | ( | const CepsString & | s | ) |
CepsSet< CepsReal > ceps::toReals | ( | const CepsString & | s | ) |
Cast CepsString to a set of CepsReal.
Definition at line 207 of file CepsString.cpp.
CepsString ceps::toString | ( | _Tp | value | ) |
Convert a given value to a string (input has to be compatible with std::to_string)
Definition at line 409 of file CepsString.hpp.
CepsUInt ceps::toUInt | ( | const CepsString & | s | ) |
CepsSet< CepsUInt > ceps::toUInts | ( | const CepsString & | s | ) |
Cast CepsString to a set of CepsUInt.
Definition at line 310 of file CepsString.cpp.
CepsString ceps::toUpper | ( | const CepsString & | s | ) |
Switches all characters to upper case.
Definition at line 124 of file CepsString.cpp.
CepsString ceps::trim | ( | const CepsString & | s | ) |
Removes trailing and preceeding spaces.
Definition at line 78 of file CepsString.cpp.
CepsVector<_Tp> ceps::valuesOf | ( | const CepsMap< _Key, _Tp, _Comp, _Alloc > & | m | ) |
Get the values of a map as a vector.
Definition at line 57 of file CepsMap.hpp.
CepsVector<_Tp> ceps::valuesOf | ( | const CepsMultiMap< _Key, _Tp, _Hash, _Eq, _Alloc > & | m | ) |
Get the values of a map as a vector.
Definition at line 81 of file CepsMap.hpp.