MOOSE - Multiscale Object Oriented Simulation Environment
|
Namespaces | |
assertion | |
detail | |
details | |
Classes | |
class | AdExIF |
class | AdThreshIF |
class | Compartment |
class | CompartmentBase |
class | CompartmentDataHolder |
class | ExIF |
class | IntFireBase |
class | IzhIF |
class | LIF |
class | normal_distribution |
class | QIF |
class | RNG |
class | VClamp |
Typedefs | |
template<typename T = double> | |
using | MOOSE_NORMAL_DISTRIBUTION = moose::normal_distribution< T > |
typedef std::random_device | MOOSE_RANDOM_DEVICE |
typedef std::mersenne_twister_engine < std::uint_fast32_t, 32, 624, 397, 31, 0x9908b0df, 11, 0xffffffff, 7, 0x9d2c5680, 15, 0xefc60000, 18, 1812433253 > | MOOSE_RNG_DEFAULT_ENGINE |
template<typename T = double> | |
using | MOOSE_UNIFORM_DISTRIBUTION = std::uniform_real_distribution< T > |
Enumerations | |
enum | serverity_level_ { trace, debug, info, warning, fixme, error, fatal, failed } |
Enumerate type for debug and log. More... | |
Functions | |
void | __dump__ (string msg, serverity_level_ type=debug, bool autoFormat=true) |
string | basename (const string &path) |
Givem path of MOOSE element, return its name. It's behaviour is like basename of unix command e.g. /a/b/c –> c. More... | |
int | checkPath (const string &path) |
Checks if given path is correct. If not, return false and error-code as well. More... | |
string & | clean_type_name (string &arg) |
string | colored (string msg) |
string | colored (string msg, string colorName) |
string | createMOOSEPath (const string &path) |
Create a POSIX compatible path from a given string. Remove/replace bad characters. More... | |
bool | createParentDirs (const string &path) |
Create directories recursively needed to open the given file p. More... | |
string | debugPrint (string msg, string prefix="DEBUG", string color=T_RESET, unsigned debugLevel=0) |
bool | endswith (const string &full, const string &ending) |
std::string | fix (const std::string userPath, const string &delimiters) |
string | fixPath (string path) |
Fix a path. For testing purpose. More... | |
string | formattedMsg (string &msg) |
const map< string, string > & | getArgMap () |
string | getExtension (const string &path, bool without_dot=true) |
Get the extension of a given filepath. More... | |
int | getGlobalSeed () |
char | innerType (char typecode) |
bool | isBackTick (char a) |
string | joinPath (string pathA, string pathB) |
Append pathB to pathA and return the result. More... | |
void | log (string msg, serverity_level_ type=debug, bool redirectToConsole=true, bool removeTicks=true) |
Log to console (and to a log-file) More... | |
template<typename A , typename B > | |
string | mapToString (const map< A, B > &m, bool value=true) |
string | moosePathToUserPath (string path) |
When user gives a path /a/b/c, moose creates a path /a[0]/b[0]/c[0]. This is helpful in cases where one needs to create more than 1 element. More... | |
double | mtrand (void) |
Generate a random double between 0 and 1. More... | |
void | mtseed (unsigned int x) |
Set the global seed or all rngs. More... | |
string | pathToName (const string &path) |
Return the name when path is given. Its behaviour is exactly the same as of basename command on unix system. More... | |
string | random_string (const unsigned len) |
void | setGlobalSeed (int seed) |
char | shortFinfo (std::string ftype) |
char | shortType (std::string type) |
void | showDebug (const string msg) |
void | showError (string msg) |
void | showInfo (string msg) |
void | showWarn (string msg) |
int | strncasecmp (const std::string &a, const std::string &b, size_t n) |
Compares the two strings a and b for first n characters, ignoring the case of the characters. Return 0 in case both are same upto first n characters. Othere a non-zero value is returned. When n is smaller or equal to the size of both strings, positive is return if a is larger than b, or negative when a is smaller than b. More... | |
int | testTrim () |
string | toFilename (const string &path) |
Replace all directory sepearator with _. This creates a filepath which can be created in current directory without any need to create parent directory. More... | |
void | tokenize (const string &str, const string &delimiters, vector< string > &tokens) |
string | toString (double x) |
Convert a given value to string. More... | |
std::string | trim (const std::string myString, const string &delimiters) |
Variables | |
unsigned long | __rng_seed__ = 0 |
A global seed for all RNGs in moose. When moose.seed( x ) is called, this variable is set. Other's RNGs (except muparser) uses this seed to initialize them. By default it is initialized by random_device (see global.cpp). More... | |
static const char *const | DELIMITERS =" \t\r\n" |
static string | levels_ [9] |
moose::RNG< double > | rng |
The Compartment class sets up an asymmetric compartment for branched nerve calculations. Handles electronic structure and also channels. This is not a particularly efficient way of doing this, so we should use a solver for any substantial calculations.
The CompartmentBase class sets up the interface for all the derived Compartment classes, used in branched nerve calculations. Handles electronic structure and also channels.
using moose::MOOSE_NORMAL_DISTRIBUTION = typedef moose::normal_distribution<T> |
Definition at line 29 of file Distributions.h.
typedef std::random_device moose::MOOSE_RANDOM_DEVICE |
MOOSE's random device. Use it from <random>
Definition at line 29 of file Definitions.h.
typedef std::mersenne_twister_engine< std::uint_fast32_t, 32, 624, 397, 31 , 0x9908b0df, 11 , 0xffffffff, 7 , 0x9d2c5680, 15 , 0xefc60000, 18, 1812433253 > moose::MOOSE_RNG_DEFAULT_ENGINE |
Global random number generator engine. Everywhere we use this engine.
Definition at line 42 of file Definitions.h.
using moose::MOOSE_UNIFORM_DISTRIBUTION = typedef std::uniform_real_distribution<T> |
Definition at line 26 of file Distributions.h.
Enumerate type for debug and log.
Enumerator | |
---|---|
trace | |
debug | |
info | |
warning | |
fixme | |
error | |
fatal | |
failed |
Definition at line 76 of file print_function.hpp.
|
inline |
Definition at line 170 of file print_function.hpp.
References debug, error, failed, fixme, info, levels_, T_CYAN, T_GREEN, T_MAGENTA, T_RED, T_RESET, T_YELLOW, and warning.
Referenced by log(), showDebug(), showError(), showInfo(), and showWarn().
|
inline |
int moose::checkPath | ( | const string & | path | ) |
Checks if given path is correct. If not, return false and error-code as well.
path | Path name. |
Definition at line 50 of file global.cpp.
References BAD_CHARACTER_IN_PATH, EMPTY_PATH, and MISSING_BRACKET_AT_END.
Referenced by fixPath().
std::string & moose::clean_type_name | ( | string & | arg | ) |
Definition at line 36 of file strutil.cpp.
|
inline |
|
inline |
string moose::createMOOSEPath | ( | const string & | path | ) |
Create a POSIX compatible path from a given string. Remove/replace bad characters.
path | Reutrn path is given path if creation was successful, else directory is renamed to a filename. |
Definition at line 105 of file global.cpp.
References path.
Referenced by moosePathToUserPath(), and Table::setOutfile().
bool moose::createParentDirs | ( | const string & | path | ) |
Create directories recursively needed to open the given file p.
Create directory, recursively.
path | When successfully created, returns created path, else convert path to a filename by replacing '/' by '_'. |
Definition at line 122 of file global.cpp.
References failed, info, LOG, path, and warning.
Referenced by Table::setOutfile(), and Streamer::setOutFilepath().
|
inline |
bool moose::endswith | ( | const string & | full, |
const string & | ending | ||
) |
Definition at line 138 of file strutil.cpp.
Referenced by moose_Id_getPath().
std::string moose::fix | ( | const std::string | myString, |
const std::string & | delimiters = " \t\r\n" |
||
) |
Fix the user-given path whenever possible
Definition at line 71 of file strutil.cpp.
References trim().
Referenced by moose_ObjId_init_from_path().
string moose::fixPath | ( | string | path | ) |
Fix a path. For testing purpose.
path | Path as string. |
Definition at line 74 of file global.cpp.
References checkPath(), MISSING_BRACKET_AT_END, and path.
Referenced by HSolveUtils::gates(), and joinPath().
|
inline |
Definition at line 267 of file print_function.hpp.
References isBackTick().
Referenced by log().
const map< std::string, std::string > & moose::getArgMap | ( | ) |
Definition at line 41 of file setupenv.cpp.
References doRegressionTests, doUnitTests, getNumCores(), isInfinite, numCores, numNodes, and verbosity.
Referenced by setup_runtime_env().
string moose::getExtension | ( | const string & | path, |
bool | without_dot = true |
||
) |
Get the extension of a given filepath.
path | Given path. |
Definition at line 170 of file global.cpp.
Referenced by Table::setOutfile(), and Streamer::setOutFilepath().
int moose::getGlobalSeed | ( | ) |
Get the global seed set by call of moose.seed( X )
seed (int).
Definition at line 206 of file global.cpp.
References __rng_seed__.
Referenced by GraupnerBrunel2012CaPlasticitySynHandler::reinitSeed().
|
inline |
Definition at line 260 of file print_function.hpp.
Referenced by formattedMsg().
string moose::joinPath | ( | string | pathA, |
string | pathB | ||
) |
Append pathB to pathA and return the result.
If pathA does not have [indexs] at the end, append "[0]" to pathA and then add pathB to it. This version does not care if the result has '[0]' at its end.
pathA | First path. |
pathB | Second path. |
Definition at line 66 of file global.cpp.
References fixPath().
|
inline |
Log to console (and to a log-file)
msg | String, message to be written. |
type | Type of the message. |
redirectToConsole | |
removeTicks |
Definition at line 281 of file print_function.hpp.
References __dump__(), and formattedMsg().
Referenced by GssaVoxelPools::advance(), MarkovSolver::computeMatrixExponential(), estT(), SynChan::normalizeGbar(), moose::normal_distribution< double >::operator()(), ChannelStruct::powerN(), HHChannelBase::powerN(), HHChannel2D::powerN(), GssaVoxelPools::recalcTime(), RandSpike::reinit(), GraupnerBrunel2012CaPlasticitySynHandler::updateCaWeightFactors(), Nernst::updateE(), and NMDAChan::vProcess().
string moose::mapToString | ( | const map< A, B > & | m, |
bool | value = true |
||
) |
string moose::moosePathToUserPath | ( | string | path | ) |
When user gives a path /a/b/c, moose creates a path /a[0]/b[0]/c[0]. This is helpful in cases where one needs to create more than 1 element.
path | Removed '[0]' from path and return. |
Definition at line 189 of file global.cpp.
References createMOOSEPath().
Referenced by Streamer::addTable(), Table::reinit(), and Streamer::reinit().
double moose::mtrand | ( | void | ) |
Generate a random double between 0 and 1.
Definition at line 97 of file global.cpp.
References rng, and moose::RNG< T >::uniform().
Referenced by addPos(), SteadyState::fitConservationRules(), makeAngleDistrib(), makeSizeDistrib(), RandSpike::process(), Gsolve::process(), pymoose_mtrand_(), SeqSynHandler::refillSynapseOrder(), RandSpike::reinit(), testSparseMsg(), and moose::Compartment::vRandInject().
void moose::mtseed | ( | unsigned int | x | ) |
Set the global seed or all rngs.
Seed seed for RNG.
x | |
seed |
Definition at line 89 of file global.cpp.
References __rng_seed__, isRNGInitialized, rng, and moose::RNG< T >::setSeed().
Referenced by pymoose_mtseed_(), and SeqSynHandler::refillSynapseOrder().
string moose::pathToName | ( | const string & | path | ) |
Return the name when path is given. Its behaviour is exactly the same as of basename
command on unix system.
path |
Definition at line 183 of file global.cpp.
std::string moose::random_string | ( | const unsigned | size | ) |
Generate random string of given length.
Definition at line 162 of file strutil.cpp.
void moose::setGlobalSeed | ( | int | seed | ) |
Set the seed for all random generator. When seed of a RNG is not set, this seed it used. It is set to -1 by default.
seed
Definition at line 211 of file global.cpp.
References __rng_seed__.
Referenced by testSparseMsg().
char moose::shortType | ( | string | name | ) |
|
inline |
Definition at line 229 of file print_function.hpp.
References __dump__(), and debug.
|
inline |
Definition at line 238 of file print_function.hpp.
References __dump__(), and error.
Referenced by cnpy2::save_numpy().
|
inline |
Definition at line 219 of file print_function.hpp.
References __dump__(), and info.
|
inline |
Definition at line 224 of file print_function.hpp.
References __dump__(), and warning.
Referenced by cnpy2::change_shape_in_header(), Shell::doCreate(), Streamer::reinit(), cnpy2::save_numpy(), and Shell::warning().
int moose::strncasecmp | ( | const std::string & | a, |
const std::string & | b, | ||
size_t | n | ||
) |
Compares the two strings a and b for first n characters, ignoring the case of the characters. Return 0 in case both are same upto first n characters. Othere a non-zero value is returned. When n is smaller or equal to the size of both strings, positive is return if a is larger than b, or negative when a is smaller than b.
When n is larger than size of a or b, non-zero values is returned when a and b are not equal upto min(n, min(a.size(), b.size())) characters.
a | First string. |
b | Second string. |
n | Compare up n characters/bytes. |
Definition at line 148 of file strutil.cpp.
Referenced by NeuroNode::findStartNode(), and NeuroMesh::putSomaAtStart().
int moose::testTrim | ( | ) |
Definition at line 90 of file strutil.cpp.
References trim().
string moose::toFilename | ( | const string & | path | ) |
Replace all directory sepearator with _. This creates a filepath which can be created in current directory without any need to create parent directory.
path | string |
Definition at line 161 of file global.cpp.
References path.
Referenced by Table::setOutfile(), and Streamer::setOutFilepath().
void moose::tokenize | ( | const std::string & | str, |
const std::string & | delimiters, | ||
std::vector< std::string > & | tokens | ||
) |
Splits given string into tokens
Definition at line 19 of file strutil.cpp.
Referenced by ReadCell::addChannelMessage(), parseFinfoType(), ReadCell::readData(), and ReadCell::readScript().
string moose::toString | ( | double | x | ) |
Convert a given value to string.
T |
x |
Definition at line 199 of file global.cpp.
Referenced by cnpy2::change_shape_in_header(), cnpy2::write_header(), and StreamerBase::writeToCSVFile().
std::string moose::trim | ( | const std::string | myString, |
const std::string & | delimiters = " \t\r\n" |
||
) |
trims the leading and trailing white spaces
Definition at line 53 of file strutil.cpp.
Referenced by chopLine(), create_Id_from_path(), findModelType(), fix(), innerLoadXplot(), ReadCell::innerRead(), ReadKkit::innerRead(), Interpol2D::load(), moose_Id_init(), Func::reinit(), Function::reinit(), and testTrim().
unsigned long moose::__rng_seed__ = 0 |
A global seed for all RNGs in moose. When moose.seed( x ) is called, this variable is set. Other's RNGs (except muparser) uses this seed to initialize them. By default it is initialized by random_device (see global.cpp).
Definition at line 45 of file global.cpp.
Referenced by getGlobalSeed(), mtseed(), GssaVoxelPools::reinit(), setGlobalSeed(), and ZombieCompartment::vReinit().
|
static |
|
static |
Definition at line 80 of file print_function.hpp.
Referenced by __dump__().
moose::RNG< double > moose::rng |
Definition at line 47 of file global.cpp.
Referenced by mtrand(), ZombieCompartment::mtrand(), mtseed(), and ZombieCompartment::vReinit().