Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions autoconf/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ AC_PROG_AWK
AC_PROG_CC
AC_PROG_CXX

dnl do not test gcc version on mac. clang as gcc will return version and it's not >= 4.8
dnl do not test gcc version on mac. clang as gcc will return version and it's not >= 5
AS_IF([test "$ON_MAC" = "no"],[TR_GCC_VERSION],[])
dnl if the compiler is gcc, test for gcc >= 4.8
dnl if the compiler is gcc, test for gcc >= 5
AS_IF([test "x$GCC_VERSION" = "x"],[],
[AC_MSG_CHECKING([gcc version >= 4.8])
AX_COMPARE_VERSION([$GCC_VERSION],[ge],[4.8], [AC_MSG_RESULT([yes])],
[AC_MSG_CHECKING([gcc version >= 5])
AX_COMPARE_VERSION([$GCC_VERSION],[ge],[5], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Trick requires gcc version >= 4.8])
AC_MSG_ERROR([Trick requires gcc version >= 5])
])
])
dnl Save the full path of the compiler
Expand Down Expand Up @@ -210,12 +210,12 @@ AS_IF([test "$ac_cv_path_CLANG" = "noclang"],AC_MSG_ERROR([could not find clang]
AC_SUBST([LLVM_HOME])

TR_CLANG_VERSION
dnl if llvm/clang, test for version >= 3.4.2
dnl if llvm/clang, test for version >= 5
AS_IF([test "x$CLANG_VERSION" = "x"],[],
[AC_MSG_CHECKING([clang version >= 3.4.2])
AX_COMPARE_VERSION([$CLANG_VERSION],[ge],[3.4.2], [AC_MSG_RESULT([yes])],
[AC_MSG_CHECKING([clang version >= 5])
AX_COMPARE_VERSION([$CLANG_VERSION],[ge],[5], [AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Trick requires llvm/clang version >= 3.4.2])
AC_MSG_ERROR([Trick requires llvm/clang version >= 5])
])
])

Expand Down
394 changes: 153 additions & 241 deletions configure

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/documentation/install_guide/Install-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Trick requires various free third party utilities in order to function. All the

| Utility | Version | Description | Usage | Notes |
| --------------: | :-----: | :---------------------: | :------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [gcc] and `g++` | 4.8+ | C/C++ Compiler | Compiles Trick and Trick simulations. | |
| [clang]/[llvm] | <=22 | C/C++ Compiler | Utilized by the interface code generator. | Trick Versions <= 19.3 should use LLVM <= 9. Trick Versions < 25.0 should use LLVM < 20. Please open an issue if you encounter a problem related to newer versions of LLVM. |
| [gcc] and `g++` | 5+ | C/C++ Compiler | Compiles Trick and Trick simulations. | |
| [clang]/[llvm] | 5 - 22 | C/C++ Compiler | Utilized by the interface code generator. | Trick Versions <= 19.3 should use LLVM <= 9. Trick Versions < 25.0 should use LLVM < 20. Please open an issue if you encounter a problem related to newer versions of LLVM. |
| [python] | 3.x | Programming Language | Lets the user interact with a simulation. | Trick has been tested up to python 3.13.2 as of 04/2025. |
| [perl] | 5.6+ | Programming Language | Allows executable scripts in the bin directory to run. | |
| [java] | 11+ | Programming Language | Necessary for Trick GUIs. | |
Expand Down
34 changes: 12 additions & 22 deletions docs/not_referenced/Monte-Carlo.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,27 +184,17 @@ generate the value for the variable from run to run.
(use Trick::MonteVarRandom::set_min_is_relative, Trick::MonteVarRandom::set_max_is_relative)
- <b> FLAT</b>: Uniform distribution. No bell. Returns uniform random values between (-\f$\infty\f$, +\f$\infty\f$) bracketed
optionally by [min, max]. (use Trick::MonteVarRandom::set_min, Trick::MonteVarRandom::set_max)
- engine - the C++11 predefined pseudo-random engine type. NO_ENGINE is the default (results in Trick coded random number engine).
Other options using the C++11 <random> facilities of the Standard Template Library:
(Requires --std=c++0x or --std=c++11 on Trick configure command line when building Trick.)
- TRICK_DEFAULT_ENGINE - <b>SUGGESTED FOR USE</b>. std::ranlux_base_01 for c++0x, std::mt19937 for c++11
- C++ TR1 options: (pre-C++11 compiler, GCC versions 4.4 through 4.6).
(Requires --std=c++0x on Trick configure command line when building Trick.)
- RANLUX_BASE_01_ENGINE - std::ranlux_base_01 Engine
- RANLUX_64_BASE_01_ENGINE - std::ranlux64_base_01 Engine
- (others such as std::mt19937 not provided, because they return
outside the canonical 0 <= x < 1 range in some GCC versions,
which can cause infinite loops in distributions.)
- C++11 options: (C++11 compiler, versions 4.7, 4.8).
(Requires --std=c++11 on Trick configure command line when building Trick.)
- MINSTD_RAND_ENGINE - std::minstd_rand Minimal Standard Linear Congruential Engine
- MT19937_ENGINE - std::mt19937 Mersenne Twister Engine. Said to provide better behavior than Linear Congruential Engines.
- MT19937_64_ENGINE - std::mt19937_64 64 bit Mersenne Twister Engine.
- RANLUX_24_BASE_ENGINE - std::ranlux24_base Engine
- RANLUX_44_BASE_ENGINE - std::ranlux48_base Engine
- RANLUX_24_ENGINE - std::ranlux24 Engine
- RANLUX_44_ENGINE - std::ranlux48 Engine
- KNUTH_B_ENGINE - std::knuth_b Engine
- engine - the predefined pseudo-random engine type. NO_ENGINE is the default (results in Trick coded random number engine).
All other options use the &lt;random&gt; facilities of the C++ Standard Library:
- TRICK_DEFAULT_ENGINE - <b>SUGGESTED FOR USE</b>. std::mt19937 Mersenne Twister Engine
- MINSTD_RAND_ENGINE - std::minstd_rand Minimal Standard Linear Congruential Engine
- MT19937_ENGINE - std::mt19937 Mersenne Twister Engine. Said to provide better behavior than Linear Congruential Engines.
- MT19937_64_ENGINE - std::mt19937_64 64 bit Mersenne Twister Engine.
- RANLUX_24_BASE_ENGINE - std::ranlux24_base Engine
- RANLUX_44_BASE_ENGINE - std::ranlux48_base Engine
- RANLUX_24_ENGINE - std::ranlux24 Engine
- RANLUX_44_ENGINE - std::ranlux48 Engine
- KNUTH_B_ENGINE - std::knuth_b Engine

After constructing such a variable, it can be added via:

Expand Down Expand Up @@ -429,4 +419,4 @@ This is the order in which jobs are executed in a MonteCarlo sim:
- ::mc_read
- ::mc_get_connection_device
- ::mc_set_current_run
- ::mc_get_current_run
- ::mc_get_current_run
8 changes: 2 additions & 6 deletions include/trick/Euler_Cromer_Integrator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,9 @@ namespace Trick {

void deriv2_in(double* arg1, ...)
#ifndef SWIGPYTHON
#ifdef __GNUC__
#if __GNUC__ >= 4
__attribute__((sentinel))
#endif
#endif
__attribute__((sentinel))
#endif
;
;
void initialize( int State_size, double Dt);
int integrate();
Integrator_type get_Integrator_type() { return(Euler_Cromer); } ;
Expand Down
17 changes: 7 additions & 10 deletions include/trick/Event.hh
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,13 @@ class Event {


#ifndef SWIG
// No need to inherit from binary_function for c++11 or later
#if __cplusplus >= 201103L
struct CompareEventPtrs {
#else
struct CompareEventPtrs : public std::binary_function<Trick::Event *, Trick::Event *, bool> {
#endif
bool operator()(const Trick::Event * lhs, const Trick::Event * rhs) const {
return lhs->get_next_tics() < rhs->get_next_tics();
}
};
struct CompareEventPtrs
{
bool operator()(const Trick::Event* lhs, const Trick::Event* rhs) const
{
return lhs->get_next_tics() < rhs->get_next_tics();
}
};
#endif

}
Expand Down
5 changes: 2 additions & 3 deletions include/trick/ExecutiveException.hh
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ namespace Trick {

/** This constructor assignes ret_code, file, and message to the incoming arguments */
ExecutiveException( int in_ret , std::string in_file , int line , std::string in_message ) ;
virtual ~ExecutiveException() throw () ;
virtual const char* what() const throw() ;
virtual ~ExecutiveException();
virtual const char* what() const noexcept;
} ;

}

#endif

38 changes: 11 additions & 27 deletions include/trick/Integrator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -71,52 +71,36 @@ namespace Trick {
#ifndef SWIGPYTHON
virtual void state_in(double* arg1, va_list argp);
#endif
void state_in (double* arg1, ...)
void state_in(double* arg1, ...)
#ifndef SWIGPYTHON
#ifdef __GNUC__
#if __GNUC__ >= 4
__attribute__((sentinel))
#endif
#endif
__attribute__((sentinel))
#endif
;
;
#ifndef SWIGPYTHON
virtual void deriv_in(double* arg1, va_list argp);
#endif
void deriv_in (double* arg1, ...)
void deriv_in(double* arg1, ...)
#ifndef SWIGPYTHON
#ifdef __GNUC__
#if __GNUC__ >= 4
__attribute__((sentinel))
#endif
#endif
__attribute__((sentinel))
#endif
;
;
#ifndef SWIGPYTHON
virtual void state_out(double* arg1, va_list argp);
#endif
void state_out(double* arg1, ...)
#ifndef SWIGPYTHON
#ifdef __GNUC__
#if __GNUC__ >= 4
__attribute__((sentinel))
#endif
#endif
__attribute__((sentinel))
#endif
;
;

#ifndef SWIGPYTHON
virtual void deriv2_in(double* arg1, va_list argp);
#endif
void deriv2_in (double* arg1, ...)
void deriv2_in(double* arg1, ...)
#ifndef SWIGPYTHON
#ifdef __GNUC__
#if __GNUC__ >= 4
__attribute__((sentinel))
#endif
#endif
__attribute__((sentinel))
#endif
;
;

int num_state;

Expand Down
68 changes: 27 additions & 41 deletions include/trick/MonteVarRandom.hh
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,33 @@ namespace Trick {
class MonteVarRandom : public Trick::MonteVar {

public:
///@brief Random number generation engine type.
///
///@details Used for TR1 and C++11 random number generation facilities
///
///@note: Values for this type must match those of StlRandomGenerator::StlEngine
///
enum StlEngine {
NO_ENGINE = 0, /**< -- This selection causes the Trick hand coded fallback algorithms to be used */

TRICK_DEFAULT_ENGINE = 1, /**< -- std::ranlux_base_01 for TR1, std::mt19937 for _HAVE_STD_RANDOM */

#ifdef _HAVE_TR1_RANDOM
RANLUX_BASE_01_ENGINE = 2, /**< -- TR1 only std::ranlux_base_01 Engine, note: replaced for c++11 */
RANLUX_64_BASE_01_ENGINE = 3, /**< -- TR1 only std::ranlux64_base_01 Engine, note: replaced for c++11 */
#endif

#ifdef _HAVE_STL_RANDOM
// NOTE: MINSTD_RAND_ENGINE and MT19937_ENGINE return out of canonical range
// for (at least) GCC 4.4.7,so are not provided for _HAVE_TR1_RANDOM

MINSTD_RAND_ENGINE = 2, /**< -- std::minstd_rand Minimal Standard Linear Congruential Engine */
MT19937_ENGINE = 3, /**< -- std::mt19937 Mersenne Twister Engine */

MT19937_64_ENGINE = 4, /**< -- std::mt19937_64 64 bit Mersenne Twister Engine. Not available TR1 */

RANLUX_24_BASE_ENGINE = 5, /**< -- std::ranlux24_base Engine */
RANLUX_44_BASE_ENGINE = 6, /**< -- std::ranlux48_base Engine */

RANLUX_24_ENGINE = 7, /**< -- std::ranlux24 Engine */
RANLUX_44_ENGINE = 8, /**< -- std::ranlux48 Engine */

KNUTH_B_ENGINE = 9 /**< -- std::knuth_b Engine */
#endif
};

/** A random distribution. */
enum Distribution {
GAUSSIAN = TRICK_GSL_GAUSS, /**< Gaussian distribution */
FLAT = TRICK_GSL_FLAT, /**< flat distribution */
POISSON = TRICK_GSL_POISSON /**< Poisson distribution */
};
///@brief Random number generation engine type.
///
///@details Used for the C++ <random> number generation facilities
///
///@note: Values for this type must match those of StlRandomGenerator::StlEngine
///
enum StlEngine
{
NO_ENGINE = 0, /**< -- This selection causes the Trick hand coded fallback algorithms to be used */
TRICK_DEFAULT_ENGINE = 1, /**< -- std::mt19937 Mersenne Twister Engine */
MINSTD_RAND_ENGINE = 2, /**< -- std::minstd_rand Minimal Standard Linear Congruential Engine */
MT19937_ENGINE = 3, /**< -- std::mt19937 Mersenne Twister Engine */
MT19937_64_ENGINE = 4, /**< -- std::mt19937_64 64 bit Mersenne Twister Engine */
RANLUX_24_BASE_ENGINE = 5, /**< -- std::ranlux24_base Engine */
RANLUX_44_BASE_ENGINE = 6, /**< -- std::ranlux48_base Engine */
RANLUX_24_ENGINE = 7, /**< -- std::ranlux24 Engine */
RANLUX_44_ENGINE = 8, /**< -- std::ranlux48 Engine */
KNUTH_B_ENGINE = 9 /**< -- std::knuth_b Engine */
};

/** A random distribution. */
enum Distribution
{
GAUSSIAN = TRICK_GSL_GAUSS, /**< Gaussian distribution */
FLAT = TRICK_GSL_FLAT, /**< flat distribution */
POISSON = TRICK_GSL_POISSON /**< Poisson distribution */
};

protected:
/** Engine. */
Expand Down
Loading
Loading