Remove trailing whitespaces

Makes it easier to edit the files. So if we press 'end of line' we are
really at the end of line.
This commit is contained in:
Michael Vetter 2016-11-08 10:25:07 +01:00
parent eedd0783cd
commit 18f0d7e871
337 changed files with 2186 additions and 2186 deletions
include/trick
test
trick_sims

View File

@ -15,7 +15,7 @@ namespace Trick {
class ADefParseContext {
public:
public:
int debug ; /**< -- Debug level */
std::istream *is; /**< ** Input Stream */

View File

@ -21,11 +21,11 @@ namespace Trick {
typedef struct {
VarNameElementType type;
int index;
std::string name;
std::string name;
} VarNameElement;
/**
Base Class for dumping a checkpoint.
Base Class for dumping a checkpoint.
*/
class CheckPointAgent {
@ -60,7 +60,7 @@ namespace Trick {
Push struct element name onto the left-side name stack.
*/
virtual void push_struct_elem( const char* name) ;
/**
Push array element index onto the left-side name stack.
*/
@ -76,8 +76,8 @@ namespace Trick {
object to the name on the left-side stack.
*/
virtual void assign_rvalue( std::ostream& chkpnt_os,
void* address,
ATTRIBUTES* attr,
void* address,
ATTRIBUTES* attr,
int curr_dim,
int offset
)=0;

View File

@ -218,7 +218,7 @@ namespace Trick {
@par Python Usage:
@code trick.checkpoint() @endcode
@param file_name - optional: name of checkpoint file to dump (default is "chkpnt_<time>")
@param print_status - optional: boolean yes (C integer 1) = print the dump checkpoint status message
@param print_status - optional: boolean yes (C integer 1) = print the dump checkpoint status message
@param obj_list_str - optional: sim objects list string for checkpointing (default is dump all)
@return always 0
*/
@ -243,7 +243,7 @@ namespace Trick {
@par Python Usage:
@code trick.dmtcp_checkpoint() @endcode
@param file_name - optional: name of checkpoint file to dump (default is "dmtcp_chkpnt_<time>")
@param print_status - optional: boolean yes (C integer 1) = print the dump checkpoint status message
@param print_status - optional: boolean yes (C integer 1) = print the dump checkpoint status message
@param obj_list_str - optional: sim objects list string for checkpointing (default is dump all)
@return always 0
*/
@ -261,7 +261,7 @@ namespace Trick {
virtual int dmtcp_checkpoint(double in_time) ;
/* helper function to generate DMTCP restart script file name */
void setDMTCPFilename( std::string file_name = "");
void setDMTCPFilename( std::string file_name = "");
/**
* Executes the pre_init_checkpoint

View File

@ -12,7 +12,7 @@
*/
class ChkPtParseContext {
public:
public:
int debug ; /**< -- Debug level */
int verify_input; /**< -- Verify input runstream syntax flag */

View File

@ -10,7 +10,7 @@ namespace Trick {
/**
This class provides checkpointing.
@author John M. Penn
@author John M. Penn
*/
class ClassicCheckPointAgent: public CheckPointAgent {
@ -52,8 +52,8 @@ namespace Trick {
@param address Address of the variable.
@param attr ATTRIBUTES of the variable.
@param curr_dim
@param offset
@param curr_dim
@param offset
*/
void assign_rvalue( std::ostream& chkpnt_os, void* address, ATTRIBUTES* attr, int curr_dim, int offset);
@ -68,11 +68,11 @@ namespace Trick {
Confirm that the value of an intrinsic typed sub-element, at the specified offset,
within the object at the given address, is zero.
To check the entire object at the address, call with curr_dim=0 and offset=0;
@param address - address of the object within which we are checking for nil values.
@param attr - attr describing the object at the address.
@param curr_dim - dimension of the sub-element being checked.
@param offset - offset of the sub-element
@param attr - attr describing the object at the address.
@param curr_dim - dimension of the sub-element being checked.
@param offset - offset of the sub-element
@param offset - if the object specified by @b address and @b attr is arrayed, then this
parameter specifies where, within the array, the sub-object to be
checked, is located.
@ -86,7 +86,7 @@ namespace Trick {
The pointer must be an address that is being managed by MM (the MemoryManager) or a
character string (char* or wchar_t*).
@param pointer
@param pointer
@param attr ATTRIBUTES of the pointer.
@param curr_dim current dimension.
@return text expression that represents the pointer.
@ -105,7 +105,7 @@ namespace Trick {
*/
std::string left_side_name();
/**
/**
I NEED DOCUMENTATION!
*/
std::string get_var_name( void* addr,
@ -114,19 +114,19 @@ namespace Trick {
std::string name,
ATTRIBUTES** left_type);
/**
/**
Write a single value of an intrinsic type located at the given address and offset.
@param address - address of the object that contains the value to be written.
@param attr - ATTRIBUTES of the object that contains the value to be written.
@param offset - if the object specified by address and attr is arrayed, then this
parameter specifies where, within the array the single value is
located. @c offset=0 means that the address points to the value
to be written.
to be written.
*/
void write_singleton( std::ostream& chkpnt_os, void* address, ATTRIBUTES* attr, int offset);
/**
/**
I NEED DOCUMENTATION!
*/
void write_rvalue( std::ostream& chkpnt_os, void* address, ATTRIBUTES* attr, int curr_dim, int offset);

View File

@ -95,7 +95,7 @@ namespace Trick {
std::string & get_input_file_ref() ;
/**
@brief @userdesc Command to get the default directory.
@brief @userdesc Command to get the default directory.
@par Python Usage:
@code <my_default_dir> = trick.command_line_args_get_default_dir() @endcode
@return string default_dir

View File

@ -35,7 +35,7 @@ namespace Trick {
void dmtcpSystemCmd( const std::string& str );
void dmtcpCleanup();
void dmtcpSafestoreDir();
void dmtcpRenameCmd();
void dmtcpRenameCmd();
bool isSpecialCharacter( const std::string& str );

View File

@ -56,7 +56,7 @@ namespace Trick {
#ifndef SWIG
/**
@brief DRAscii default constructor.
@brief DRAscii default constructor.
*/
DRAscii() {}
#endif
@ -94,17 +94,17 @@ namespace Trick {
@brief @userdesc Command to set the printf format for the group's float variable values in the
log file (default is "%20.8g").
@par Python Usage:
@code <dr_group>.set_ascii_float_format("<in_ascii_float_format>") @endcode
@code <dr_group>.set_ascii_float_format("<in_ascii_float_format>") @endcode
@param in_ascii_float_format - printf format string
@return always 0
*/
int set_ascii_float_format(std::string in_ascii_float_format) ;
/**
@brief @userdesc Command to set the printf format for the group's double variable values in the
@brief @userdesc Command to set the printf format for the group's double variable values in the
log file (default is "%20.16g"). If single_prec_only is set, then default is "%20.8g".
@par Python Usage:
@code <dr_group>.set_ascii_double_format("<in_ascii_double_format>") @endcode
@code <dr_group>.set_ascii_double_format("<in_ascii_double_format>") @endcode
@param in_ascii_double_format - printf format string
@return always 0
*/
@ -115,7 +115,7 @@ namespace Trick {
file (default is ","). When the delimiter is a comma (","), the log file name
extension will be .csv, otherwise the log file extension will be .txt.
@par Python Usage:
@code <dr_group>.set_delimiter("<in_delimiter>") @endcode
@code <dr_group>.set_delimiter("<in_delimiter>") @endcode
@param in_delimiter - the delimiter string
@return always 0
*/
@ -125,7 +125,7 @@ namespace Trick {
@brief @userdesc Command to print double variable values as single precision (float) in the log file
to save space (default is false).
@par Python Usage:
@code <dr_group>.set_single_prec_only(<in_single_prec_only>) @endcode
@code <dr_group>.set_single_prec_only(<in_single_prec_only>) @endcode
@param in_single_prec_only - boolean true indicates print doubles as single precision
@return always 0
*/

View File

@ -81,7 +81,7 @@ namespace Trick {
#ifndef SWIG
/**
@brief DRBinary default constructor.
@brief DRBinary default constructor.
*/
DRBinary() {}
#endif

View File

@ -52,7 +52,7 @@ namespace Trick {
Trick 07 to the current version. The contents of the file are binary and is not included here. The HDF5 layout
of the file follows.
@verbatim
@verbatim
GROUP "/" {
GROUP "header" {
DATASET "file_names" {
@ -89,7 +89,7 @@ GROUP "/" {
#ifndef SWIG
/**
@brief DRHDF5 default constructor.
@brief DRHDF5 default constructor.
*/
DRHDF5() {}
#endif

View File

@ -1,4 +1,4 @@
/*
/*
* PURPOSE:
* ( )
*/

View File

@ -364,7 +364,7 @@ class IntegLoopScheduler;
/**
* Create a SimObjectIntegInfo that represents the specified sim object,
* adding the representation to the set of such and populating the
* adding the representation to the set of such and populating the
* object with the jobs in the sim object that pertain to integration.
* @param sim_object The sim object to be represented.
*/

View File

@ -21,7 +21,7 @@
#endif
*/
/**
/**
* Below are the supported types of integration schemes.
*/
typedef enum {
@ -128,7 +128,7 @@ namespace Trick {
virtual void set_verbosity(int level);
virtual void reset() {}
virtual Integrator_type get_Integrator_type() { return (User_Defined); };
};
Integrator* getIntegrator( Integrator_type Alg, unsigned int State_size, double Dt = 0.0 );

View File

@ -13,7 +13,7 @@ namespace Trick {
: table(Table),
breakPointArrays(BreakPointArrays),
breakPointArraySizes(BreakPointArraySizes),
nParams(NParams) {};
nParams(NParams) {};
double eval (double param1, ...) throw(std::logic_error) ;
double eval (double params[]) throw(std::logic_error) ;

View File

@ -38,7 +38,7 @@ PROGRAMMERS:
#define MSQ_INIT(q) q##_front = q##_back = 0
#define MSQ_ISEMPTY(q) (q##_front==q##_back)
#define MSQ_FRONT(q) q[q##_front]
#define MSQ_POP(q) ++q##_front %= (MSQ_MAXSIZE)
#define MSQ_POP(q) ++q##_front %= (MSQ_MAXSIZE)
#define MSQ_SIZE(q) q##_back-q##_front
#define MSQ_PUSH(q,data) q[q##_back] = data ; ++q##_back %= (MSQ_MAXSIZE)
//-----------------------------------------------------------------------------
@ -47,9 +47,9 @@ namespace Trick {
/**
* This class is shared memory based MSConnect class to connect master and slaves.
* It defines the master/slave connection calls as well as the calls used by
* both sides to send the time and mode commands.
*
* It defines the master/slave connection calls as well as the calls used by
* both sides to send the time and mode commands.
*
* @author Eddie J. Paddock (Apr 1996)
* @author Scott Killingsworth (Sep 1997)
* @author Many other Trick developers of the past
@ -66,8 +66,8 @@ namespace Trick {
MSQ_DECLARE (master_command, MS_SIM_COMMAND)
MSQ_DECLARE (slave_command, MS_SIM_COMMAND)
// checkpoint data is not sent every frame, so dont need a queue
int slave_port; /**< trick_units(--) slave's dmtcp checkpoint port */
char chkpnt_name[256]; /**< trick_units(--) checkpoint dir/filename */
int slave_port; /**< trick_units(--) slave's dmtcp checkpoint port */
char chkpnt_name[256]; /**< trick_units(--) checkpoint dir/filename */
} MSSharedMemData;
class MSSharedMem : public MSConnect {
@ -88,7 +88,7 @@ namespace Trick {
/**
@brief Sets the wait time limit for communications between the master and slaves.
Any @c in_limit <= 0.0 means an infinite wait limit.
@param in_limit - the desired wait limit.
@param in_limit - the desired wait limit.
@return always 0
*/
virtual int set_sync_wait_limit(double in_limit) ;

View File

@ -57,7 +57,7 @@ typedef struct _MapStrToPtr
/* create and initialize a table that maps strings to pointers.
The size specifies the number of lists maintained by the map. For maximum efficiency use a prime
number for nSize that is close to the average number of elements being stored in the table.
number for nSize that is close to the average number of elements being stored in the table.
The string to pointer map can store an arbitrary number of elements with the maximum size
being limited by the computer's memory
*/
@ -68,7 +68,7 @@ MapStrToPtr* SM_Create(int nSize);
/* delete a map that associates strings with pointers
this does not free the user-defined data that the table is storing.. enumerate through the table and
remove all user-defined data first
remove all user-defined data first
*/
void SM_Delete(MapStrToPtr* Map);
@ -76,7 +76,7 @@ void SM_Delete(MapStrToPtr* Map);
/* lookup the data that is associated with the string given by key
return: a pointer to the data, or NULL if the string given by key is not in the map
return: a pointer to the data, or NULL if the string given by key is not in the map
*/
void* SM_Lookup(char* key, MapStrToPtr* Map);
@ -92,7 +92,7 @@ void* SM_Map(char* key, void* data, MapStrToPtr* Map);
/* unmap a string and pointer. This is the inverse of the map function. The return value is a pointer to the
data mapped to the key. If the key is not found, NULL is returned
data mapped to the key. If the key is not found, NULL is returned
*/
void* SM_RemoveKey(char* key, MapStrToPtr* Map);
@ -131,7 +131,7 @@ typedef struct _StrMapIterator
}StrMapIterator;
/* creates and initializes an iterator. Pass the map that you want to iterate on as the map parameter
/* creates and initializes an iterator. Pass the map that you want to iterate on as the map parameter
To re-use this iterator on a different map, call SMI_Attach */
StrMapIterator* SMI_Create(MapStrToPtr* Map);
@ -147,7 +147,7 @@ void SMI_Attach(MapStrToPtr* Map,StrMapIterator* iter);
/* gets the first element in a map, key will be modified to point to the key at this location. Do not free
this key. In Addition, always call SMI_GetFirst, before calling SMI_GetNext or SMI_GetPrev
this key. In Addition, always call SMI_GetFirst, before calling SMI_GetNext or SMI_GetPrev
return: pointer to the data stored at this map location */
void * SMI_GetFirst(char** key, StrMapIterator* iter);

View File

@ -228,7 +228,7 @@ namespace Trick {
/**
Test whether the given variable_name is in use .
@return 0 = FALSE, 1 = TRUE.
@return 0 = FALSE, 1 = TRUE.
*/
int var_exists(std::string var_name);
@ -334,35 +334,35 @@ namespace Trick {
/**
Checkpoint all allocations known to the MemoryManager to a file.
@param filename
@param filename
*/
void write_checkpoint( const char* filename);
/**
Checkpoint the named variable (allocation) and it dependencies to the given stream.
@param out_s output stream.
@param var_name
@param var_name
*/
void write_checkpoint( std::ostream& out_s, const char* var_name);
/**
Checkpoint the named variable (allocation) and it dependencies to a file.
@param filename
@param var_name
@param filename
@param var_name
*/
void write_checkpoint( const char* filename, const char* var_name);
/**
Checkpoint the named variables and their dependencies to a stream.
@param out_s output stream.
@param var_name_list
@param var_name_list
*/
void write_checkpoint( std::ostream& out_s, std::vector<const char*>& var_name_list);
/**
Checkpoint the named variables and their dependencies to a file.
@param filename
@param var_name_list
@param filename
@param var_name_list
*/
void write_checkpoint( const char* filename, std::vector<const char*>& var_name_list);
@ -409,7 +409,7 @@ namespace Trick {
(child) ATTRIBUTES to the attr field of the given (parent) ATTRIBUTES structure.
@param type_name - user defined type name.
@param attr - pointer to parent attributes structure.
@return 0 on success, otherwise failure.
@return 0 on success, otherwise failure.
*/
int add_attr_info(const std::string& type_name , ATTRIBUTES* attr , const char * file_name = "None" , unsigned int line_num = 0 ) ;
@ -417,7 +417,7 @@ namespace Trick {
Adds a template name translation to our map. The base template type is mangled to the io_src name
@param template_name - base template type name
@param attr_name - mangled attribute name
@return 0 on success, otherwise failure.
@return 0 on success, otherwise failure.
*/
int add_template_name_trans(std::string template_name , std::string attr_name) ;
@ -520,12 +520,12 @@ namespace Trick {
int get_enumerated(const char* name, V_DATA* v_data);
/**
Return the number of array elements in the allocation.
Return the number of array elements in the allocation.
@param ptr address.
*/
int get_size(void *addr);
/**
/**
Return the number of array elements in the allocation following ptr.
@param ptr - pointer.
*/
@ -732,8 +732,8 @@ namespace Trick {
/**
Assign the value(s) in v_tree to the variable at the given address.
The object at the address may be a singleton or an array of up to
eight dimensions. If v_tree is NULL, then assign nil values.
eight dimensions. If v_tree is NULL, then assign nil values.
@param base_addr - Base address of the variable in which data is being assigned.
@param attr - Attributes of the variable.
@param curr_dim - The dimension of interest in the variable.

View File

@ -258,7 +258,7 @@ namespace Trick {
int run_queue(Trick::ScheduledJobQueue* queue, std::string in_string) ;
int open_file(std::string file_name, FILE** file_ptr) ;
void write_to_run_files(std::string file_name) ;
int initialize_sockets() ;
@ -473,14 +473,14 @@ namespace Trick {
bool get_dry_run();
/**
* Returns true if executive is running as the slave,
* Returns true if executive is running as the slave,
* based on value of slave_id (which is > 0 for slave).
*/
bool is_slave();
/**
* Returns true if executive is running as the master,
* based on the value of slave_id (which is 0 for master).
* Returns true if executive is running as the master,
* based on the value of slave_id (which is 0 for master).
*/
bool is_master();
@ -673,7 +673,7 @@ namespace Trick {
void stop_slave(unsigned int id);
/**
* Disables the slave at initialization of the Master. Must be called before master_init is called
* Disables the slave at initialization of the Master. Must be called before master_init is called
* (i.e. in input file, default_data jobs, or initialization jobs with a phase number = 0)
*
* @param name the name of the slave to disable
@ -696,73 +696,73 @@ namespace Trick {
int shutdown();
/** Gets #current_run being processed
*
*
* @return the current run number
*/
unsigned int get_current_run() ;
/** Sets the #current_run being processed
*
*
* @param run_num the number to set the run
*/
void set_current_run(int run_num) ;
/** Retrieves the #data_connection_device
*
*
* @return the address of the data_connection_device
*/
TCDevice* get_data_connection_device();
/** Allows the user to set the port number for
/** Allows the user to set the port number for
* the listen_device
*
* @param port_number number for the port
*/
void set_listen_device_port(int port_number) ;
/** Allows the user to set the port number for
/** Allows the user to set the port number for
* the data_listen_device
*
* @param port_number number for the port
*/
void set_data_listen_device_port(int port_number) ;
/** Allows the user to set the port number for
/** Allows the user to set the port number for
* the connection_device
*
* @param port_number number for the port
*/
void set_connection_device_port(int port_number) ;
/** Allows the user to set the port number for
/** Allows the user to set the port number for
* the data_connection_device
*
* @param port_number number for the port
*/
void set_data_connection_device_port(int port_number) ;
/** Allows the user to get the port number for
/** Allows the user to get the port number for
* the listen_device
*
* @return the port number
*/
int get_listen_device_port() ;
/** Allows the user to get the port number for
/** Allows the user to get the port number for
* the data_listen_device
*
* @return the port number
*/
int get_data_listen_device_port() ;
/** Allows the user to get the port number for
/** Allows the user to get the port number for
* the connection_device
*
* @return the port number
*/
int get_connection_device_port() ;
/** Allows the user to get the port number for
/** Allows the user to get the port number for
* the data_connection_device
*
* @return the port number
@ -814,7 +814,7 @@ namespace Trick {
void read_machine_name(MonteSlave *curr_slave);
void set_disconnected_state(MonteSlave *curr_slave);
void read_slave_port(MonteSlave *curr_slave);
/**
@ -931,7 +931,7 @@ namespace Trick {
int instrument_job_after(Trick::JobData* instrument_job);
int instrument_job_remove(std::string in_job);
int write_s_job_execution(FILE* fp);
/**
* Determines if the specified stings are equivalent, ignoring case.

View File

@ -13,7 +13,7 @@
#include "trick/MonteVar.hh"
#include "trick/reference.h"
// This block of code disowns the pointer on the python side so you can reassign
// This block of code disowns the pointer on the python side so you can reassign
// python variables without freeing the C++ class underneath
#ifdef SWIG
%feature("compactdefaultargs","0") ;

View File

@ -14,7 +14,7 @@
#include "trick/MonteVar.hh"
// This block of code disowns the pointer on the python side so you can reassign
// This block of code disowns the pointer on the python side so you can reassign
// python variables without freeing the C++ class underneath
#ifdef SWIG
%feature("compactdefaultargs","0") ;
@ -23,7 +23,7 @@
this = $action(*args)
try: self.this.append(this)
except: self.this = this
this.own(0)
this.own(0)
self.this.own(0)
%}
#endif
@ -90,7 +90,7 @@ namespace Trick {
/** Destructor. */
virtual ~MonteVarFile();
/**
* Sets the file name
* Sets the file name
*
* @param in_file_name the name of the file containing this variable's values
*/

View File

@ -12,7 +12,7 @@
#include "trick/MonteVar.hh"
// This block of code disowns the pointer on the python side so you can reassign
// This block of code disowns the pointer on the python side so you can reassign
// python variables without freeing the C++ class underneath
#ifdef SWIG
%feature("compactdefaultargs","0") ;

View File

@ -14,7 +14,7 @@
#include "trick/rand_generator.h"
#include "trick/StlRandomGenerator.hh"
// This block of code disowns the pointer on the python side so you can reassign
// This block of code disowns the pointer on the python side so you can reassign
// python variables without freeing the C++ class underneath
#ifdef SWIG
%feature("compactdefaultargs","0") ;

View File

@ -35,8 +35,8 @@ class PythonPrint: public CheckPointAgent {
object to the name on the left-side stack.
*/
virtual void assign_rvalue( std::ostream& chkpnt_os,
void* address,
ATTRIBUTES* attr,
void* address,
ATTRIBUTES* attr,
int curr_dim,
int offset
);
@ -45,7 +45,7 @@ class PythonPrint: public CheckPointAgent {
*/
virtual int restore( std::istream* checkpoint_stream);
/**
/**
Write a single value of an intrinsic type located at the given address and offset.
@param address - address of the object that contains the value to be written.
@ -53,12 +53,12 @@ class PythonPrint: public CheckPointAgent {
@param offset - if the object specified by address and attr is arrayed, then this
parameter specifies where, within the array the single value is
located. @c offset=0 means that the address points to the value
to be written.
to be written.
*/
static void write_singleton( std::ostream& chkpnt_os, void* address,
ATTRIBUTES* attr, int offset, bool write_units = true , bool in_list = false );
/**
/**
I NEED DOCUMENTATION!
*/
static void write_rvalue( std::ostream& chkpnt_os, void* address,
@ -69,8 +69,8 @@ class PythonPrint: public CheckPointAgent {
suitable for the right side of an assignment statement.
The pointer must be an address that is being managed by MM (the MemoryManager) or a
character string (char* or wchar_t*).
@param pointer
@param pointer
@param attr ATTRIBUTES of the pointer.
@param curr_dim current dimension.
@return text expression that represents the pointer.

View File

@ -15,7 +15,7 @@
*/
class RefParseContext {
public:
public:
int debug ; /**< -- Debug level */
int verify_input; /**< -- Verify input runstream syntax flag */

View File

@ -59,7 +59,7 @@ namespace Trick {
/**
* Formats cyclic jobs to be written to the S_job_execution file
* @param fp - open file pointer to write jobs data
* @param fp - open file pointer to write jobs data
* @param curr_queue - queue to parse and write to file
* @return always 0
*/

View File

@ -21,7 +21,7 @@ namespace Trick {
* jobs instantiated within the SimObject and the call functions to actually call the functions.
* Typcally children classes are defined in the S_define file and the call_function routines are
* auto generated by CP.
*
*
* @author Alexander S. Lin
*
* @date Jan. 2010

View File

@ -63,21 +63,21 @@ public:
///@warning with GCC 4.4.7, -std=c++0x, MINSTD_RAND_ENGINE,MT19937_ENGINE
/// 'engines' return pseudo-random numbers outside the cannonical range of 0 <= x < 1.
///
/// This causes an __INFINITE LOOP__ within the std::normal_distribution.
/// This causes an __INFINITE LOOP__ within the std::normal_distribution.
///
///
/// For TR1 compilers with this problem, use RANLUX_BASE_01_ENGINE or RANLUX_64_BASE_01_ENGINE
/// which return within the cannonical range.
/// which return within the cannonical range.
///
///@note when adding new engine types, coordinate values with MonteVarRandom.
///@note when adding new engine types, coordinate values with MonteVarRandom.
enum StlEngine {
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
@ -85,24 +85,24 @@ public:
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 StlDistribution {
GAUSSIAN = TRICK_GSL_GAUSS, /**< -- Gaussian distribution */
FLAT = TRICK_GSL_FLAT, /**< -- flat distribution */
POISSON = TRICK_GSL_POISSON /**< -- Poisson distribution */
};
///@param in_param_a first parameter in distribution::param_type
/// min for FLAT, mean for GAUSSIAN and POISSON
///
@ -115,17 +115,17 @@ public:
///
explicit StlRandomGenerator(double in_param_a = 0.0,
double in_param_b = 1.0,
unsigned long in_seed = 12345,
unsigned long in_seed = 12345,
StlRandomGenerator::StlDistribution in_dist_type = StlRandomGenerator::FLAT,
StlRandomGenerator::StlEngine in_engine_type = StlRandomGenerator::TRICK_DEFAULT_ENGINE
);
virtual ~StlRandomGenerator();
///@brief return next pseudo-random number
///@note POISSON distribution returns an int type,
/// so this would need to either cast to double or return a union class like
/// the Trick rand routines already do in order to fit in.
/// so this would need to either cast to double or return a union class like
/// the Trick rand routines already do in order to fit in.
virtual TRICK_GSL_RETURN_TYPE operator()() = 0;
///@brief reset seed for pseudo-random number engine
@ -134,14 +134,14 @@ public:
///@brief reset parameters for the distribution
///@param a is min for FLAT, mean for GAUSSION and POISSON
///@param b is max for FLAT, sigma for GAUSSION and unused for POISSON
///@note For TR1, set_param replaces the distribution via operator=
///@note For TR1, set_param replaces the distribution via operator=
virtual void set_param(double a, double b = 0.0) = 0;
double get_param_a() const { return param_a; }
double get_param_b() const { return param_b; }
protected:
double param_a; /**< -- first param in distribution::param_type, min for FLAT, mean for GAUSSIAN and POISSON */
double param_b; /**< -- second param in distribution::param_type, max for FLAT, std deviation for GAUSSIAN, (unused for POISSON) */
int initialSeed; /**< -- starting seed */
@ -178,7 +178,7 @@ protected:
#else
// do nothing class may be needed if no <random> ??
// may not if the base class is always a pointer (nullpointer) if not instantiated.
// may not if the base class is always a pointer (nullpointer) if not instantiated.
#endif // _HAVE_TR1_RANDOM or _HAVE_STL_RANDOM

View File

@ -6,10 +6,10 @@
///@brief return the correct param_type loaded with the input values
///
///@details Provides a way for a common input interface to return the correct param_type
///@details Provides a way for a common input interface to return the correct param_type
/// for all implemented distributions, without the calling code having to hardcode the distribution.
/// (Because multiple hardcodes won't work for templated distributions where the
/// initialization signatures aren't all the same.
/// (Because multiple hardcodes won't work for templated distributions where the
/// initialization signatures aren't all the same.
///
/// Common signature of static wrapper methods for all implemented 'Distribution' types:
///
@ -18,9 +18,9 @@
///
/// This allows user to use a single call: dist.param( ParamWrapper::param(dist, a,b) )
/// and the compiler will choose the correct ParamWrapper method to match dist.param's
/// need for a Distribution::param_type class object, based on the type of the 'dist' input argument.
/// need for a Distribution::param_type class object, based on the type of the 'dist' input argument.
///
/// (Otherwise, it is difficult to use the param_type system without knowing the
/// (Otherwise, it is difficult to use the param_type system without knowing the
/// distribution type at compile time.)
///
class ParamWrapper {
@ -33,15 +33,15 @@ public:
static std::uniform_real_distribution<double>::param_type
param(__attribute__((unused)) const std::uniform_real_distribution<double>& dist, double min, double max = 0.0)
{ return std::uniform_real_distribution<double>::param_type(min,max); }
static std::normal_distribution<double>::param_type
param(__attribute__((unused)) const std::normal_distribution<double>& dist, double mean, double std_dev = 0.0)
{ return std::normal_distribution<double>::param_type(mean,std_dev); }
static std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>::param_type
param(__attribute__((unused)) const std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>& dist, double mean, __attribute__((unused)) double unused = 0.0)
{ return std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>::param_type(mean); }
///@}
private:
ParamWrapper();
@ -64,38 +64,38 @@ public:
#ifdef _HAVE_STL_RANDOM
static TRICK_GSL_RETURN_TYPE return_value(__attribute__((unused)) const std::uniform_real_distribution<double>& dist, double ret_val)
#endif
{
{
TRICK_GSL_RETURN_TYPE output;
output.d = ret_val;
output.d = ret_val;
return output;
}
static TRICK_GSL_RETURN_TYPE return_value(__attribute__((unused)) const std::normal_distribution<double>& dist, double ret_val)
{
{
TRICK_GSL_RETURN_TYPE output;
output.d = ret_val;
output.d = ret_val;
return output;
}
static TRICK_GSL_RETURN_TYPE return_value(__attribute__((unused)) const std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>& dist, int ret_val)
{
{
TRICK_GSL_RETURN_TYPE output;
output.ii = ret_val;
output.ii = ret_val;
return output;
}
};
#endif
///@brief Sub class for object that includes a <random> engine and a distribution
///
///@note partial specialization exists for Distribution = std::poisson_distribution<int>
/// because TR1 doesn't implement param_type system, thus has no way to generally
/// init the class! (No way to use a common 2 parameter interface and ignore the
///@note partial specialization exists for Distribution = std::poisson_distribution<int>
/// because TR1 doesn't implement param_type system, thus has no way to generally
/// init the class! (No way to use a common 2 parameter interface and ignore the
/// second parameter for single parameter param_type distributions.)
///
///@note The partial specialization is NOT required when c++0x support is dropped.
///@note The partial specialization is NOT required when c++0x support is dropped.
///
/// Also, TR1 Distributions can not have their parameters changed after construction.
/// This results in the need for template full method specialization to provide the type specific init.
@ -104,7 +104,7 @@ template <class Engine, class Distribution>
class StlRandomGeneratorSub : public StlRandomGenerator
{
public:
#ifdef _HAVE_STD_RANDOM // (Concept doesn't exist in TR1)
typedef typename Distribution::param_type ParamType;
#endif
@ -115,45 +115,45 @@ public:
explicit StlRandomGeneratorSub(
double in_param_a = 0.0,
double in_param_b = 1.0,
unsigned long in_seed = 12345,
unsigned long in_seed = 12345,
StlRandomGenerator::StlDistribution in_dist_type = FLAT,
StlRandomGenerator::StlEngine in_engine_type = TRICK_DEFAULT_ENGINE
)
)
: StlRandomGenerator(in_param_a, in_param_b, in_seed, in_dist_type, in_engine_type),
engine(in_seed)
{
// (Note: distribution member can't be input initialized in the initializer list
// because various distributions have different signatures.
//
// NOTE: For the TR1 implementation, The set_param method
// _re-constructs_ the object with the desired parameters.
// (TR1 Distributions can only be initialized at construction time.)
// NOTE: For the TR1 implementation, The set_param method
// _re-constructs_ the object with the desired parameters.
// (TR1 Distributions can only be initialized at construction time.)
//
set_param(in_param_a, in_param_b);
}
virtual ~StlRandomGeneratorSub() { }
///@brief return next pseudo-random number
virtual TRICK_GSL_RETURN_TYPE operator()()
{
virtual TRICK_GSL_RETURN_TYPE operator()()
{
#if (defined(_HAVE_TR1_RANDOM) || defined(_HAVE_STL_RANDOM))
return StlReturnWrapper::return_value(distribution, distribution(engine));
return StlReturnWrapper::return_value(distribution, distribution(engine));
#else
// without either, won't ever be called. But to compile, return zero.
// without either, won't ever be called. But to compile, return zero.
TRICK_GSL_RETURN_TYPE output;
output.d = 0.0;
output.d = 0.0;
return output;
#endif
}
///@brief reset seed for underlying uniform pseudo-random number generator
virtual void set_seed(unsigned long in_seed)
{
virtual void set_seed(unsigned long in_seed)
{
initialSeed = in_seed;
engine.seed(initialSeed);
engine.seed(initialSeed);
}
@ -162,7 +162,7 @@ public:
///@param a is min for FLAT, mean for GAUSSION and POISSON
///@param b is max for FLAT, sigma for GAUSSION and unused for POISSON
///
///@note For the TR1 implementation, The set_param method
///@note For the TR1 implementation, The set_param method
/// _re-constructs_ the object with the desired parameters.
///
/// (C++11 allows changing the parameters on the fly.)
@ -171,50 +171,50 @@ public:
{
param_a = a;
param_b = b;
#ifdef _HAVE_STL_RANDOM
// (this param_type interface is not provided in TR1)
distribution.param( ParamWrapper::param(distribution, a,b) );
#else
// TR1 implementation must use this hokey
// TR1 implementation must use this hokey
// full template specialization solution.
tr1_init_distribution(a, b);
#endif
}
protected:
Engine engine; /**< -- STL random number engine object */
Distribution distribution; /**< -- STL random number distribution object */
private:
#ifdef _HAVE_TR1_RANDOM
///@brief For TR1, replace the default initialized distribution with a new one.
///@brief For TR1, replace the default initialized distribution with a new one.
///
///@details because TR1 only allows initialization of Distribution parameters at
/// construction time (C++11 provides the param_type system for doing this post-construction),
/// this method with full template specializations is used to get around this
/// lack of generality for the few so-far implemented distribution options.
///
/// Once C++11 is required, these can be removed and the simpler C++11 set_param
/// method used for all.
/// lack of generality for the few so-far implemented distribution options.
///
/// Once C++11 is required, these can be removed and the simpler C++11 set_param
/// method used for all.
///
void tr1_init_distribution(double a, double b)
{
// All two parameter signature distributions can use this method.
// Deviant sets must implement a full template specialization for this method.
distribution = Distribution(a, b);
// All two parameter signature distributions can use this method.
// Deviant sets must implement a full template specialization for this method.
distribution = Distribution(a, b);
}
#endif
};
#ifdef _HAVE_TR1_RANDOM
// implement one of these template FULL specializations
// implement one of these template FULL specializations
// for each implemented TR1 StlRandomGenerator::StlEngine enums
//
// So far, only the Poisson distribution requires a single parameter,
@ -225,9 +225,9 @@ private:
template<>
inline
void
StlRandomGeneratorSub<std::minstd_rand,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
void
StlRandomGeneratorSub<std::minstd_rand,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
>::tr1_init_distribution(double a, double __attribute__((unused)) b)
{
distribution = std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>(a);
@ -235,9 +235,9 @@ StlRandomGeneratorSub<std::minstd_rand,
template<>
inline
void
StlRandomGeneratorSub<std::mt19937,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
void
StlRandomGeneratorSub<std::mt19937,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
>::tr1_init_distribution(double a, double __attribute__((unused)) b)
{
distribution = std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>(a);
@ -247,9 +247,9 @@ StlRandomGeneratorSub<std::mt19937,
template<>
inline
void
StlRandomGeneratorSub<std::ranlux_base_01,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
void
StlRandomGeneratorSub<std::ranlux_base_01,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
>::tr1_init_distribution(double a, double __attribute__((unused)) b)
{
distribution = std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>(a);
@ -257,9 +257,9 @@ StlRandomGeneratorSub<std::ranlux_base_01,
template<>
inline
void
StlRandomGeneratorSub<std::ranlux64_base_01,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
void
StlRandomGeneratorSub<std::ranlux64_base_01,
std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>
>::tr1_init_distribution(double a, double __attribute__((unused)) b)
{
distribution = std::poisson_distribution<STL_POISSON_TEMPLATE_TYPES>(a);

View File

@ -39,7 +39,7 @@ typedef struct {
typedef struct {
int size; /**< -- If ATTRIBUTES.type == TRICK_BITFIELD or ATTRIBUTES.type ==
TRICK_UNSIGNED_BITFIELD, then ATTRIBUTES.index.size[0]
represents the number of bits in the bitfield.
represents the number of bits in the bitfield.
Otherwise:
@ -58,7 +58,7 @@ typedef struct {
* ATTRIBUTES are data structures that represent detailed descriptions of data
* types, including how an instance of a datatype is represented in memory.
* ATTRIBUTES are fundemental to the design of Trick's Memory Management.
*
*
* The ICG code generator generates arrays of ATTRIBUTES, of varying lengths,
* for each of the structured datat types that it finds in a header (.h or .hh)
* file. These generated ATTRIBUTES are stored in a directory entitled ./io_src.

View File

@ -6,7 +6,7 @@
#define RIGHTLEAF 1 /* get right inner leaf in delete */
#define LEFTLEAF 0 /* get left inner leaf in delete */
#ifdef __cplusplus
extern "C" {
@ -47,7 +47,7 @@ bstNode *bstGetParent(bstNode *node); /* get the parent node of a nod
void *bstDelete(bstNode *node,BST *bst); /* delete a node from the tree */
void bstDeleteNodes (BST * bst, bstNode * node);
int bstGetCount(BST *bst); /* get the number of nodes in the tree */
bstNode* bstInsert(void *info,BST *bst); /* insert a new node into the tree */
bstNode* bstInsert(void *info,BST *bst); /* insert a new node into the tree */
void bstPrintAscending(FILE *output, BST *bst); /* print the nodes in ascending order */
void bstPrintDescending(FILE *output, BST *bst); /* print the nodes in descending order */
void bstInit(BST *bst); /* intialize the BST structure */

View File

@ -241,7 +241,7 @@ int restore_sequence_i(STL & in_stl , std::string object_name , std::string var_
//message_publish(1, "RESTORE_SEQUENCE_STL %s_%s\n", object_name.c_str() , var_name.c_str()) ;
items_ref = ref_attributes((char *)(object_name + std::string("_") + var_name).c_str()) ;
items_ref = ref_attributes((char *)(object_name + std::string("_") + var_name).c_str()) ;
if ( items_ref != NULL ) {
in_stl.clear() ;

View File

@ -47,7 +47,7 @@ typedef struct _DLLIST
DLLNODE* tail;
int (*compare)(void* info1,void* info2);
}DLLIST;
/******************** function prototypes ********************/
@ -74,21 +74,21 @@ DLLPOS DLL_FindIndex(int n,DLLIST*); /* find position at given index */
/* return: position of nth element */
void* DLL_GetAt(DLLPOS pos,DLLIST*); /* gets info at a position */
/* return: the info at pos */
/* return: the info at pos */
void* DLL_SetAt(DLLPOS pos,void* data,DLLIST*); /* sets info at a position */
/* return: the info previously at pos */
/* return: the info previously at pos */
void* DLL_RemoveAt(DLLPOS,DLLIST*); /* removes a position from the list */
/* return: the info at the position being removed */
void DLL_RemoveAll(DLLIST*); /* removes all elements in the list */
/* return: none */
/* return: none */
DLLPOS DLL_InsertBefore(DLLPOS pos,void* data,DLLIST*); /* inserts an element before pos */
/* return: the new pos holding data */
DLLPOS DLL_InsertAfter(DLLPOS pos,void* data,DLLIST*); /* inserts an element after pos */
DLLPOS DLL_InsertAfter(DLLPOS pos,void* data,DLLIST*); /* inserts an element after pos */
/* return: the new pos holding data */
void* DLL_GetNext(DLLPOS*,DLLIST*); /* gets the next position in the list */

View File

@ -20,7 +20,7 @@ int dmtcp_is_enabled() ;
/* call DMTCP funcion dmtcpRunCommand() */
int call_dmtcp();
/* DMTCP jobs to run pre, post, and restart. Arguments for dmtcpInstallHooks() - defined in dmtcp/src/dmtcpaware.c */
/* DMTCP jobs to run pre, post, and restart. Arguments for dmtcpInstallHooks() - defined in dmtcp/src/dmtcpaware.c */
void dmtcp_pre_checkpoint() ;
void dmtcp_post_checkpoint() ;
void dmtcp_restart() ;

View File

@ -40,7 +40,7 @@ M =
\begin{bmatrix}
0.0 & 0.0 & 0.0 \\
0.0 & 0.0 & 0.0 \\
0.0 & 0.0 & 0.0
0.0 & 0.0 & 0.0
\end{bmatrix}
\f]
*/
@ -61,7 +61,7 @@ M =
\begin{bmatrix}
1.0 & 0.0 & 0.0 \\
0.0 & 1.0 & 0.0 \\
0.0 & 0.0 & 1.0
0.0 & 0.0 & 1.0
\end{bmatrix}
\f]
*/

View File

@ -13,14 +13,14 @@
extern "C" {
#endif
void* TMM_declare_var( TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims);
void* TMM_declare_var( TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims);
void* TMM_declare_var_1d( const char* elem_decl, int e_elems) ;
void* TMM_declare_var_s( const char* declaration ) ;
void* alloc_type( int e_elems, const char* enh_type_spec) ;
void* TMM_declare_operatornew_var( const char * class_name, unsigned int alloc_size, unsigned int element_size );
void* TMM_declare_ext_var( void* addr, TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims);
void* TMM_declare_ext_var( void* addr, TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims);
void* TMM_declare_ext_var_1d( void* addr, const char* elem_decl, int e_elems) ;
void* TMM_declare_ext_var_s( void* addr, const char* declaration);

View File

@ -229,37 +229,37 @@ void mc_set_data_listen_device_port(int port_number) ;
/**
* @relates Trick::MonteCarlo
* Sets the port for the connection_device.
* Sets the port for the connection_device.
*/
void mc_set_connection_device_port(int port_number) ;
/**
* @relates Trick::MonteCarlo
* Sets the port for the data_connection_device.
* Sets the port for the data_connection_device.
*/
void mc_set_data_connection_device_port(int port_number) ;
/**
* @relates Trick::MonteCarlo
* Gets the port for the listen_device.
* Gets the port for the listen_device.
*/
int mc_get_listen_device_port() ;
/**
* @relates Trick::MonteCarlo
* Gets the port for the data_listen_device.
* Gets the port for the data_listen_device.
*/
int mc_get_data_listen_device_port() ;
/**
* @relates Trick::MonteCarlo
* Gets the port for the connection_device.
* Gets the port for the connection_device.
*/
int mc_get_connection_device_port() ;
/**
* @relates Trick::MonteCarlo
* Gets the port for the data_connection_device.
* Gets the port for the data_connection_device.
*/
int mc_get_data_connection_device_port() ;

View File

@ -30,7 +30,7 @@ typedef struct _DLLIST {
DLLNODE* tail;
int (*compare)(void* info1,void* info2);
}DLLIST;
DLLIST* DLL_Create();

View File

@ -28,9 +28,9 @@ typedef enum {
UNIFORM_RND_1, /* Single Linear Congruential Generator */
UNIFORM_RND_TRIPLE, /* Triple Linear Congruential Generator */
GAUSS_RND_PSEUDO, /* Normalized Quasi-Gaussian Triangular
GAUSS_RND_PSEUDO, /* Normalized Quasi-Gaussian Triangular
Generator */
GAUSS_RND_BELL, /* Normalized Gaussian Bell-Shaped
GAUSS_RND_BELL, /* Normalized Gaussian Bell-Shaped
Generator */
RND_NUM_1 /* Return a value of 1 */
} rand_generator;
@ -45,22 +45,22 @@ typedef enum {
typedef struct {
rand_generator option; /* -- Random number generator
rand_generator option; /* -- Random number generator
option */
uniform_generator uniform; /* -- Uniform Random number
uniform_generator uniform; /* -- Uniform Random number
generator option */
unsigned long seed_1; /* -- Seed for uniform RNG
unsigned long seed_1; /* -- Seed for uniform RNG
single LCG */
long seed_trpl; /* -- Seed for uniform RNG
triple LCG make this seed
long seed_trpl; /* -- Seed for uniform RNG
triple LCG make this seed
negative for initializing
the RNG table */
int iff; /* -- Initialization flag for
int iff; /* -- Initialization flag for
triple LCG */
double table[98]; /* -- Table for RNG triple LCG */
int sigma_range; /* -- Sigma range for output random num
Must be > 0 for triangular gauss.
Must be >= 0 for bell gauss,
Must be >= 0 for bell gauss,
0 gives infinite sigma. */
long ix1; /* -- Intermidiate Radom Number */
long ix2; /* -- Intermidiate Radom Number */
@ -69,7 +69,7 @@ typedef struct {
} RAND_GENERATOR;
/*
* Trick's interface to the GNU Scientific Library's
* Trick's interface to the GNU Scientific Library's
* random number generators
*/
typedef enum {
@ -95,7 +95,7 @@ typedef struct {
int rel_max; /* -- Maximum is a relative maximum */
int sigma_range; /* -- Sigma range for output random num
Must be > 0 for triangular gauss.
Must be >= 0 for bell gauss,
Must be >= 0 for bell gauss,
0 gives infinite sigma. */
uniform_generator uniform; /* -- Uniform Random number generator option */

View File

@ -22,16 +22,16 @@ typedef struct
/* create and initialize a record array */
RecordArray* Array_Create(void);
/* Appends a record to the end of the array (allocating memory if necessary)
* And returns a pointer to the start of that record
/* Appends a record to the end of the array (allocating memory if necessary)
* And returns a pointer to the start of that record
*/
void* Array_AddRecord(RecordArray* pArray);
/* Gets a pointer to the record stored at the zero based record index given by nRecord.
* If nRecord is greater than the record count - 1, realloc is called to make the
* record buffer larger
* If nRecord is greater than the record count - 1, realloc is called to make the
* record buffer larger
*/
void* Array_GetAt(int nRecord,RecordArray* pArray);
@ -64,7 +64,7 @@ void* Array_GetBuffer(RecordArray* pArray);
/* returns a pointer to the buffer prefixed with an INT32 value which holds the
record count
record count
*/
void* Array_GetBufferWithSize(RecordArray* pArray);

View File

@ -60,14 +60,14 @@ typedef struct {
V_DATA v_data; /**< ** Value */
ATTRIBUTES* attr; /**< -- Parameter attributes */
ATTRIBUTES* ref_attr; /**< -- Dynamically allocated reference attribute. */
int create_add_path ; /**< ** bool to shortcut to resolve address */
DLLIST * address_path ; /**< ** shortcut to resolve address */
int create_add_path ; /**< ** bool to shortcut to resolve address */
DLLIST * address_path ; /**< ** shortcut to resolve address */
} REF2;
/**
* Get the value of the variable referenced by R.
* @param R variable reference.
* @param V pointer to V_DATA object into which the value is to be assigned.
* @param V pointer to V_DATA object into which the value is to be assigned.
* @todo isn't this obsolete?
*/
int ref_to_value( REF2* R, V_DATA* V);

View File

@ -29,10 +29,10 @@ typedef enum {
typedef struct {
Euler_Seq euler_sequence; /* -- Euler rotation sequence */
double euler_angles[3]; /* (rad) Euler rot angles from
double euler_angles[3]; /* (rad) Euler rot angles from
Frame 1 to Frame 2 */
double location[3]; /* (m) Frame 1 origin to Frame 2
origin vector, referenced
double location[3]; /* (m) Frame 1 origin to Frame 2
origin vector, referenced
to Frame 1 */
} TRANSFORM;

View File

@ -22,11 +22,11 @@ extern "C" {
typedef enum {
Decreasing = -1, /* Sets time to go = 0 only
Decreasing = -1, /* Sets time to go = 0 only
for a decreasing err function */
Any, /* Sets time to go = 0,
Any, /* Sets time to go = 0,
decreasing/increasing err function */
Increasing /* Sets time to go = 0 only for
Increasing /* Sets time to go = 0 only for
an increasing err function */
} Regula_Falsi;
@ -34,7 +34,7 @@ typedef struct {
int lower_set; /* -- Yes = Lower bounds has been set */
int upper_set; /* -- Yes = Upper bounds has been set */
int iterations; /* -- Total num of iterations
int iterations; /* -- Total num of iterations
used to fire event */
int fires; /* -- Total num of times event fired */
double x_lower; /* -- Lower value from error func */
@ -45,7 +45,7 @@ typedef struct {
double error; /* -- New Error value from err func */
double last_error; /* -- Last pass error value */
double last_tgo; /* s Last pass Time to go value */
double error_tol; /* -- Tolerance on error below
double error_tol; /* -- Tolerance on error below
which tgo=0 */
Regula_Falsi mode; /* -- Operating mode for regula falsi */
Regula_Falsi function_slope; /* -- Operating mode for regula falsi */

View File

@ -3,7 +3,7 @@ PURPOSE:
(This header file defines the "RELEASE()" macro for supported platforms.
The release function should yield the processor from the processes that
makes the call. This allows the UNIX schedular to arbitrate process
priorities during spinloops based on the status of processes waiting
priorities during spinloops based on the status of processes waiting
to run)
PROGRAMMER:
(((Eddie J. Paddock ) (LinCom) (2/96) (--) (Realtime))
@ -13,7 +13,7 @@ PROGRAMMER:
#ifndef RELEASE_H
#define RELEASE_H
#if __sgi
#if __sgi
#define RELEASE() sginap(0)
#define RELEASE_1() sginap(1)

View File

@ -1,5 +1,5 @@
/*
PURPOSE:
PURPOSE:
(For master/slave sim, this is slave info)
PROGRAMMERS:
(((Eddie J. Paddock) (LinCom) (April 1996) (--) (Initial Version))

View File

@ -1,6 +1,6 @@
/* This is an attempt at keeping data sizes consistent across machines
by defining a INT8,INT16, and INT32 type for use as 8,16,and 32 bit
integers. These won't work well with i/o like printf, but are useful
by defining a INT8,INT16, and INT32 type for use as 8,16,and 32 bit
integers. These won't work well with i/o like printf, but are useful
for transfering binary data from one machine to another. */
#ifndef SIZEDATA_H

View File

@ -6,27 +6,27 @@
#define __attribute__(x)
#endif
#ifndef SWIG_as_voidptr
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#ifndef SWIG_as_voidptr
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
#endif
#ifndef SWIG_as_voidptrptr
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#ifndef SWIG_as_voidptrptr
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
#endif
#ifndef SWIG_IsOK
#define SWIG_IsOK(r) (r >= 0)
#endif
#ifndef SWIG_Error
#ifndef SWIG_Error
#define SWIG_Error(code, msg) std::cout<<"SWIG_Error(errorcode, "<<msg<<")"<<std::endl
#endif
#ifndef SWIG_exception_fail
#define SWIG_exception_fail(code, msg) std::cout<<"SWIG_exception_fail(errorcode, "<<msg<<")"<<std::endl
#ifndef SWIG_exception_fail
#define SWIG_exception_fail(code, msg) std::cout<<"SWIG_exception_fail(errorcode, "<<msg<<")"<<std::endl
#endif
#ifndef Py_RETURN_TRUE
#ifndef Py_RETURN_TRUE
#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
#endif
@ -34,6 +34,6 @@
#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
#endif
#ifndef Py_RETURN_NONE
#ifndef Py_RETURN_NONE
#define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None
#endif

View File

@ -103,7 +103,7 @@ typedef enum {
TC_COMM_ENABLED = 1 /* -- Enabled flag value */
} TCCommFlag;
/*
/*
* WARNING : These flags are the reverse logic of BLOCKIO and NOBLOCKIO.
* This is so that if a user does not set the blockio_flag
* in a device, the device will default to blocking
@ -112,7 +112,7 @@ typedef enum {
TC_COMM_BLOCKIO = 0, /* -- Set blocking I/O */
TC_COMM_NOBLOCKIO = 1, /* -- Set non-blocking I/O */
TC_COMM_TIMED_BLOCKIO = 2, /* -- Set timed software block_io */
TC_COMM_ALL_OR_NOTHING = 3 /* -- Set non-blocking to
TC_COMM_ALL_OR_NOTHING = 3 /* -- Set non-blocking to
all or nothing */
} TCCommBlocking;
@ -147,7 +147,7 @@ typedef struct {
char addr[40]; /* ** address of connection */
int port; /* ** port of connection */
int pid; /* ** pid of connection */
int conn_initiated; /* ** Return flag to initiate
int conn_initiated; /* ** Return flag to initiate
connection */
int disabled; /* ** 0=Communication enabled
1=device disabled */

View File

@ -55,8 +55,8 @@ int tc_blockio(TCDevice * device, TCCommBlocking blockflag);
/* Check to see if a connection is valid */
int tc_isValid(TCDevice * device);
/* Set the time in secs that a blocking read
* will wait before timing out
/* Set the time in secs that a blocking read
* will wait before timing out
*/
int tc_set_blockio_timeout_limit(TCDevice * device, double limit);

View File

@ -24,23 +24,23 @@ extern "C" {
typedef enum {
TRICK_ERROR_ALL = 0, /* -- No error: Report everything. */
TRICK_ERROR_TRIVIAL = 1, /* -- Trivial level:
TRICK_ERROR_TRIVIAL = 1, /* -- Trivial level:
Informational: can ignore */
TRICK_ERROR_ADVISORY = 2, /* -- Advisory level:
TRICK_ERROR_ADVISORY = 2, /* -- Advisory level:
Can probably ignore these */
TRICK_ERROR_CAUTION = 3, /* -- Caution level:
TRICK_ERROR_CAUTION = 3, /* -- Caution level:
May not want to ignore these */
TRICK_ERROR_WARNING = 4, /* -- Warning level:
TRICK_ERROR_WARNING = 4, /* -- Warning level:
Should probably not ignore */
TRICK_ERROR_ALERT = 5, /* -- Alert level:
Should be corrected,
TRICK_ERROR_ALERT = 5, /* -- Alert level:
Should be corrected,
may not recover */
TRICK_ERROR_FATAL = 6, /* -- Fatal level:
TRICK_ERROR_FATAL = 6, /* -- Fatal level:
Must be corrected, no recovery */
TRICK_ERROR_ABORT = 7, /* -- Abort level:
TRICK_ERROR_ABORT = 7, /* -- Abort level:
Things are too bad, just abort */
TRICK_ERROR_SILENT = 8 /* -- Silent: Do not report
TRICK_ERROR_SILENT = 8 /* -- Silent: Do not report
any error of any kind */
} TrickErrorLevel;
@ -69,7 +69,7 @@ typedef struct _TrickErrorHndlr {
/* Define error object access functions */
void trick_error_func_default(
void trick_error_func_default(
TrickErrorHndlr * error_hndlr, /* IN: -- Error object */
TrickErrorLevel level, /* IN: -- Error level */
char *file, /* IN: -- File in which error ocurred */
@ -99,9 +99,9 @@ void trick_error_set_report_level(
void trick_error_set_stream(
TrickErrorHndlr * error_hndlr, /* INOUT: -- Err handler data */
TrickErrorLevel level, /* IN: -- Err reporting level
TrickErrorLevel level, /* IN: -- Err reporting level
stream to set. */
FILE * stream); /* IN: -- Err stream for
FILE * stream); /* IN: -- Err stream for
reporting level. */
void trick_error_set_all_streams(
@ -114,14 +114,14 @@ void trick_error_copy_streams(
void trick_error_set_send_hs_flag(
TrickErrorHndlr * error_hndlr, /* INOUT: -- Err handler data */
TrickErrorLevel level, /* IN: -- Error reporting level
TrickErrorLevel level, /* IN: -- Error reporting level
stream to set. */
int use_send_hs); /* IN: -- 1=use send_hs;
else use fprintf */
void trick_error_set_all_send_hs_flags(
TrickErrorHndlr * error_hndlr, /* INOUT: -- Err handler data */
int use_send_hs); /* IN: -- 1= use send_hs;
int use_send_hs); /* IN: -- 1= use send_hs;
else use fprintf */
void trick_error_copy_send_hs_flags(
@ -139,7 +139,7 @@ TrickErrorLevel trick_error_get_report_level(
FILE *trick_error_get_stream(
TrickErrorHndlr * error_hndlr, /* INOUT: -- Error hdler data */
TrickErrorLevel level); /* IN: -- Error reporting
TrickErrorLevel level); /* IN: -- Error reporting
level stream to get */
FILE *trick_error_get_curr_stream(
@ -147,15 +147,15 @@ FILE *trick_error_get_curr_stream(
int trick_error_get_send_hs_flag(
TrickErrorHndlr * error_hndlr, /* INOUT: -- Err hdler data */
TrickErrorLevel level); /* IN: -- Err report level
TrickErrorLevel level); /* IN: -- Err report level
stream to get. */
int trick_error_get_curr_send_hs_flag(
TrickErrorHndlr * error_hndlr); /* INOUT: -- Err hdler data */
void trick_error_report(
void trick_error_report(
TrickErrorHndlr * error_hndlr, /* IN: -- Error object */
TrickErrorLevel error_level, /* IN: -- Err level for
TrickErrorLevel error_level, /* IN: -- Err level for
this error */
const char *file, /* IN: -- File in which error_ occured */
int line, /* IN: -- Line number where error_ occured */

View File

@ -1,6 +1,6 @@
/*
PURPOSE: (Define the Error conditions and error messages for the
PURPOSE: (Define the Error conditions and error messages for the
trick math routines)
PROGRAMMERS: (((Alex Lin) (NASA) (8/02) () (--)))
*/

View File

@ -33,7 +33,7 @@ int LUT_inv(double **y, double **a, int n);
/**
* @ingroup TRICK_MATH
*
*
*/
void LU_bksb(double *b, double **a, int n, int *indx);
@ -253,7 +253,7 @@ void dmxv(double prod[], double mat[3][3], double vect[]);
/**
* @ingroup TRICK_MATH
*
*
*/
double drandom_gaussian(double std_deviation, int range);
@ -571,7 +571,7 @@ double gauss_rnd_bell(RAND_GENERATOR * G);
euler312( ang, mat, method, prev, __FILE__, __LINE__ )
#define euler_321( ang, mat, method, prev ) \
euler321( ang, mat, method, prev, __FILE__, __LINE__ )
#define deuler_123_quat( ang, quat, method ) \
euler123_quat( ang, quat, method, (double*)0 )
#define deuler_132_quat( ang, quat, method ) \
@ -584,5 +584,5 @@ double gauss_rnd_bell(RAND_GENERATOR * G);
euler312_quat( ang, quat, method, (double*)0 )
#define deuler_321_quat( ang, quat, method ) \
euler321_quat( ang, quat, method, (double*)0 )
#endif

View File

@ -71,7 +71,7 @@ typedef struct {
/**
* @ingroup UNITS_C_INTF
* Allocate and initialize a new Units_t according to the given units specifier.
* Allocate and initialize a new Units_t according to the given units specifier.
*/
Units_t *new_units (const char *units_s);
@ -85,7 +85,7 @@ Conv_Status_t conv_fn_u(const Units_t *f_units, /* IN */
/**
* @ingroup UNITS_C_INTF
* Create a conversion object (UnitsConvFn_t) that converts from f_units to t_units.
* Create a conversion object (UnitsConvFn_t) that converts from f_units to t_units.
*/
Conv_Status_t conv_fn_s(const char *f_units_s, /* IN */
const char *t_units_s, /* IN */

View File

@ -6,7 +6,7 @@
#ifndef _UNIX_COMMANDS
#define _UNIX_COMMANDS
#if __sgi
#if __sgi
#define unix_ssh "/usr/freeware/bin/ssh"
#define unix_rsh "/usr/bsd/rsh"
#elif __sun

View File

@ -62,12 +62,12 @@ typedef struct {
it may represent data array of up to 8 dimensions.
@dot
digraph V_TREE {
{ node
{ node
[ shape = plaintext,
label = "V_TREE*\n(to initialize a \[3\]\[2\] array )"]
p
}
{ node
{ node
[shape = record, label="{V_TREE|{<f0>data|<f1>down|<f2>next}}" ]
n0 n1 n2
n00 n01 n10 n11 n20 n21

View File

@ -20,7 +20,7 @@ extern "C" {
typedef struct {
REF2 ref;
double scale_factor;
double bias;
double bias;
} VARIABLE_NODE;
typedef struct {

View File

@ -131,7 +131,7 @@ p_i = v_i \cdot S: i \in 0..2
An expression of type double, which represents the scalar magnitude of
the vector V.
\f[
\left | V \right | \equiv \sqrt{ \sum_{i=0}^{2}v_{i}^2 }
\left | V \right | \equiv \sqrt{ \sum_{i=0}^{2}v_{i}^2 }
\f]
*/
#define V_MAG( vect ) \
@ -169,8 +169,8 @@ storing it in the matrix skew ( double[3][3] ).
\f[
SKEW =
\begin{bmatrix}
0 & -v_2 & v_1 \\
v_2 & 0 & -v_0 \\
0 & -v_2 & v_1 \\
v_2 & 0 & -v_0 \\
-v_1 & v_0 & 0
\end{bmatrix}
\f]
@ -187,8 +187,8 @@ SKEW =
\b V_DOT(A, B)
An expression returning type double, which represents the
dot product (scalar product) of A and B.
It is equivalent to:
dot product (scalar product) of A and B.
It is equivalent to:
\f[
\sum_{i=0}^{2} a_i \cdot b_i
\f]
@ -224,9 +224,9 @@ outer_{i,j} = v_i \cdot v_j: i,j \in 0..2
\b V_CROSS(CROSS, A, B )
Assign cross product of vectors A and B to vector CROSS.
This is equivalent to:
This is equivalent to:
\f[
CROSS =
CROSS =
\left \langle
\left ( a_1 \cdot b_2 - a_2 \cdot b_1 \right ),
\left ( a_2 \cdot b_0 - a_0 \cdot b_2 \right ),
@ -246,7 +246,7 @@ CROSS =
\b VxV_ADD(C, A, B)
\f[
C = C + A * B
C = C + A * B
\f]
*/
#define VxV_ADD( sum, vect1, vect2 ) { \
@ -260,7 +260,7 @@ C = C + A * B
\b VxV_SUB(C , A, B )
\f[
C = C - A * B
C = C - A * B
\f]
*/
#define VxV_SUB( diff , vect1, vect2 ) { \
@ -342,7 +342,7 @@ S=S+I
@page VECTOR_MACROS
\b V_NEGATE(D, S)
Assign the negative of vector S to the vector D.
Assign the negative of vector S to the vector D.
\f[
D=-S
\f]

View File

@ -49,44 +49,44 @@ typedef struct {
Wave_Form type; /* -- Type of wave form */
double start; /* s Start time for wave */
double stop; /* s Stop time for wave */
double ramp; /* s Time to ramp wave output from 0 to 1
double ramp; /* s Time to ramp wave output from 0 to 1
and 1 to 0 */
double pause; /* s Pause time between end of first doublet
double pause; /* s Pause time between end of first doublet
pulse and start of second doublet pulse */
double frequency; /* (1/s) Frequency of oscillating waves */
double phase; /* (rad) Phase offset for start of
double phase; /* (rad) Phase offset for start of
oscillating waves */
/*
* Uniform and gaussian random noise generator data
/*
* Uniform and gaussian random noise generator data
*/
int init_random; /* -- Yes = Initialize random
int init_random; /* -- Yes = Initialize random
number generator */
unsigned long random_seed; /* -- Seed for random noise
unsigned long random_seed; /* -- Seed for random noise
generator */
/*
* Gaussian random noise generator data
/*
* Gaussian random noise generator data
*/
int sigma_range; /* -- Range of output in standard
int sigma_range; /* -- Range of output in standard
deviations,
3 = 3sigma, 6 = 6sigma, etc. */
/*
* User defined wave data
/*
* User defined wave data
*/
int init_user_data; /* -- Yes = Open user defined wave
int init_user_data; /* -- Yes = Open user defined wave
form data file */
char *user_data; /* -- File name for user defined
char *user_data; /* -- File name for user defined
wave form */
FILE *fp; /* -- File pointer for user
FILE *fp; /* -- File pointer for user
defined wave form */
double next_time; /* s Next user time from user_data */
double next_val; /* -- Next user wave value from
double next_val; /* -- Next user wave value from
user_data */
double user_time; /* s Current user time from
double user_time; /* s Current user time from
user_data */
double user_val; /* -- Current user wave value from
double user_val; /* -- Current user wave value from
user_data */
} WAVE_FORM;

View File

@ -1,5 +1,5 @@
/*
PURPOSE: (Illustrate how to checkpoint STLs)
PURPOSE: (Illustrate how to checkpoint STLs)
LIBRARY_DEPENDENCIES: (
(STLCheckpoint.o)
)
@ -21,7 +21,7 @@
class STLCheckpoint {
public:
STLCheckpoint() ;
STLCheckpoint(std::string in_name) ;
int speak() ;

View File

@ -1,7 +1,7 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Data products test )
PURPOSE: ( Data products test )
REFERENCES: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
PROGRAMMERS: ( (Keith Vetter) (Titan) (8-20-2002) )
*******************************************************************************/
@ -10,7 +10,7 @@ PROGRAMMERS: ( (Keith Vetter) (Titan) (8-20-2002) )
typedef struct {
short si[3] ; /* ohm -- */
short si[3] ; /* ohm -- */
int i[3] ; /* m -- */
long l[3] ; /* amp -- */
float f[3] ; /* m/s2 -- */
@ -29,10 +29,10 @@ typedef struct {
} STRUCT_2 ;
typedef struct {
STRUCT_2 s2[3][2] ; /* -- */
} STRUCT_3 ;
} STRUCT_3 ;
typedef struct {

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test data products )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( dp.o )
@ -28,14 +28,14 @@ int dp(
int i,j,k,l,m,n ;
LOOP DP->s3[n].s2[m][l].s1[k][j].si[i] = (short) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].i[i] = (int) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].l[i] = (long) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].f[i] = (float) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].d[i] = (double) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].us[i] = (unsigned short) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].ui[i] = (unsigned int) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].ul[i] = (unsigned long) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].si[i] = (short) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].i[i] = (int) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].l[i] = (long) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].f[i] = (float) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].d[i] = (double) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].us[i] = (unsigned short) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].ui[i] = (unsigned int) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].ul[i] = (unsigned long) (i+1) ;
LOOP DP->s3[n].s2[m][l].s1[k][j].ll[i] = (long long) (i+1) ;
/* LOOP printf("\"dp.test.s3[%d].s2[%d][%d].s1[%d][%d].d[%d]\" ,\n",

View File

@ -1,7 +1,7 @@
/********************************* TRICK HEADER *******************************
* PURPOSE: ( Data record test )
* PURPOSE: ( Data record test )
* REFERENCES: ( None )
* ASSUMPTIONS AND LIMITATIONS: ( None )
* ASSUMPTIONS AND LIMITATIONS: ( None )
* PROGRAMMERS: ( (Lindsay Landry) (L3) (7-22-2013) )
********************************************************************************/
#include <wchar.h>
@ -20,32 +20,32 @@ typedef enum {
typedef struct {
unsigned int var1 :14;
unsigned int var2 :5;
unsigned int var2 :5;
unsigned int var3 :12;
unsigned int var4 :1;
unsigned int var4 :1;
} UINT_BITS;
typedef struct {
int var1 :7;
int var1 :7;
int var2 :16;
int var3 :3;
int var4 :6;
int var3 :3;
int var4 :6;
} INT_BITS;
typedef struct {
unsigned char var1 :3;
unsigned char var2 :2;
unsigned char var3 :2;
unsigned char var4 :1;
unsigned char var1 :3;
unsigned char var2 :2;
unsigned char var3 :2;
unsigned char var4 :1;
} UCHAR_BITS;
typedef struct {
char var1 :2;
char var2 :2;
char var3 :2;
char var4 :2;
char var1 :2;
char var2 :2;
char var3 :2;
char var4 :2;
} CHAR_BITS;
typedef struct {
unsigned short var1 :4;
unsigned short var2 :2;
@ -70,7 +70,7 @@ typedef struct {
} MIX_BITS;
class DRTypes {
class DRTypes {
public:
char a;
@ -103,7 +103,7 @@ class DRTypes {
int init();
private:
void bitfieldInit(int bitSizes[], bool sign);
void bitfieldInit(int bitSizes[], bool sign);
};
#endif

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test data record )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( DR.o )

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test data record )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( DR.o )

View File

@ -65,7 +65,7 @@ typedef const struct ConstStruct_ {
} ConstStruct ;
#endif
class AlsoCannotCopy {
class AlsoCannotCopy {
friend class InputProcessor ;
friend void init_attrClassOfEverything() ;
@ -140,7 +140,7 @@ class TTT {
} ;
//typedef TTT< int , double > my_TTT_int_double ;
#define NUM 8
typedef union {

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( asynchronous_mustfinish )
LIBRARY DEPENDENCY: ( sched_amf.o )
@ -23,7 +23,7 @@ int sched_amf(
sprintf(test, "Test %d", i);
add_test_result("sched_amf: Things are in order", test, "");
i++;
S->amf = 1 ;
S->amf = 1 ;
} else {
/* Things are out of order */
sprintf(test, "Test %d", i);

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( asynchronous )
LIBRARY DEPENDENCY: ( sched_async.o )

View File

@ -11,7 +11,7 @@ PROGRAMMERS: ((vetter) (Tue Aug 26 13:22:44 CDT 2003))
/* RETURN: -- Always return zero */
/* INOUT: -- Parameter */
int sched_default_data(SCHEDULE *S)
int sched_default_data(SCHEDULE *S)
{
#define BIG_TGO 10000
#define No 0
@ -35,5 +35,5 @@ int sched_default_data(SCHEDULE *S)
S->rf.error_tol = 1.0e-6 ;
S->rf.mode = Increasing ;
return(0) ;
return(0) ;
}

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( effector )
LIBRARY DEPENDENCY: ( sched_effector.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( effector_emitter )
LIBRARY DEPENDENCY: ( sched_effector_emitter.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( effector_receiver )
LIBRARY DEPENDENCY: ( sched_effector_receiver.o )

View File

@ -15,5 +15,5 @@ int sched_init(
{
S->mass = S->mass*1.0000013 + 0.0000013 ; /* Massive masses */
return(0) ;
return(0) ;
}

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( logging )
LIBRARY DEPENDENCY: ( sched_logging.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( sched_scheduled.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( sensor )
LIBRARY DEPENDENCY: ( sched_sensor.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( sensor_emitter )
LIBRARY DEPENDENCY: ( sched_sensor_emitter.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( sensor_receiver )
LIBRARY DEPENDENCY: ( sched_sensor_receiver.o )

View File

@ -1,6 +1,6 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Test scheduling )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( sensor_reflector )
LIBRARY DEPENDENCY: ( sched_sensor_reflector.o )

View File

@ -1,7 +1,7 @@
/********************************* TRICK HEADER *******************************
PURPOSE: ( Variable server test )
PURPOSE: ( Variable server test )
REFERENCES: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
PROGRAMMERS: ( (Lindsay Landry) (L3) (9-12-2013) )
********************************************************************************/
#include <wchar.h>
@ -11,7 +11,7 @@ PROGRAMMERS: ( (Lindsay Landry) (L3) (9-12-2013) )
#ifndef VS_HH
#define VS_HH
class VSTest {
class VSTest {
public:
unsigned short port_num;
@ -25,7 +25,7 @@ class VSTest {
unsigned char b;
short c;
unsigned short d;
int e; /* M xy-position */
int e; /* M xy-position */
unsigned int f;
long g;
unsigned long h;

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )
@ -38,7 +38,7 @@ int VSTest::init() {
// default cycle rate
cycle_rate = 0.01;
sprintf(msg,"trick.var_cycle(%.2f)\n", cycle_rate);
vs_write(msg);
vs_write(msg);
return (0);
}

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )
@ -10,8 +10,8 @@ PROGRAMMERS: ( (Lindsay Landry) (L3) (9-12-2013) )
#include "../include/VS.hh"
int VSTest::shutdown() {
tc_disconnect(&bob);
return(0);
}

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )
@ -36,12 +36,12 @@ int VSTest::strcmp_IgnoringWhiteSpace(const char* s1, const char* s2) {
// Expect cycle time of 0.01 s
int VSTest::testCycle() {
char msg[256];
char msg[256];
char suite[] = "VariableServerTest";
/*
int num, num2;
double cpu_t, cpu_st;
struct rusage cpu_usg;
struct rusage cpu_usg;
sprintf(msg,"trick.var_add(\"vsx.vst.l\")\n");
vs_write(msg);
@ -49,7 +49,7 @@ int VSTest::testCycle() {
// currently bad programming, could get stuck in this loop
while (true) {
getrusage(RUSAGE_SELF, &cpu_usg);
cpu_st = ((double) cpu_usg.ru_utime.tv_sec) + ((double) cpu_usg.ru_utime.tv_usec/1000000.0);
cpu_st = ((double) cpu_usg.ru_utime.tv_sec) + ((double) cpu_usg.ru_utime.tv_usec/1000000.0);
num = tc_pending(&bob);
//first read.
@ -60,15 +60,15 @@ int VSTest::testCycle() {
while (true) {
getrusage(RUSAGE_SELF, &cpu_usg);
cpu_t = ((double) cpu_usg.ru_utime.tv_sec) + ((double) cpu_usg.ru_utime.tv_usec/1000000.0);
cpu_t = ((double) cpu_usg.ru_utime.tv_sec) + ((double) cpu_usg.ru_utime.tv_usec/1000000.0);
num2 = tc_pending(&bob);
if (num2 == 2*num) {
break;
}
}
}
//std::cout << cpu_t - cpu_st << std::endl;
sprintf(msg,"trick.var_clear()\n");
@ -119,7 +119,7 @@ int VSTest::testAddRemove() {
vs_read();
result = strcmp_IgnoringWhiteSpace("0 -1234 -405039 {ft}", got_read);
TRICK_EXPECT_EQ(result, 0, suite, "VariableChangeUnits")
trick_test_add_parent( suite , "VariableChangeUnits" , "2710769246");
trick_test_add_parent( suite , "VariableChangeUnits" , "2710769246");
// REMOVE SINGLE VARIABLE
sprintf(msg,"trick.var_remove(\"vsx.vst.e\")\n");
@ -127,7 +127,7 @@ int VSTest::testAddRemove() {
vs_read();
result = strcmp_IgnoringWhiteSpace("0 -1234", got_read);
TRICK_EXPECT_EQ(result, 0, suite, "VariableRemove")
trick_test_add_parent( suite , "VariableRemove" , "806750761");
trick_test_add_parent( suite , "VariableRemove" , "806750761");
// CLEAR VARIABLE SERVER
sprintf(msg,"trick.var_clear()\n");
@ -175,7 +175,7 @@ int VSTest::testPause() {
vs_write(msg);
sprintf(msg,"trick.var_add(\"vsx.vst.i\")\n");
vs_write(msg);
// PAUSE
sprintf(msg,"trick.var_pause()\n");
vs_write(msg);

View File

@ -1,6 +1,6 @@
/******************************TRICK HEADER*************************************
PURPOSE: ( Test variable server )
REFERENCE: ( None )
REFERENCE: ( None )
ASSUMPTIONS AND LIMITATIONS: ( None )
CLASS: ( scheduled )
LIBRARY DEPENDENCY: ( VS.o )
@ -14,7 +14,7 @@ int VSTest::test() {
var_ascii();
return(0);
}

View File

@ -17,11 +17,11 @@ double cannon_impact_monte( CANNON_AERO* C)
tgo = regula_falsi( get_integ_time() , &(C->rf) ) ;
if (tgo == 0.0) {
now = get_integ_time() ;
now = get_integ_time() ;
/* Ball impact */
reset_regula_falsi( now , &(C->rf) ) ;
C->vel[0] = 0.0 ; C->vel[1] = 0.0 ; C->vel[2] = 0.0 ;
C->acc[0] = 0.0 ; C->acc[1] = 0.0 ; C->acc[2] = 0.0 ;
C->g = 0.0 ;

View File

@ -10,17 +10,17 @@ int cannon_jet_control( CANNON_AERO* C )
{
double sim_time ;
#define CANNON_EQUALS(X,Y) ( fabs(X - Y) < 1.0e-9 ) ? 1 : 0
#define CANNON_EQUALS(X,Y) ( fabs(X - Y) < 1.0e-9 ) ? 1 : 0
sim_time = exec_get_sim_time() ;
if ( CANNON_EQUALS(sim_time, roundoff(0.1, C->time_to_fire_jet_1)) ||
CANNON_EQUALS(sim_time, roundoff(0.1, C->time_to_fire_jet_2)) ||
CANNON_EQUALS(sim_time, roundoff(0.1, C->time_to_fire_jet_3)) ||
CANNON_EQUALS(sim_time, roundoff(0.1, C->time_to_fire_jet_4)) ) {
CANNON_EQUALS(sim_time, roundoff(0.1, C->time_to_fire_jet_4)) ) {
C->jet_on = 1 ;
}
return(0) ;
return(0) ;
}

View File

@ -23,7 +23,7 @@ int cannon_monte_default_data(CANNON_AERO* C)
/* Regula Falsi impact critter setup */
#define MY_BIG_TGO 10000
#define MY_BIG_TGO 10000
C->rf.lower_set = No ;
C->rf.upper_set = No ;
C->rf.iterations = 0 ;

View File

@ -9,10 +9,10 @@ int cannon_analytic( CANNON* C )
{
C->acc[0] = 0.00;
C->acc[1] = -9.81 ;
C->vel[0] = C->vel0[0] + C->acc[0] * C->time ;
C->vel[1] = C->vel0[1] + C->acc[1] * C->time ;
C->pos[0] = C->pos0[0] + (C->vel0[0] + (0.5) * C->acc[0] * C->time) * C->time ;
C->pos[1] = C->pos0[1] + (C->vel0[1] + (0.5) * C->acc[1] * C->time) * C->time ;
C->vel[0] = C->vel0[0] + C->acc[0] * C->time ;
C->vel[1] = C->vel0[1] + C->acc[1] * C->time ;
C->pos[0] = C->pos0[0] + (C->vel0[0] + (0.5) * C->acc[0] * C->time) * C->time ;
C->pos[1] = C->pos0[1] + (C->vel0[1] + (0.5) * C->acc[1] * C->time) * C->time ;
if (C->pos[1] < 0.0) {
C->impactTime = (- C->vel0[1] - sqrt( C->vel0[1] * C->vel0[1] - 2 * C->pos0[1]))/C->acc[1];
C->pos[0] = C->impactTime * C->vel0[0];
@ -32,5 +32,5 @@ int cannon_analytic( CANNON* C )
*/
C->time += 0.01 ;
return 0 ;
return 0 ;
}

View File

@ -9,7 +9,7 @@ LIBRARY_DEPENDENCY: ((cannon_default_data.o))
int cannon_default_data( CANNON* C ) {
const double PI = 3.1415926535;
const double PI = 3.1415926535;
C->acc[0] = 0.0;
C->acc[1] = -9.81;

View File

@ -10,5 +10,5 @@ int cannon_deriv( CANNON* C ) {
C->acc[1] = -9.81 ;
C->timeRate = 1.00;
}
return 0 ;
return 0 ;
}

View File

@ -25,7 +25,7 @@ double cannon_impact( CANNON* C ) {
C->vel[0] = 0.0 ; C->vel[1] = 0.0 ;
C->acc[0] = 0.0 ; C->acc[1] = 0.0 ;
C->impactTime = C->time;
C->impactTime = C->time;
fprintf(stderr, "\n\nIMPACT: SimTime = %.9f, ModelTime = %.9f, pos = %.9f\n\n", now, C->impactTime, C->pos[0] ) ;
}

View File

@ -1,20 +1,20 @@
/*****************************************************************************
PURPOSE: (Initialize the cannonball)
PURPOSE: (Initialize the cannonball)
*****************************************************************************/
#include <math.h>
#include "../include/cannon_common.h"
int cannon_init( CANNON* C) {
C->vel0[0] = C->init_speed*cos(C->init_angle);
C->vel0[1] = C->init_speed*sin(C->init_angle);
C->vel[0] = C->vel0[0] ;
C->vel[1] = C->vel0[1] ;
C->vel[0] = C->vel0[0] ;
C->vel[1] = C->vel0[1] ;
C->impactTime = 0.0;
C->impact = 0.0;
return 0 ;
return 0 ;
}

View File

@ -1,5 +1,5 @@
/*
* Vetter's implementation of the Nelder-Mead "amoeba" algorithm.
* Vetter's implementation of the Nelder-Mead "amoeba" algorithm.
* Was made strictly for Trick tutorial. Was a whim.
* Reference for algorithm (not code):
* http://www.research.ibm.com/infoecon/paps/html/amec99_bundle/node8.html
@ -8,10 +8,10 @@
#ifndef AMOEBA_H
#define AMOEBA_H
#define AMOEBA_ALPHA 1.0 /* reflection constant */
#define AMOEBA_BETA 1.0 /* expansion constant */
#define AMOEBA_ZETA 0.5 /* contraction constant */
#define AMOEBA_ETA 0.5 /* shrinkage constant */
#define AMOEBA_ALPHA 1.0 /* reflection constant */
#define AMOEBA_BETA 1.0 /* expansion constant */
#define AMOEBA_ZETA 0.5 /* contraction constant */
#define AMOEBA_ETA 0.5 /* shrinkage constant */
typedef enum {
@ -37,8 +37,8 @@ typedef struct {
double* x_refl ; /* -- Point of reflection */
double* x_expa ; /* -- Point of expansion */
double* x_cont ; /* -- Point of contraction */
double* curr_point ; /* -- Current point of interest for sim use:
Simplex vertice, centroid, reflection,
double* curr_point ; /* -- Current point of interest for sim use:
Simplex vertice, centroid, reflection,
expansion or contraction point */
int curr_vertex ; /* -- Current vertex for sim state machine */
AMOEBA_STATE state ; /* -- For sim's amoeba state machine */
@ -48,7 +48,7 @@ typedef struct {
#ifdef __cplusplus
extern "C" {
#endif
void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
double* simplex_point, double simplex_size ) ;
void amoeba_print( AMOEBA* A ) ;
void amoeba_print_point( int num_dims, double* point ) ;

View File

@ -20,7 +20,7 @@ int cannon_pre_master(CANNON_AERO*, AMOEBA*);
int cannon_post_master(CANNON_AERO*, AMOEBA*);
int cannon_post_slave(CANNON_AERO*);
int cannon_pre_slave(CANNON_AERO*);
#ifdef __cplusplus
}
#endif

View File

@ -68,7 +68,7 @@ void amoeba_shrink( AMOEBA* A ) {
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
x = A->vertices[ii] ;
for ( jj = 0 ; jj < A->num_dims ; jj++ ) {
x[jj] = x_0[jj] + AMOEBA_ETA*( x[jj] - x_0[jj] ) ;
x[jj] = x_0[jj] + AMOEBA_ETA*( x[jj] - x_0[jj] ) ;
}
}
@ -120,8 +120,8 @@ int amoeba_contract( AMOEBA* A ) {
fprintf(stderr,">> Try contraction.\n");
}
/* Contract if F(x_r) < F(x_n-1) */
if ( my_func(x_r) >= my_func(x_n_1) ) {
/* Contract if F(x_r) < F(x_n-1) */
if ( my_func(x_r) >= my_func(x_n_1) ) {
if ( A->debug ) {
fprintf(stderr,">> Reject contraction.\n");
}
@ -129,7 +129,7 @@ int amoeba_contract( AMOEBA* A ) {
}
/* Calculate contraction point
* x_contract = x_center + zeta*(x_center - x_worst)
* x_contract = x_center + zeta*(x_center - x_worst)
*/
for ( ii = 0 ; ii < A->num_dims ; ii++ ) {
x_cont[ii] = x_c[ii] + AMOEBA_ZETA*(x_c[ii] - x_n[ii]) ;
@ -138,45 +138,45 @@ int amoeba_contract( AMOEBA* A ) {
if ( my_func(x_cont) >= my_func(x_n) ) {
/* Accept contraction point */
if ( A->debug ) {
if ( A->debug ) {
fprintf(stderr,">> Accept contraction about x_cont(");
amoeba_print_point( A->num_dims, x_cont ) ;
fprintf(stderr,") F(x_cont)=%.2lf \n",
fprintf(stderr,") F(x_cont)=%.2lf \n",
my_func(x_cont) ) ;
}
for ( ii = 0 ; ii < A->num_dims+1 ; ii++ ) {
x_n[ii] = x_cont[ii] ;
x_n[ii] = x_cont[ii] ;
}
return 1 ;
} else {
/* Reject contraction point */
if ( A->debug ) {
if ( A->debug ) {
fprintf(stderr,">> Reject contraction about x_cont(");
amoeba_print_point( A->num_dims, x_cont ) ;
fprintf(stderr,") F(x_cont)=%.2lf \n",
fprintf(stderr,") F(x_cont)=%.2lf \n",
my_func(x_cont) ) ;
}
return 0 ;
}
}
}
void amoeba_calc_expansion_point( AMOEBA* A ) {
int ii ;
double* x_r ;
double* x_c ;
double* x_e ;
/* Short hand */
x_r = A->x_refl ;
x_c = A->x_cent ;
x_e = A->x_expa ;
/* Calculate expansion point
* x_expa = x_refl + beta*(x_refl - x_cent)
*/
@ -204,8 +204,8 @@ int amoeba_expand( AMOEBA* A ) {
fprintf(stderr,">> Try expansion.\n");
}
/* Expand if F(x_r) > F(x_0) */
if ( my_func(x_r) <= my_func(x_0) ) {
/* Expand if F(x_r) > F(x_0) */
if ( my_func(x_r) <= my_func(x_0) ) {
if ( A->debug ) {
fprintf(stderr,">> Reject expansion.\n");
}
@ -218,38 +218,38 @@ int amoeba_expand( AMOEBA* A ) {
if ( my_func(x_e) >= my_func(x_r) ) {
/* Accept expansion point */
if ( A->debug ) {
if ( A->debug ) {
fprintf(stderr,"Accept x_e(");
amoeba_print_point( A->num_dims, x_e ) ;
fprintf(stderr,") F(x_e)=%.2lf \n", my_func(x_e) ) ;
}
for ( ii = 0 ; ii < A->num_dims+1 ; ii++ ) {
x_n[ii] = x_e[ii] ;
x_n[ii] = x_e[ii] ;
}
} else {
/* Accept reflection point */
if ( A->debug ) {
if ( A->debug ) {
fprintf(stderr,"Accept x_r(");
amoeba_print_point( A->num_dims, x_r ) ;
fprintf(stderr,") F(x_r)=%.2lf \n", my_func(x_r) ) ;
}
for ( ii = 0 ; ii < A->num_dims+1 ; ii++ ) {
x_n[ii] = x_r[ii] ;
x_n[ii] = x_r[ii] ;
}
}
}
return 1 ;
}
double amoeba_distance_between( int num_dims, double* x, double* y ) {
double amoeba_distance_between( int num_dims, double* x, double* y ) {
int ii ;
double sum_squares ;
sum_squares = 0 ;
for ( ii = 0 ; ii < num_dims ; ii++ ) {
sum_squares += (x[ii] - y[ii])*(x[ii] - y[ii]);
sum_squares += (x[ii] - y[ii])*(x[ii] - y[ii]);
}
return ( sqrt(sum_squares) ) ;
@ -280,13 +280,13 @@ int amoeba_satisfied( AMOEBA* A ) {
x = A->vertices[ii] ;
for ( jj = ii+1 ; jj < A->num_vertices ; jj++ ) {
y = A->vertices[jj] ;
dist = amoeba_distance_between( A->num_dims, x, y ) ;
if ( dist > max_dist ) {
dist = amoeba_distance_between( A->num_dims, x, y ) ;
if ( dist > max_dist ) {
max_dist = dist ;
}
}
}
if ( max_dist < A->epsilon ) {
if ( max_dist < A->epsilon ) {
return 1 ;
}
@ -299,14 +299,14 @@ int amoeba_satisfied( AMOEBA* A ) {
for ( jj = ii+1 ; jj < A->num_vertices ; jj++ ) {
f2 = A->vertices[jj][A->num_dims] ;
dist = fabs( f1 - f2 ) ;
if ( dist > max_dist ) {
if ( dist > max_dist ) {
max_dist = dist ;
}
}
}
if ( max_dist < A->epsilon ) {
return 1 ;
}
}
/*
* Unsatisfied amoeba :-(
@ -359,7 +359,7 @@ int amoeba_reflect( AMOEBA* A ) {
fprintf(stderr,") F(x_r)=%.2lf \n", my_func(x_r) ) ;
}
for ( ii = 0 ; ii < A->num_dims+1 ; ii++ ) {
x_n[ii] = x_r[ii] ;
x_n[ii] = x_r[ii] ;
}
return 1 ;
} else {
@ -379,7 +379,7 @@ void amoeba_order( AMOEBA* A ) {
/* Order vertices based on function results.
* Order from best to worst (i.e. max to min)
*/
qsort( A->vertices,
qsort( A->vertices,
A->num_vertices, sizeof(double*),
amoeba_compare_vertices) ;
@ -391,7 +391,7 @@ void amoeba_order( AMOEBA* A ) {
for ( ii = 0 ; ii < A->num_vertices - 1 ; ii++ ) {
A->x_cent[jj] += A->vertices[ii][jj] ;
}
A->x_cent[jj] /= (double)(A->num_vertices - 1.0 ) ;
A->x_cent[jj] /= (double)(A->num_vertices - 1.0 ) ;
}
if ( A->debug ) {
@ -405,8 +405,8 @@ int amoeba_compare_vertices( const void* ap, const void* bp ) {
double a, b ;
a = my_func( *((double**) ap) ) ;
b = my_func( *((double**) bp) ) ;
a = my_func( *((double**) ap) ) ;
b = my_func( *((double**) bp) ) ;
if ( a > b ) {
return -1 ;
@ -418,10 +418,10 @@ int amoeba_compare_vertices( const void* ap, const void* bp ) {
}
/*
* num_dims: Number of dimensions in domain space.
* Example: If the function we are maximizing is F(x,y,z)
* num_dims: Number of dimensions in domain space.
* Example: If the function we are maximizing is F(x,y,z)
* The number of dims is 3.
*
*
* epsilon: The error tolerance before amoeba algorithm stops
* A good number is something like: 1.0e-9
*
@ -435,7 +435,7 @@ int amoeba_compare_vertices( const void* ap, const void* bp ) {
* Second : If "simplex_point" is NULL, it is assumed user setup
* A->init_simplex before entering amoeba_init.
*/
void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
double* simplex_point, double simplex_size ) {
int ii, jj ;
@ -456,15 +456,15 @@ void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
A->vertices = (double**) malloc (A->num_vertices*sizeof(double));
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
A->vertices[ii] = (double*) malloc
A->vertices[ii] = (double*) malloc
((A->num_dims+1)*sizeof(double));
}
if ( simplex_point != NULL ) {
/*
/*
* Use "simplex_point" as one vertice of first simplex. Then
* move in "simplex_size" along unit vectors to create the
* rest of the first guess simplex.
* move in "simplex_size" along unit vectors to create the
* rest of the first guess simplex.
*
* First_simplex = simplex_point + simplex_size*unit_vecs
*/
@ -473,11 +473,11 @@ void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
}
/* Load function vals with zero */
A->vertices[0][jj] = 0.0 ;
for ( ii = 1 ; ii < A->num_vertices ; ii++ ) {
for ( ii = 1 ; ii < A->num_vertices ; ii++ ) {
for ( jj = 0 ; jj < A->num_dims ; jj++ ) {
if ( jj+1 == ii ) {
A->vertices[ii][jj] =
A->vertices[ii][jj] =
simplex_point[jj] - simplex_size ;
} else {
A->vertices[ii][jj] = simplex_point[jj] ;
@ -489,7 +489,7 @@ void amoeba_init( AMOEBA* A, int num_dims, double epsilon, int max_steps,
} else {
/* Assume user has defined first simplex */
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
for ( jj = 0 ; jj < A->num_dims ; jj++ ) {
A->vertices[ii][jj] = A->init_simplex[ii][jj] ;
}
@ -535,7 +535,7 @@ void amoeba_print_point( int num_dims, double* point ) {
int ii;
for ( ii = 0 ; ii < num_dims-1 ; ii++ ) {
for ( ii = 0 ; ii < num_dims-1 ; ii++ ) {
fprintf(stderr,"%.2lf ", point[ii]);
}
fprintf(stderr,"%.2lf", point[num_dims-1]);
@ -545,7 +545,7 @@ void amoeba_print( AMOEBA* A ) {
int ii, jj ;
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
for ( ii = 0 ; ii < A->num_vertices ; ii++ ) {
for ( jj = 0 ; jj < A->num_dims ; jj++ ) {
fprintf(stderr,"%.2lf ", A->vertices[ii][jj] ) ;
}

View File

@ -9,8 +9,8 @@ PROGRAMMERS: (Keith)
#include "../include/amoeba_proto.h"
int cannon_init_amoeba(
AMOEBA* A )
AMOEBA* A )
{
amoeba_init( A, 4, 1.0e-3, 100, NULL, 0.0 ) ;
return ( 0 );
return ( 0 );
}

View File

@ -21,5 +21,5 @@ int cannon_master_shutdown()
}
trick_test_add_parent("Sim_Monte Simulation", "MonteCarlo Analysis", "1452306647");
call_write_output();
return ( 0 );
return ( 0 );
}

View File

@ -54,7 +54,7 @@ int Ball::state_integ() {
&state_out->velocity[1] ,
&state_out->acceleration[0] ,
&state_out->acceleration[1] ,
NULL
NULL
);
/* CALL THE TRICK INTEGRATION SERVICE */

View File

@ -1,4 +1,4 @@
#if ( __APPLE__ )
#if ( __APPLE__ )
# include <GLUT/glut.h>
#else
# include <GL/glut.h>
@ -32,29 +32,29 @@ void Ball_initialize() {
glEnable(GL_LIGHTING);
glBindTexture(GL_TEXTURE_2D, earthTextureID);
glEnable(GL_TEXTURE_2D);
for(ii = 0; ii <= n_lats; ii++) {
double lat0 = PI * (-0.5 + (double) (ii - 1) / n_lats);
double z0 = sin(lat0);
double zr0 = cos(lat0);
double lat1 = PI * (-0.5 + (double) ii / n_lats);
double z1 = sin(lat1);
double zr1 = cos(lat1);
glBegin(GL_QUAD_STRIP);
for(jj = 0; jj <= n_lons; jj++) {
double lon = 2 * PI * (double) (jj - 1) / n_lons;
double x = cos(lon);
double y = sin(lon);
glTexCoord2d( 0.0, 0.0);
glTexCoord2d( 0.0, 0.0);
glNormal3d(x * zr0, y * zr0, z0);
glVertex3d(x * zr0, y * zr0, z0);
glTexCoord2d( 1.0, 1.0);
glTexCoord2d( 1.0, 1.0);
glNormal3d(x * zr1, y * zr1, z1);
glVertex3d(x * zr1, y * zr1, z1);
}
@ -66,7 +66,7 @@ void Ball_initialize() {
void Ball_display(void) {
glMatrixMode(GL_MODELVIEW);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glScaled(6367500.0, 6367500.0, 6367500.0);
glCallList(BallListID);

View File

@ -3,7 +3,7 @@
class Camera {
public:
Camera();
Camera();
void look();
double pos[3];

Some files were not shown because too many files have changed in this diff Show More