Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tf_util.h File Reference
#include "TissueForge_private.h"
#include <Magnum/Magnum.h>
#include <Magnum/Math/Color.h>
#include <bitset>
#include <tf_cycle.h>
#include <string>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cmath>
#include <limits>
#include <type_traits>
Include dependency graph for tf_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TissueForge::util::CompileFlags
 
class  TissueForge::util::WallTime
 
class  TissueForge::util::PerformanceTimer
 
struct  TissueForge::util::Differentiator
 

Namespaces

namespace  TissueForge
 Include Python header, disable linking to pythonX_d.lib on Windows in debug mode.
 
namespace  TissueForge::util
 Tissue Forge utilities.
 

Typedefs

typedef std::mt19937 TissueForge::RandomType
 

Enumerations

enum class  PointsType : unsigned int {
  Sphere , SolidSphere , Disk , SolidCube ,
  Cube , Ring
}
 
enum  InstructionSetFlags : std::int64_t {
  IS_3DNOW = 1ll << 0 , IS_3DNOWEXT = 1ll << 1 , IS_ABM = 1ll << 2 , IS_ADX = 1ll << 3 ,
  IS_AES = 1ll << 4 , IS_AVX = 1ll << 5 , IS_AVX2 = 1ll << 6 , IS_AVX512CD = 1ll << 7 ,
  IS_AVX512ER = 1ll << 8 , IS_AVX512F = 1ll << 9 , IS_AVX512PF = 1ll << 10 , IS_BMI1 = 1ll << 11 ,
  IS_BMI2 = 1ll << 12 , IS_CLFSH = 1ll << 13 , IS_CMPXCHG16B = 1ll << 14 , IS_CX8 = 1ll << 15 ,
  IS_ERMS = 1ll << 16 , IS_F16C = 1ll << 17 , IS_FMA = 1ll << 18 , IS_FSGSBASE = 1ll << 19 ,
  IS_FXSR = 1ll << 20 , IS_HLE = 1ll << 21 , IS_INVPCID = 1ll << 23 , IS_LAHF = 1ll << 24 ,
  IS_LZCNT = 1ll << 25 , IS_MMX = 1ll << 26 , IS_MMXEXT = 1ll << 27 , IS_MONITOR = 1ll << 28 ,
  IS_MOVBE = 1ll << 28 , IS_MSR = 1ll << 29 , IS_OSXSAVE = 1ll << 30 , IS_PCLMULQDQ = 1ll << 31 ,
  IS_POPCNT = 1ll << 32 , IS_PREFETCHWT1 = 1ll << 33 , IS_RDRAND = 1ll << 34 , IS_RDSEED = 1ll << 35 ,
  IS_RDTSCP = 1ll << 36 , IS_RTM = 1ll << 37 , IS_SEP = 1ll << 38 , IS_SHA = 1ll << 39 ,
  IS_SSE = 1ll << 40 , IS_SSE2 = 1ll << 41 , IS_SSE3 = 1ll << 42 , IS_SSE41 = 1ll << 43 ,
  IS_SSE42 = 1ll << 44 , IS_SSE4a = 1ll << 45 , IS_SSSE3 = 1ll << 46 , IS_SYSCALL = 1ll << 47 ,
  IS_TBM = 1ll << 48 , IS_XOP = 1ll << 49 , IS_XSAVE = 1ll << 50
}
 

Functions

RandomType & TissueForge::randomEngine ()
 
unsigned int TissueForge::getSeed ()
 Get the current seed for the pseudo-random number generator.
 
HRESULT TissueForge::setSeed (const unsigned int *_seed=0)
 Set the current seed for the pseudo-random number generator.
 
std::vector< std::string > TissueForge::color3Names ()
 Get the names of all available colors.
 
FVector4 TissueForge::planeEquation (const FVector3 &normal, const FVector3 &point)
 Get the coefficients of a plane equation for a normal vector and point.
 
std::tuple< FVector3 FVector3TissueForge::planeEquation (const FVector4 &planeEq)
 Get the plane normal and a plane point from the coefficients of a plane equation.
 
FVector3 TissueForge::randomPoint (const PointsType &kind, const FloatP_t &dr=0, const FloatP_t &phi0=0, const FloatP_t &phi1=M_PI)
 Get the coordinates of a random point in a kind of shape.
 
std::vector< FVector3TissueForge::randomPoints (const PointsType &kind, const int &n=1, const FloatP_t &dr=0, const FloatP_t &phi0=0, const FloatP_t &phi1=M_PI)
 Get the coordinates of random points in a kind of shape.
 
std::vector< FVector3TissueForge::points (const PointsType &kind, const unsigned int &n=1)
 Get the coordinates of uniform points in a kind of shape.
 
std::vector< FVector3TissueForge::filledCubeUniform (const FVector3 &corner1, const FVector3 &corner2, const unsigned int &nParticlesX=2, const unsigned int &nParticlesY=2, const unsigned int &nParticlesZ=2)
 Get the coordinates of a uniformly filled cube.
 
std::vector< FVector3TissueForge::filledCubeRandom (const FVector3 &corner1, const FVector3 &corner2, const int &nParticles)
 Get the coordinates of a randomly filled cube.
 
HRESULT TissueForge::icosphere (const int subdivisions, FloatP_t phi0, FloatP_t phi1, std::vector< FVector3 > &verts, std::vector< int32_t > &inds)
 Get the coordinates of an icosphere.
 
FVector3 TissueForge::randomVector (FloatP_t mean, FloatP_t std)
 Generates a randomly oriented vector with random magnitude with given mean and standard deviation according to a normal distribution.
 
FVector3 TissueForge::randomUnitVector ()
 Generates a randomly oriented unit vector.
 
template<class T >
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type TissueForge::almost_equal (T x, T y, int ulp=2)
 
void * TissueForge::aligned_Malloc (size_t size, size_t alignment)
 
void TissueForge::aligned_Free (void *mem)
 
Magnum::Color3 TissueForge::util::Color3_Parse (const std::string &str)
 
template<typename XType , typename DivType >
XType TissueForge::util::mod (XType x, DivType divisor)
 
template<typename TA , typename TN >
TA TissueForge::util::flooredDivision (TA a, TN n)
 
template<typename TA , typename TN >
TA TissueForge::util::flooredModulo (TA a, TN n)
 
template<typename TA , typename TN >
TA TissueForge::util::loopIndex (TA index, TN range)
 
template<typename Vec , typename Val >
int TissueForge::util::indexOf (const Vec &vec, const Val &val)
 
template<typename ContainerType , typename SizeType >
ContainerType::value_type TissueForge::util::wrappedAt (ContainerType &container, SizeType index)
 
template<typename Type , typename Klass >
constexpr size_t TissueForge::util::offset_of (Type Klass::*member)
 
std::unordered_map< std::string bool > TissueForge::util::getFeaturesMap ()
 
double TissueForge::util::wallTime ()
 
double TissueForge::util::CPUTime ()
 
uint64_t TissueForge::util::nextPrime (const uint64_t &start_prime)
 
std::vector< uint64_t > TissueForge::util::findPrimes (const uint64_t &start_prime, int n)
 Get prime numbers, beginning with a starting prime number.
 
template<typename T >
std::vector< T > TissueForge::util::unique (const std::vector< T > &vec)
 Get the unique elements of a vector.
 

Variables

const char * TissueForge::util::color3_Names []