Namespaces | |
advancedtimer | |
console | |
io | |
This allow MeshTrian to interact with the messaging system. | |
lifecycle | |
logging | |
This allow Base object to interact with the messaging system. | |
messaging | |
polygon_cube_intersection | |
system | |
visual | |
Typedefs | |
typedef sofa::helper::system::thread::ctime_t | ctime_t |
typedef sofa::helper::system::thread::CTime | CTime |
typedef const char *(* | integer_id_name) () |
typedef SReal | FemClipsReal |
typedef TSimpleTimer | SimpleTimer |
Enumerations | |
enum | { NDefaultColorMapSchemes = 20 } |
Functions | |
template<class T > | |
WriteAccessor< core::objectmodel::Data< T > > | getWriteAccessor (core::objectmodel::Data< T > &data) |
template<class T > | |
ReadAccessor< core::objectmodel::Data< T > > | getReadAccessor (const core::objectmodel::Data< T > &data) |
template<class T > | |
WriteOnlyAccessor< core::objectmodel::Data< T > > | getWriteOnlyAccessor (core::objectmodel::Data< T > &data) |
SOFA_THREAD_SPECIFIC_PTR (std::stack< AdvancedTimer::IdTimer >, curTimerThread) | |
SOFA_THREAD_SPECIFIC_PTR (type::vector< Record >, curRecordsThread) | |
std::stack< AdvancedTimer::IdTimer > & | getCurTimer () |
type::vector< Record > * | getCurRecords () |
void | setCurRecords (type::vector< Record > *ptr) |
void | printVal (std::ostream &out, double v) |
void | printNoVal (std::ostream &out) |
void | printVal (std::ostream &out, double v, int niter) |
void | printTime (std::ostream &out, ctime_t t, int niter=1) |
std::string | getVal (double v) |
std::string | getNoVal () |
std::string | getVal (double v, int niter) |
std::string | getTime (ctime_t t, int niter=1) |
double | strToDouble (std::string const &stringToConvert, std::size_t const precision) |
template<class Real > | |
int | dsyevc3 (const type::Mat< 3, 3, Real > &A, type::Vec< 3, Real > &w) |
template<class Real > | |
void | dsytrd3 (const type::Mat< 3, 3, Real > &A, type::Mat< 3, 3, Real > &Q, type::Vec< 3, Real > &d, type::Vec< 3, Real > &e) |
template<class Real > | |
int | dsyevq3 (const type::Mat< 3, 3, Real > &A, type::Mat< 3, 3, Real > &Q, type::Vec< 3, Real > &w) |
template<class Real > | |
void | dsyev2 (Real A, Real B, Real C, Real &rt1, Real &rt2, Real &cs, Real &sn) |
std::vector< std::tuple< std::string, SReal > > SOFA_HELPER_API | getClosestMatch (const std::string &needle, const std::vector< std::string > &haystack, const Size numEntries=5, const SReal threshold=0.5_sreal) |
Search for the the closest match to the string passed in the "needle" argument within the vector of "haystack" arguments. More... | |
SOFA_HELPER_API std::string | gettypename (const std::type_info &t) |
Decode the type's name to a more readable form if possible. More... | |
SOFA_HELPER_API std::string & | getFactoryLog () |
SOFA_HELPER_API void | printFactoryLog (std::ostream &out) |
Print factory log. More... | |
template SOFA_HELPER_API void | logFactoryRegister< std::string > (const std::string &baseclass, const std::string &classname, std::string key, bool multi) |
template<class TKey > | |
void | logFactoryRegister (const std::string &baseclass, const std::string &classname, TKey key, bool multi) |
Log classes registered in the factory. More... | |
template SOFA_HELPER_API void | logFactoryRegister (const std::string &baseclass, const std::string &classname, std::string key, bool multi) |
template<typename Rigid3MassType > | |
void | generateRigid (Rigid3MassType &mass, type::Vec3 ¢er, const helper::io::Mesh *mesh) |
base function to compute center of mass, mass and inertia tensor from a mesh More... | |
template<typename Rigid3MassType > | |
void | generateRigid (Rigid3MassType &mass, type::Vec3 ¢er, io::Mesh *mesh, SReal density, const type::Vec3 &scale=type::Vec3(1, 1, 1), const type::Vec3 &rotation=type::Vec3(0, 0, 0)) |
user friendly function to compute center of mass, mass and inertia tensor from a mesh, a density, a scale and a rotation More... | |
template<typename Rigid3MassType > | |
bool | generateRigid (Rigid3MassType &mass, type::Vec3 ¢er, const std::string &meshFilename, SReal density, const type::Vec3 &scale=type::Vec3(1, 1, 1), const type::Vec3 &rotation=type::Vec3(0, 0, 0)) |
user friendly function to compute center of mass, mass and inertia tensor from a mesh file, a density, a scale and a rotation More... | |
template<typename Rigid3MassType > | |
void | generateRigid (GenerateRigidInfo &res, io::Mesh *mesh, std::string const &meshName, SReal density, const type::Vec3 &scale=type::Vec3(1, 1, 1), const type::Vec3 &rotation=type::Vec3(0, 0, 0)) |
user friendly function to compute rigid info from a mesh, a density, a scale More... | |
template<typename Rigid3MassType > | |
bool | generateRigid (GenerateRigidInfo &res, const std::string &meshFilename, SReal density, const type::Vec3 &scale=type::Vec3(1, 1, 1), const type::Vec3 &rotation=type::Vec3(0, 0, 0)) |
user friendly function to compute rigid info from a mesh file, a density, a scale More... | |
SOFA_HELPER_API void | init () |
Initialize the SofaHelper library. More... | |
SOFA_HELPER_API bool | isInitialized () |
Return true if and only if the SofaHelper library has been initialized. More... | |
SOFA_HELPER_API void | cleanup () |
Clean up the resources used by the SofaHelper library. More... | |
SOFA_HELPER_API bool | isCleanedUp () |
Return true if and only if the SofaHelper library has been cleaned up. More... | |
SOFA_HELPER_API void | printUninitializedLibraryWarning (const std::string &library, const std::string &initFunction) |
Print a warning about a library not being initialized (meant for internal use). More... | |
SOFA_HELPER_API void | printLibraryNotCleanedUpWarning (const std::string &library, const std::string &cleanupFunction) |
Print a warning about a library not being cleaned up (meant for internal use). More... | |
void SOFA_HELPER_API | vector_access_failure (const void *vec, unsigned size, unsigned i, const std::type_info &type, const char *tindex) |
int | solveLCP (int dim, SReal *q, SReal **M, SReal *res) |
void | printSyst (SReal *q, SReal **M, int *base, SReal **mat, int dim) |
void | printLCP (SReal *q, SReal **M, int dim) |
void | printLCP (SReal *q, SReal **M, SReal *f, int dim) |
void | resultToString (ostream &s, SReal *f, int dim) |
void | projection (LCP &fineLevel, LCP &coarseLevel, int nbContactsCoarse, const std::vector< int > &projectionTable, const std::vector< int > &projectionConstraints, std::vector< SReal > &projectionValues, std::vector< bool > &contact_is_projected, bool verbose) |
void | prolongation (LCP &fineLevel, LCP &coarseLevel, const std::vector< int > &projectionTable, const std::vector< int > &projectionConstraints, std::vector< SReal > &projectionValues, std::vector< bool > &contact_is_projected, bool verbose) |
int | nlcp_multiGrid_2levels (int dim, SReal *dfree, SReal **W, SReal *f, SReal mu, SReal tol, int numItMax, bool useInitialF, std::vector< int > &contact_group, unsigned int num_group, std::vector< int > &constraint_group, std::vector< SReal > &constraint_group_fact, bool verbose, std::vector< SReal > *residuals1, std::vector< SReal > *residuals2) |
new multigrid resolution of a problem with projection & prolongation More... | |
int | nlcp_multiGrid_Nlevels (int dim, SReal *dfree, SReal **W, SReal *f, SReal mu, SReal tol, int numItMax, bool useInitialF, std::vector< std::vector< int > > &contact_group_hierarchy, std::vector< unsigned int > Tab_num_group, std::vector< std::vector< int > > &constraint_group_hierarchy, std::vector< std::vector< SReal > > &constraint_group_fact_hierarchy, bool verbose, std::vector< SReal > *residualsN, std::vector< SReal > *residualLevels, std::vector< SReal > *violations) |
int | nlcp_multiGrid (int dim, SReal *dfree, SReal **W, SReal *f, SReal mu, SReal tol, int numItMax, bool useInitialF, SReal **W_coarse, std::vector< int > &contact_group, unsigned int num_group, bool verbose) |
int | nlcp_gaussseidel (int dim, SReal *dfree, SReal **W, SReal *f, SReal mu, SReal tol, int numItMax, bool useInitialF, bool verbose, SReal minW, SReal maxF, std::vector< SReal > *residuals, std::vector< SReal > *violations) |
int | nlcp_gaussseidelTimed (int dim, SReal *dfree, SReal **W, SReal *f, SReal mu, SReal tol, int numItMax, bool useInitialF, SReal timeout, bool verbose) |
void | gaussSeidelLCP1 (int dim, FemClipsReal *q, FemClipsReal **M, FemClipsReal *res, SReal tol, int numItMax, SReal minW, SReal maxF, std::vector< SReal > *residuals) |
SOFA_HELPER_API void | set3Dof (SReal *vector, int index, SReal vx, SReal vy, SReal vz) |
SOFA_HELPER_API void | add3Dof (SReal *vector, int index, SReal vx, SReal vy, SReal vz) |
SOFA_HELPER_API SReal | normError (SReal f1x, SReal f1y, SReal f1z, SReal f2x, SReal f2y, SReal f2z) |
SOFA_HELPER_API SReal | absError (SReal f1x, SReal f1y, SReal f1z, SReal f2x, SReal f2y, SReal f2z) |
SOFA_LCPCALC_RESOUDRELCP_DISABLED () int resoudreLCP(int | |
SReal SReal SReal * | SOFA_LCPCALC_AFFICHESYST_DISABLED () void afficheSyst(SReal *q |
SOFA_LCPCALC_AFFICHELCP_DISABLED () void afficheLCP(SReal *q | |
SOFA_HELPER_API void | resultToString (std::ostream &s, SReal *f, int dim) |
template<Size NumRows, Size NumCols, class Real > | |
Eigen::Matrix< Real, NumRows, NumCols > | eigenMat (const type::Mat< NumRows, NumCols, Real > &mat) |
template<Size NumRows, Size NumCols, class Real > | |
type::Mat< NumRows, NumCols, Real > | sofaMat (const Eigen::Matrix< Real, NumRows, NumCols > &emat) |
template<Size NumRows, class Real > | |
type::Vec< NumRows, Real > | sofaVec (const Eigen::Matrix< Real, NumRows, 1 > &evec) |
template<Size NumRows, class Real > | |
Eigen::Matrix< Real, NumRows, 1 > | eigenVec (const type::Vec< NumRows, Real > &vec) |
template<class T , class U > | |
constexpr T | narrow_cast_nocheck (U &&u) noexcept |
Explicit narrow conversion Inspired by the Guidelines Support Library (https://github.com/microsoft/GSL) More... | |
template<class T , class U > | |
constexpr T | narrow_cast_check (U u) |
template<class T , class U > | |
constexpr T | narrow_cast (U &&u) |
Explicit narrow conversion Inspired by the Guidelines Support Library (https://github.com/microsoft/GSL) More... | |
std::ostream & | operator<< (std::ostream &on, const OptionsGroup &m_trick) |
std::istream & | operator>> (std::istream &in, OptionsGroup &m_trick) |
template<typename FReal , unsigned int FN> | |
std::ostream & | operator<< (std::ostream &out, const Monomial_LD< FReal, FN > &m_monomial) |
template<typename FReal , unsigned int FN> | |
std::istream & | operator>> (std::istream &in, Monomial_LD< FReal, FN > &m_monomial) |
template<typename FReal , unsigned int FN> | |
std::ostream & | operator<< (std::ostream &stream, const Polynomial_LD< FReal, FN > &m_polynomial) |
template<typename FReal , unsigned int FN> | |
std::istream & | operator>> (std::istream &stream, Polynomial_LD< FReal, FN > &m_polynomial) |
template<typename FReal , unsigned int FN> | |
Monomial_LD< FReal, FN > & | operator* (const FReal &alpha, Monomial_LD< FReal, FN > &r) |
template<typename FReal , unsigned int FN> | |
Polynomial_LD< FReal, FN > & | operator* (const FReal &alpha, Polynomial_LD< FReal, FN > &r) |
template<typename FReal , unsigned int FN> | |
Polynomial_LD< FReal, FN > & | operator* (const Monomial_LD< FReal, FN > &a, Polynomial_LD< FReal, FN > &r) |
void | srand (unsigned seed) |
int | irand () |
double | drand () |
double | drandpos (double max) |
double | drand (double max) |
double | drand (double min, double max) |
template<class real > | |
int | rfloor (real r) |
template<class real > | |
int | rnear (real r) |
int | rceil (double r) |
template<class real > | |
real | rabs (real r) |
template<class real > | |
real | rmin (real r, real s) |
template<class real > | |
real | rmax (real r, real s) |
template<class T > | |
T | rlerp (const T &a, const T &b, float f) |
template<class T > | |
T | rsqrt (const T &a) |
double | rsqrt (const double &a) |
long double | rsqrt (const long double &a) |
template<class T > | |
const T | SQR (const T &a) |
template<class T > | |
const T | SIGN (const T &a, const T &b) |
template<class T > | |
void | SWAP (T &a, T &b) |
void | shft3 (double &a, double &b, double &c, const double d) |
template<class T > | |
T | round (const T &x) |
template<class T > | |
T | factorial (T Number) |
template<class T > | |
T | rclamp (const T &value, const T &low, const T &high) |
template<class T > | |
bool | isClamped (const T &value, const T &low, const T &high) |
template<class T > | |
T | sign (const T &v) |
template<class T > | |
T | sign0 (const T &v) |
template<class T > | |
bool | isEqual (T x, T y, T threshold=(std::numeric_limits< T >::epsilon)()) |
template<class T > | |
bool | isNull (T x, T threshold=(std::numeric_limits< T >::epsilon)()) |
double | rcos (double x) |
float | rcos (float x) |
double | rsin (double x) |
float | rsin (float x) |
template<class T > | |
T | rcos (const T &a) |
template<class T > | |
T | rsin (const T &a) |
template<class Container > | |
type::vector< unsigned > | sortedPermutation (const Container &values) |
Return a sorted permutation of the container, i.e. a list of indices corresponding to increasing entries. More... | |
std::wstring | widenString (const std::string &s) |
Convert a string to a wstring. More... | |
std::string | narrowString (const std::wstring &ws) |
Convert a wstring to a string. More... | |
std::string | downcaseString (const std::string &s) |
Convert a string to lower case. More... | |
std::string | upcaseString (const std::string &s) |
Convert a string to upper case. More... | |
std::vector< std::string > | split (const std::string &s, char delimiter) |
Taken from https://www.fluentcpp.com/2017/04/21/how-to-split-a-string-in-c/. More... | |
char * | getAStringCopy (const char *c) |
returns a copy of the string given in argument. More... | |
void | replaceAll (std::string &str, const std::string &search, const std::string &replace) |
replace all occurrence of "search" by the "replace" string. More... | |
bool | ends_with (const std::string &suffix, const std::string &full) |
returns true if the suffix if located at the end of the "full" string. More... | |
bool | starts_with (const std::string &prefix, const std::string &full) |
returns true if the prefix if located at the beginning of the "full" string. More... | |
std::string | safeCharToString (const char *c) |
converts a char* string into a c++ string. The special case with nullptr is coerced to an empty string. More... | |
std::string_view | removeTrailingCharacter (std::string_view sv, char character) |
Removes specified trailing character from a string view. More... | |
std::string_view | removeTrailingCharacters (std::string_view sv, std::initializer_list< char > characters) |
Removes specified trailing characters from a string view. More... | |
template<class InputIt , class S > | |
std::string | join (InputIt first, InputIt last, const S &delim) |
template<class InputIt , class UnaryFunction , class S > | |
std::string | join (InputIt first, InputIt last, UnaryFunction f, const S &delim) |
template<class S , class Container > | |
std::string | join (const Container &elems, const S &delim) |
Join a container into a single string, separated by the provided delimiter. More... | |
unsigned int | choose_next (SReal x, SReal y, SReal z, unsigned int a, unsigned int b, unsigned int c) |
Variables | |
std::map< AdvancedTimer::IdTimer, TimerData > | timers |
std::atomic< int > | activeTimers |
AdvancedTimer::SyncCallBack | syncCallBack = nullptr |
void * | syncCallBackData = nullptr |
template class SOFA_HELPER_API | Decompose< double > |
template class SOFA_HELPER_API | Decompose< float > |
SReal SReal SReal SReal ** | M |
SReal SReal SReal SReal int * | base |
SReal SReal SReal SReal int SReal ** | mat |
SReal SReal SReal SReal int SReal int | dim = delete |
SReal SReal * | f |
const int | MarchingCubeEdgeTable [256] |
const int | MarchingCubeFaceTable [256] |
const int | MarchingCubeTriTable [256][16] |
constexpr bool | forceNarrowCastChecking = true |
If true, narrow_cast will check if the value changed after the narrow conversion. Otherwise, no check is performed. More... | |
template class SOFA_HELPER_API | Monomial_LD< double, 1 > |
template class SOFA_HELPER_API | Monomial_LD< double, 2 > |
template class SOFA_HELPER_API | Monomial_LD< double, 3 > |
template class SOFA_HELPER_API | Monomial_LD< double, 4 > |
template class SOFA_HELPER_API | Monomial_LD< double, 5 > |
template class SOFA_HELPER_API | Polynomial_LD< double, 1 > |
template class SOFA_HELPER_API | Polynomial_LD< double, 2 > |
template class SOFA_HELPER_API | Polynomial_LD< double, 3 > |
template class SOFA_HELPER_API | Polynomial_LD< double, 4 > |
template class SOFA_HELPER_API | Polynomial_LD< double, 5 > |
std::mutex | kMutex |
TagList | kTagList { {"0", "Visual"} } |
Helpers to apply Eigen matrix methods to the Mat sofa type
Utility to compute the sorted permutation of a container. See example at the end of the file Francois Faure, April 2012
typedef SReal sofa::helper::FemClipsReal |
typedef const char*(* sofa::helper::integer_id_name) () |
|
inline |
|
inline |
|
inline |
SOFA_HELPER_API void sofa::helper::cleanup | ( | ) |
Clean up the resources used by the SofaHelper library.
SOFA_HELPER_API std::string sofa::helper::downcaseString | ( | const std::string & | s | ) |
Convert a string to lower case.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
int sofa::helper::dsyevc3 | ( | const type::Mat< 3, 3, Real > & | A, |
type::Vec< 3, Real > & | w | ||
) |
int sofa::helper::dsyevq3 | ( | const type::Mat< 3, 3, Real > & | A, |
type::Mat< 3, 3, Real > & | Q, | ||
type::Vec< 3, Real > & | w | ||
) |
|
inline |
Eigen::Matrix<Real, NumRows, NumCols> sofa::helper::eigenMat | ( | const type::Mat< NumRows, NumCols, Real > & | mat | ) |
Eigen::Matrix<Real, NumRows, 1> sofa::helper::eigenVec | ( | const type::Vec< NumRows, Real > & | vec | ) |
SOFA_HELPER_API bool sofa::helper::ends_with | ( | const std::string & | suffix, |
const std::string & | full | ||
) |
returns true if the suffix if located at the end of the "full" string.
|
inline |
SOFA_HELPER_API void sofa::helper::gaussSeidelLCP1 | ( | int | dim, |
FemClipsReal * | q, | ||
FemClipsReal ** | M, | ||
FemClipsReal * | res, | ||
SReal | tol, | ||
int | numItMax, | ||
SReal | minW, | ||
SReal | maxF, | ||
std::vector< SReal > * | residuals | ||
) |
bool sofa::helper::generateRigid | ( | GenerateRigidInfo & | res, |
const std::string & | meshFilename, | ||
SReal | density, | ||
const type::Vec3 & | scale = type::Vec3(1,1,1) , |
||
const type::Vec3 & | rotation = type::Vec3(0,0,0) |
||
) |
user friendly function to compute rigid info from a mesh file, a density, a scale
void sofa::helper::generateRigid | ( | GenerateRigidInfo & | res, |
io::Mesh * | mesh, | ||
std::string const & | meshName, | ||
SReal | density, | ||
const type::Vec3 & | scale = type::Vec3(1,1,1) , |
||
const type::Vec3 & | rotation = type::Vec3(0,0,0) |
||
) |
user friendly function to compute rigid info from a mesh, a density, a scale
void sofa::helper::generateRigid | ( | Rigid3MassType & | mass, |
type::Vec3 & | center, | ||
const helper::io::Mesh * | mesh | ||
) |
base function to compute center of mass, mass and inertia tensor from a mesh
bool sofa::helper::generateRigid | ( | Rigid3MassType & | mass, |
type::Vec3 & | center, | ||
const std::string & | meshFilename, | ||
SReal | density, | ||
const type::Vec3 & | scale = type::Vec3(1,1,1) , |
||
const type::Vec3 & | rotation = type::Vec3(0,0,0) |
||
) |
user friendly function to compute center of mass, mass and inertia tensor from a mesh file, a density, a scale and a rotation
void sofa::helper::generateRigid | ( | Rigid3MassType & | mass, |
type::Vec3 & | center, | ||
io::Mesh * | mesh, | ||
SReal | density, | ||
const type::Vec3 & | scale = type::Vec3(1,1,1) , |
||
const type::Vec3 & | rotation = type::Vec3(0,0,0) |
||
) |
user friendly function to compute center of mass, mass and inertia tensor from a mesh, a density, a scale and a rotation
returns a copy of the string given in argument.
std::vector< std::tuple< std::string, SReal > > SOFA_HELPER_API sofa::helper::getClosestMatch | ( | const std::string & | needle, |
const std::vector< std::string > & | haystack, | ||
const Size | numEntries, | ||
const SReal | threshold | ||
) |
Search for the the closest match to the string passed in the "needle" argument within the vector of "haystack" arguments.
type::vector<Record>* sofa::helper::getCurRecords | ( | ) |
std::stack<AdvancedTimer::IdTimer>& sofa::helper::getCurTimer | ( | ) |
SOFA_HELPER_API std::string & sofa::helper::getFactoryLog | ( | ) |
std::string sofa::helper::getNoVal | ( | ) |
ReadAccessor<core::objectmodel::Data<T> > sofa::helper::getReadAccessor | ( | const core::objectmodel::Data< T > & | data | ) |
Returns a read accessor from the provided Data<> Example of use: auto points = getReadAccessor(d_points)
std::string sofa::helper::getTime | ( | ctime_t | t, |
int | niter = 1 |
||
) |
SOFA_HELPER_API std::string sofa::helper::gettypename | ( | const std::type_info & | t | ) |
Decode the type's name to a more readable form if possible.
std::string sofa::helper::getVal | ( | double | v | ) |
std::string sofa::helper::getVal | ( | double | v, |
int | niter | ||
) |
WriteAccessor<core::objectmodel::Data<T> > sofa::helper::getWriteAccessor | ( | core::objectmodel::Data< T > & | data | ) |
Returns a write only accessor from the provided Data<> Example of use: auto points = getWriteOnlyAccessor(d_points)
WriteOnlyAccessor<core::objectmodel::Data<T> > sofa::helper::getWriteOnlyAccessor | ( | core::objectmodel::Data< T > & | data | ) |
Returns a write only accessor from the provided Data<> WriteOnly accessors are faster than WriteAccessor because as the data is only read this means there is no need to pull the data from the parents Example of use: auto points = getWriteOnlyAccessor(d_points)
SOFA_HELPER_API void sofa::helper::init | ( | ) |
Initialize the SofaHelper library.
|
inline |
|
inline |
SOFA_HELPER_API bool sofa::helper::isCleanedUp | ( | ) |
Return true if and only if the SofaHelper library has been cleaned up.
|
inline |
number comparison rough floating point comparison (threshold) exact integer comparison
SOFA_HELPER_API bool sofa::helper::isInitialized | ( | ) |
Return true if and only if the SofaHelper library has been initialized.
|
inline |
number null test rough floating point test ( <= threshold) exact integer test
std::string sofa::helper::join | ( | const Container & | elems, |
const S & | delim | ||
) |
Join a container into a single string, separated by the provided delimiter.
std::string sofa::helper::join | ( | InputIt | first, |
InputIt | last, | ||
const S & | delim | ||
) |
std::string sofa::helper::join | ( | InputIt | first, |
InputIt | last, | ||
UnaryFunction | f, | ||
const S & | delim | ||
) |
template SOFA_HELPER_API void sofa::helper::logFactoryRegister | ( | const std::string & | baseclass, |
const std::string & | classname, | ||
std::string | key, | ||
bool | multi | ||
) |
void sofa::helper::logFactoryRegister | ( | const std::string & | baseclass, |
const std::string & | classname, | ||
TKey | key, | ||
bool | multi | ||
) |
Log classes registered in the factory.
template SOFA_HELPER_API void sofa::helper::logFactoryRegister< std::string > | ( | const std::string & | baseclass, |
const std::string & | classname, | ||
std::string | key, | ||
bool | multi | ||
) |
|
constexpr |
Explicit narrow conversion Inspired by the Guidelines Support Library (https://github.com/microsoft/GSL)
T | Target type |
U | Source type |
u | Value to cast |
|
constexpr |
Explicit narrow conversion checking that the value is unchanged by the cast. If the value changed, an exception is thrown Inspired by the Guidelines Support Library (https://github.com/microsoft/GSL)
|
constexprnoexcept |
Explicit narrow conversion Inspired by the Guidelines Support Library (https://github.com/microsoft/GSL)
T | Target type |
U | Source type |
u | Value to cast |
SOFA_HELPER_API std::string sofa::helper::narrowString | ( | const std::wstring & | ws | ) |
Convert a wstring to a string.
SOFA_HELPER_API int sofa::helper::nlcp_gaussseidel | ( | int | dim, |
SReal * | dfree, | ||
SReal ** | W, | ||
SReal * | f, | ||
SReal | mu, | ||
SReal | tol, | ||
int | numItMax, | ||
bool | useInitialF, | ||
bool | verbose, | ||
SReal | minW, | ||
SReal | maxF, | ||
std::vector< SReal > * | residuals, | ||
std::vector< SReal > * | violations | ||
) |
SOFA_HELPER_API int sofa::helper::nlcp_gaussseidelTimed | ( | int | dim, |
SReal * | dfree, | ||
SReal ** | W, | ||
SReal * | f, | ||
SReal | mu, | ||
SReal | tol, | ||
int | numItMax, | ||
bool | useInitialF, | ||
SReal | timeout, | ||
bool | verbose | ||
) |
SOFA_HELPER_API int sofa::helper::nlcp_multiGrid | ( | int | dim, |
SReal * | dfree, | ||
SReal ** | W, | ||
SReal * | f, | ||
SReal | mu, | ||
SReal | tol, | ||
int | numItMax, | ||
bool | useInitialF, | ||
SReal ** | W_coarse, | ||
std::vector< int > & | contact_group, | ||
unsigned int | num_group, | ||
bool | verbose | ||
) |
SOFA_HELPER_API int sofa::helper::nlcp_multiGrid_2levels | ( | int | dim, |
SReal * | dfree, | ||
SReal ** | W, | ||
SReal * | f, | ||
SReal | mu, | ||
SReal | tol, | ||
int | numItMax, | ||
bool | useInitialF, | ||
std::vector< int > & | contact_group, | ||
unsigned int | num_group, | ||
std::vector< int > & | constraint_group, | ||
std::vector< SReal > & | constraint_group_fact, | ||
bool | verbose, | ||
std::vector< SReal > * | residuals1, | ||
std::vector< SReal > * | residuals2 | ||
) |
new multigrid resolution of a problem with projection & prolongation
int sofa::helper::nlcp_multiGrid_Nlevels | ( | int | dim, |
SReal * | dfree, | ||
SReal ** | W, | ||
SReal * | f, | ||
SReal | mu, | ||
SReal | tol, | ||
int | numItMax, | ||
bool | useInitialF, | ||
std::vector< std::vector< int > > & | contact_group_hierarchy, | ||
std::vector< unsigned int > | Tab_num_group, | ||
std::vector< std::vector< int > > & | constraint_group_hierarchy, | ||
std::vector< std::vector< SReal > > & | constraint_group_fact_hierarchy, | ||
bool | verbose, | ||
std::vector< SReal > * | residualsN, | ||
std::vector< SReal > * | residualLevels, | ||
std::vector< SReal > * | violations | ||
) |
|
inline |
Monomial_LD< FReal, FN >& sofa::helper::operator* | ( | const FReal & | alpha, |
Monomial_LD< FReal, FN > & | r | ||
) |
Polynomial_LD< FReal, FN >& sofa::helper::operator* | ( | const FReal & | alpha, |
Polynomial_LD< FReal, FN > & | r | ||
) |
Comutativity of operator*(Real): Allowing to write p1=r*p2; or p1=p2*r; Polynomial_LD = Polynomial_LD*Real || Real*Polynomial_LD.
Polynomial_LD< FReal, FN >& sofa::helper::operator* | ( | const Monomial_LD< FReal, FN > & | a, |
Polynomial_LD< FReal, FN > & | r | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SOFA_HELPER_API void sofa::helper::printFactoryLog | ( | std::ostream & | out | ) |
Print factory log.
SOFA_HELPER_API void sofa::helper::printLCP | ( | SReal * | q, |
SReal ** | M, | ||
int | dim | ||
) |
SOFA_HELPER_API void sofa::helper::printLCP | ( | SReal * | q, |
SReal ** | M, | ||
SReal * | f, | ||
int | dim | ||
) |
SOFA_HELPER_API void sofa::helper::printLibraryNotCleanedUpWarning | ( | const std::string & | library, |
const std::string & | cleanupFunction | ||
) |
Print a warning about a library not being cleaned up (meant for internal use).
void sofa::helper::printNoVal | ( | std::ostream & | out | ) |
SOFA_HELPER_API void sofa::helper::printSyst | ( | SReal * | q, |
SReal ** | M, | ||
int * | base, | ||
SReal ** | mat, | ||
int | dim | ||
) |
void sofa::helper::printTime | ( | std::ostream & | out, |
ctime_t | t, | ||
int | niter = 1 |
||
) |
SOFA_HELPER_API void sofa::helper::printUninitializedLibraryWarning | ( | const std::string & | library, |
const std::string & | initFunction | ||
) |
Print a warning about a library not being initialized (meant for internal use).
void sofa::helper::printVal | ( | std::ostream & | out, |
double | v | ||
) |
void sofa::helper::printVal | ( | std::ostream & | out, |
double | v, | ||
int | niter | ||
) |
void sofa::helper::projection | ( | LCP & | fineLevel, |
LCP & | coarseLevel, | ||
int | nbContactsCoarse, | ||
const std::vector< int > & | projectionTable, | ||
const std::vector< int > & | projectionConstraints, | ||
std::vector< SReal > & | projectionValues, | ||
std::vector< bool > & | contact_is_projected, | ||
bool | verbose | ||
) |
projection function input values: LCP &fineLevel => LCP at the fine level nbContactsCoarse => number of contacts wanted at the coarse level projectionTable => Table (size = fine level) => for each contact at the fine level, provide the coarse contact verbose => output values: LCP &coarseLevel contact_is_projected => (size= fine level) => for each contact at the fine level, tell if the contact is projected or not
void sofa::helper::prolongation | ( | LCP & | fineLevel, |
LCP & | coarseLevel, | ||
const std::vector< int > & | projectionTable, | ||
const std::vector< int > & | projectionConstraints, | ||
std::vector< SReal > & | projectionValues, | ||
std::vector< bool > & | contact_is_projected, | ||
bool | verbose | ||
) |
prolongation function all parameters as input output=> change value of F in fineLevel
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SOFA_HELPER_API std::string_view sofa::helper::removeTrailingCharacter | ( | std::string_view | sv, |
char | character | ||
) |
Removes specified trailing character from a string view.
SOFA_HELPER_API std::string_view sofa::helper::removeTrailingCharacters | ( | std::string_view | sv, |
const std::initializer_list< char > | characters | ||
) |
Removes specified trailing characters from a string view.
SOFA_HELPER_API void sofa::helper::replaceAll | ( | std::string & | str, |
const std::string & | search, | ||
const std::string & | replace | ||
) |
replace all occurrence of "search" by the "replace" string.
void sofa::helper::resultToString | ( | ostream & | s, |
SReal * | f, | ||
int | dim | ||
) |
SOFA_HELPER_API void sofa::helper::resultToString | ( | std::ostream & | s, |
SReal * | f, | ||
int | dim | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
SOFA_HELPER_API std::string sofa::helper::safeCharToString | ( | const char * | c | ) |
converts a char* string into a c++ string. The special case with nullptr is coerced to an empty string.
|
inline |
void sofa::helper::setCurRecords | ( | type::vector< Record > * | ptr | ) |
|
inline |
|
inline |
|
inline |
|
inline |
sofa::helper::SOFA_LCPCALC_AFFICHELCP_DISABLED | ( | ) |
SReal SReal SReal* sofa::helper::SOFA_LCPCALC_AFFICHESYST_DISABLED | ( | ) |
sofa::helper::SOFA_LCPCALC_RESOUDRELCP_DISABLED | ( | ) |
sofa::helper::SOFA_THREAD_SPECIFIC_PTR | ( | std::stack< AdvancedTimer::IdTimer > | , |
curTimerThread | |||
) |
sofa::helper::SOFA_THREAD_SPECIFIC_PTR | ( | type::vector< Record > | , |
curRecordsThread | |||
) |
type::Mat<NumRows, NumCols, Real> sofa::helper::sofaMat | ( | const Eigen::Matrix< Real, NumRows, NumCols > & | emat | ) |
type::Vec<NumRows, Real> sofa::helper::sofaVec | ( | const Eigen::Matrix< Real, NumRows, 1 > & | evec | ) |
SOFA_HELPER_API int sofa::helper::solveLCP | ( | int | dim, |
SReal * | q, | ||
SReal ** | M, | ||
SReal * | res | ||
) |
type::vector<unsigned> sofa::helper::sortedPermutation | ( | const Container & | values | ) |
Return a sorted permutation of the container, i.e. a list of indices corresponding to increasing entries.
std::vector< std::string > SOFA_HELPER_API sofa::helper::split | ( | const std::string & | s, |
char | delimiter | ||
) |
Taken from https://www.fluentcpp.com/2017/04/21/how-to-split-a-string-in-c/.
Split one string by a given delimiter and returns that into a std::vector.
|
inline |
|
inline |
Define random methods srand and rand for double and int used only for the tests now.
SOFA_HELPER_API bool sofa::helper::starts_with | ( | const std::string & | prefix, |
const std::string & | full | ||
) |
returns true if the prefix if located at the beginning of the "full" string.
double sofa::helper::strToDouble | ( | std::string const & | stringToConvert, |
std::size_t const | precision | ||
) |
|
inline |
SOFA_HELPER_API std::string sofa::helper::upcaseString | ( | const std::string & | s | ) |
Convert a string to upper case.
void SOFA_HELPER_API sofa::helper::vector_access_failure | ( | const void * | vec, |
unsigned | size, | ||
unsigned | i, | ||
const std::type_info & | type, | ||
const char * | tindex | ||
) |
SOFA_HELPER_API std::wstring sofa::helper::widenString | ( | const std::string & | s | ) |
Convert a string to a wstring.
std::atomic<int> sofa::helper::activeTimers |
SReal SReal SReal SReal int* sofa::helper::base |
template class SOFA_HELPER_API sofa::helper::Decompose< double > |
template class SOFA_HELPER_API sofa::helper::Decompose< float > |
SReal SReal int sofa::helper::dim = delete |
SReal SReal* sofa::helper::f |
|
constexpr |
If true, narrow_cast will check if the value changed after the narrow conversion. Otherwise, no check is performed.
std::mutex sofa::helper::kMutex |
TagList sofa::helper::kTagList { {"0", "Visual"} } |
SReal ** sofa::helper::M |
SOFA_HELPER_API const int sofa::helper::MarchingCubeEdgeTable |
SOFA_HELPER_API const int sofa::helper::MarchingCubeFaceTable |
SOFA_HELPER_API const int sofa::helper::MarchingCubeTriTable |
SReal SReal SReal SReal int SReal** sofa::helper::mat |
template class SOFA_HELPER_API sofa::helper::Monomial_LD< double, 1 > |
template class SOFA_HELPER_API sofa::helper::Monomial_LD< double, 2 > |
template class SOFA_HELPER_API sofa::helper::Monomial_LD< double, 3 > |
template class SOFA_HELPER_API sofa::helper::Monomial_LD< double, 4 > |
template class SOFA_HELPER_API sofa::helper::Monomial_LD< double, 5 > |
template class SOFA_HELPER_API sofa::helper::Polynomial_LD< double, 1 > |
template class SOFA_HELPER_API sofa::helper::Polynomial_LD< double, 2 > |
template class SOFA_HELPER_API sofa::helper::Polynomial_LD< double, 3 > |
template class SOFA_HELPER_API sofa::helper::Polynomial_LD< double, 4 > |
template class SOFA_HELPER_API sofa::helper::Polynomial_LD< double, 5 > |
AdvancedTimer::SyncCallBack sofa::helper::syncCallBack = nullptr |
void* sofa::helper::syncCallBackData = nullptr |
std::map< AdvancedTimer::IdTimer, TimerData > sofa::helper::timers |