Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

SPARK Namespace Reference

Definitions of numerical constants, math functions, and the various types used to describe a SPARK problem. More...


Classes

class  TVariable
 Class used to represent the properties and the numerical values of a problem variable. More...

class  TUnknown
 Class used to represent the properties and the numerical values of an unknown problem variable. More...

class  TInverse
 Class that defines the callbacks for an inverse. More...

class  TObject
 Class used to represent an instance of an inverse. More...

class  TArgument
 This class acts as a read-only interface to a TVariable object. It is used only in the callbacks to describe the argument variables. This class is not used internally in the solver. It provides proper value access behavior depending on the type of the variable and the calling context. Also, it implements some of the attribute access methods from TVariable. More...

class  TTarget
 This class acts as a write-only interface to a TVariable object. It is used only in the callbacks to describe the target variables. This class is not used internally in the solver. It provides proper value access behavior depending on the type of the variable and the calling context. Also, it implements some of the attribute access methods from TVariable. More...

class  TFreeFunctionWrapper
 Wrapper class for any free function that is invoked as an atomic class callback. More...

struct  TEnumPolicy
 Policy class that specifies a enum value of type EnumType. More...

class  TModifierCallback
 Function wrapper class for modifier callbacks. More...

class  TNonModifierCallback
 Function wrapper class for non-modifier callbacks. More...

class  TPredicateCallback
 Function wrapper class for predicate callbacks. More...

class  TStaticNonModifierCallback
 Function wrapper class for static non-modifier callbacks. More...

class  TStaticPredicateCallback
 Function wrapper class for static predicate callbacks. More...

class  TProblem
 Representation of a problem object in the SPARK solver. More...

class  TProblem::TState
 Interface class defining the methods used to save and restore the state of the problem using the TProblem::Save() and TProblem::Restore() methods. More...

class  TComponent
 Class that solves the set of DAE equations generated by setupcpp. More...

struct  delete_policy
 Policy class used to delete non-array data types using delete operator. More...

struct  delete_array_policy
 Policy class used to delete array data types using delete [] operator. More...

struct  deleter
 Helper class that implements either delete_policy or delete_array_policy depending on the compile-time value of the non-type parameter IsArray. More...

class  XAssertion
 Base class for all SPARK exceptions. More...

class  XDimension
 Indicates that a runtime error occured due to mismatched dimension. More...

class  XOutOfRange
 Indicates that a runtime error occured due to an out of range access operation on a container. More...

class  XMemory
 Indicates that a runtime error occured because memory could not be allocated. More...

class  XInitialization
 Indicates that a runtime error occured while initializing an object. More...

class  XIO
 Indicates that a runtime error occured while performing an IO operation. More...

class  XTimeStep
 Indicates that a runtime error occured while adapting the time step. More...

class  XStepper
 Inidicates that stepping to the next step failed. More...


Functions used inside the solver code

enum  NumericalValueTypes {
  NumericalValueType_VALID = 0,
  NumericalValueType_INF = 1,
  NumericalValueType_NAN = 2
}
 Codes returned by SPARK::InfiniteOrNaN() function. More...

template<typename T> NumericalValueTypes InfiniteOrNaN (T scalar)
 Checks whether the floating-point number scalar is infinite or NaN or a valid numerical scalar.


Functions used in HVAC toolkit

double abs (double x)
double min (double x, double y)
double max (double x, double y)
double sign (double x)
 Returns the +1.0 if x is positive, -1.0 otherwise.

double sign (double retval, double test)
 Returns the a if b is strictly positive, -a otherwise.

double log2 (double x)

Constant Declaration

const double TINY = 1.0E-30
 Considered essentially as zero in solver (e.g., used to detect singularity).

const double SQRT_UROUND = sqrt(UROUND)
 Square root of the unit round-off error.


Typedefs

typedef SPARK::container<
SPARK::TArgument
TArguments
 Type for collection of TArgument objects.

typedef const TArgumentsArgList
 Type of argument list passed to the non-static callback functions.

typedef SPARK::container<
SPARK::TTarget
TTargets
 Type for collection of TTarget objects.

typedef TTargetsTargetList
 Type of target list passed to the the modifier callback functions.

typedef void(* TModifierFunction )(TObject *, ArgList, TargetList)
 Function prototype for modifier callbacks.

typedef void(* TNonModifierFunction )(TObject *, ArgList)
 Function prototype for non-modifier callbacks.

typedef bool(* TPredicateFunction )(TObject *, ArgList)
 Function prototype for predicate callbacks.

typedef void(* TStaticNonModifierFunction )(TInverse *)
 Function prototype for static callbacks.

typedef bool(* TStaticPredicateFunction )(TInverse *)
 Function prototype for predicate callbacks.


Enumerations

enum  CallbackTypes {
  CallbackType_EVALUATE = 0,
  CallbackType_PREDICT,
  CallbackType_CONSTRUCT,
  CallbackType_DESTRUCT,
  CallbackType_PREPARE_STEP,
  CallbackType_ROLLBACK,
  CallbackType_COMMIT,
  CallbackType_CHECK_INTEGRATION_STEP,
  CallbackType_STATIC_CONSTRUCT,
  CallbackType_STATIC_DESTRUCT,
  CallbackType_STATIC_PREPARE_STEP,
  CallbackType_STATIC_ROLLBACK,
  CallbackType_STATIC_COMMIT,
  CallbackType_STATIC_CHECK_INTEGRATION_STEP,
  CALLBACKTYPES_L,
  CallbackType_NONE = CALLBACKTYPES_L
}
 Enum for callback types. More...

enum  ProtoTypes {
  ProtoType_MODIFIER = 0,
  ProtoType_NON_MODIFIER,
  ProtoType_PREDICATE,
  ProtoType_STATIC_NON_MODIFIER,
  ProtoType_STATIC_PREDICATE,
  PROTOTYPES_L,
  ProtoType_NONE = PROTOTYPES_L
}
 Enum for callback prototypes. More...

enum  ReturnTypes {
  ReturnType_VALUE = 0,
  ReturnType_RESIDUAL,
  RETURNTYPES_L,
  ReturnType_NONE = RETURNTYPES_L
}
 Enum for return types from modifier callbacks. More...

enum  VariableTypes {
  VariableType_GLOBAL_TIME = 0,
  VariableType_GLOBAL_TIME_STEP,
  VariableType_PARAMETER,
  VariableType_INPUT,
  VariableType_UNKNOWN,
  VARIABLETYPES_L,
  VariableType_NONE = VARIABLETYPES_L
}
 Enum for the various variable types in the problem. More...

enum  RequestTypes {
  RequestType_ABORT = 0,
  RequestType_STOP,
  RequestType_SET_STOP_TIME,
  RequestType_REPORT,
  RequestType_SNAPSHOT,
  RequestType_SET_MEETING_POINT,
  RequestType_CLEAR_MEETING_POINTS,
  RequestType_RESTART,
  RequestType_SET_TIME_STEP,
  RequestType_SET_DYNAMIC_STEPPER,
  REQUESTTYPES_L,
  RequestType_NONE = REQUESTTYPES_L
}

Functions

std::ostream & operator<< (std::ostream &os, const SPARK::TUnknown &unknown)
 Output operator << overload for the SPARK::TUnknown class.

std::ostream & operator<< (std::ostream &os, const SPARK::TVariable &V)
 Output operator << overload for the SPARK::TVariable class.

std::ostream & operator<< (std::ostream &os, const SPARK::TArgument &argument)
 Output operator << overload for the TArgument class.

std::ostream & operator<< (std::ostream &os, const SPARK::TTarget &target)
 Output operator << overload for the TTarget class.


Detailed Description

Definitions of numerical constants, math functions, and the various types used to describe a SPARK problem.

Typedef Documentation

typedef SPARK::container< SPARK::TArgument > SPARK::TArguments
 

Type for collection of TArgument objects.

typedef const TArguments& SPARK::ArgList
 

Type of argument list passed to the non-static callback functions.

typedef SPARK::container< SPARK::TTarget > SPARK::TTargets
 

Type for collection of TTarget objects.

typedef TTargets& SPARK::TargetList
 

Type of target list passed to the the modifier callback functions.

typedef void(* SPARK::TModifierFunction)(TObject* , ArgList , TargetList )
 

Function prototype for modifier callbacks.

typedef void(* SPARK::TNonModifierFunction)(TObject* , ArgList )
 

Function prototype for non-modifier callbacks.

typedef bool(* SPARK::TPredicateFunction)(TObject* , ArgList )
 

Function prototype for predicate callbacks.

typedef void(* SPARK::TStaticNonModifierFunction)(TInverse* )
 

Function prototype for static callbacks.

typedef bool(* SPARK::TStaticPredicateFunction)(TInverse* )
 

Function prototype for predicate callbacks.


Enumeration Type Documentation

enum SPARK::NumericalValueTypes
 

Codes returned by SPARK::InfiniteOrNaN() function.

Enumeration values:
NumericalValueType_VALID  numerical value is valid
NumericalValueType_INF  numerical value is positive infinite
NumericalValueType_NAN  numerical value is not a number

enum SPARK::CallbackTypes
 

Enum for callback types.

Enumeration values:
CallbackType_EVALUATE  Specifies an EVALUATE callback.
CallbackType_PREDICT  Specifies a PREDICT callback.
CallbackType_CONSTRUCT  Specifies a CONSTRUCT callback.
CallbackType_DESTRUCT  Specifies a DESTRUCT callback.
CallbackType_PREPARE_STEP  Specifies a PREPARE_STEP callback.
CallbackType_ROLLBACK  Specifies a ROLLBACK callback.
CallbackType_COMMIT  Specifies a COMMIT callback.
CallbackType_CHECK_INTEGRATION_STEP  Specifies a CHECK_INTEGRATION_STEP callback for CLASSTYPE=INTEGRATOR only.
CallbackType_STATIC_CONSTRUCT  Specifies a STATIC_CONSTRUCT callback.
CallbackType_STATIC_DESTRUCT  Specifies a STATIC_DESTRUCT callback.
CallbackType_STATIC_PREPARE_STEP  Specifies a STATIC_PREPARE_STEP callback.
CallbackType_STATIC_ROLLBACK  Specifies a STATIC_ROLLBACk callback.
CallbackType_STATIC_COMMIT  Specifies a STATIC_COMMIT callback.
CallbackType_STATIC_CHECK_INTEGRATION_STEP  Specifies a STATIC_CHECK_INTEGRATION_STEP callback for CLASSTYPE=INTEGRATOR only.
CALLBACKTYPES_L  Number of different callback types.
CallbackType_NONE  Default value for non-initialized CallbackTypes variables.

enum SPARK::ProtoTypes
 

Enum for callback prototypes.

Enumeration values:
ProtoType_MODIFIER  Prototype used by modifier callbacks (e.g., evaluate and predict).
ProtoType_NON_MODIFIER  Prototype used by non-modifier callbacks (e.g., construct, destruct, ...).
ProtoType_PREDICATE  Prototype used by predicate callbacks (e.g., check_integration_step, ...).
ProtoType_STATIC_NON_MODIFIER  Prototype used by static non-modifier callbacks (e.g., static_construct, ...).
ProtoType_STATIC_PREDICATE  Prototype used by static predicate callbacks (e.g., static_check_integration_step, ...).
PROTOTYPES_L  Number of different prototype types.
ProtoType_NONE  Default value for non-initialized ProtoTypes variables.

enum SPARK::ReturnTypes
 

Enum for return types from modifier callbacks.

Enumeration values:
ReturnType_VALUE  Indicates that scalar value written to the target TVariable object is the variable value.
ReturnType_RESIDUAL  Indicates that scalar value written to the target TVariable object is the residual value of the function matched with this variable.
RETURNTYPES_L  Number of different return types.
ReturnType_NONE  Default value for non-initialized ReturnTypes variables.

enum SPARK::VariableTypes
 

Enum for the various variable types in the problem.

Enumeration values:
VariableType_GLOBAL_TIME  Refers to the LINK tagged with the GLOBAL_TIME keyword.
VariableType_GLOBAL_TIME_STEP  Refers to the LINK tagged with the GLOBAL_TIME_TIME keyword.
VariableType_PARAMETER  Refers to the LINKs specified with the PARAMETER keyword.
VariableType_INPUT  Refers to the LINKs specified with the INPUT keyword.
VariableType_UNKNOWN  Refers to the LINKs specified with none of the above keywords.
VARIABLETYPES_L  Number of different variable types.
VariableType_NONE  Default value for non-initialized VariableTypes variables.

enum SPARK::RequestTypes
 

Enum for the various atomic class requests

The values are specified by the following bit masks that can be combined using the bitwise OR ( | ) operator.

Enumeration values:
RequestType_ABORT  Refers to a SPARK::TDispatcher::abort() request (see macro REQUEST__ABORT in spark.h).
RequestType_STOP  Refers to a SPARK::TDispatcher::stop() request (see macro REQUEST__STOP in spark.h).
RequestType_SET_STOP_TIME  Refers to a SPARK::TDispatcher::set_stop_time() request (see macro REQUEST__SET_STOP_TIME in spark.h).
RequestType_REPORT  Refers to a SPARK::TDispatcher::report() request (see macro REQUEST__REPORT in spark.h).
RequestType_SNAPSHOT  Refers to a SPARK::TDispatcher::snapshot() request (see macro REQUEST__SNAPSHOT in spark.h).
RequestType_SET_MEETING_POINT  Refers to a SPARK::TDispatcher::set_meeting_point() request (see macro REQUEST__SET_MEETING_POINT in spark.h).
RequestType_CLEAR_MEETING_POINTS  Refers to a SPARK::TDispatcher::clear_meeting_points() request (see macro REQUEST__CLEAR_MEETING_POINTS in spark.h).
RequestType_RESTART  Refers to a SPARK::TDispatcher::restart() request (see macro REQUEST__RESTART in spark.h).
RequestType_SET_TIME_STEP  Refers to a SPARK::TDispatcher::set_time_step() request (see macro REQUEST__SET_TIME_STEP in spark.h).
RequestType_SET_DYNAMIC_STEPPER  Refers to a SPARK::TDispatcher::set_dynamic_stepper() request (see macro REQUEST__SET_DYNAMIC_STEPPER in spark.h).
REQUESTTYPES_L  Number of different request types.
RequestType_NONE  Default value for an invalid request type.


Function Documentation

std::ostream& operator<< std::ostream &  os,
const SPARK::TUnknown unknown
 

Output operator << overload for the SPARK::TUnknown class.

std::ostream& operator<< std::ostream &  os,
const SPARK::TVariable V
 

Output operator << overload for the SPARK::TVariable class.

double abs double  x  )  [inline]
 

Returns the absolute value of x

Warning:
Use SPARK::abs() to avoid possible confusion with abs(), fabs() defined in the system include files <math.h> or . The abs() function has the prototype int abs(int x) which forces a type conversion from double to int. Usually, this is not the desired effect and it is a tricky bug hard to detect. Therefore, we recommend using SPARK::abs() to avoid any confusion.

double min double  x,
double  y
[inline]
 

Returns the min of two variables that can be compared using <

Warning:
Use SPARK::min() to avoid possible confusion with std::min()

double max double  x,
double  y
[inline]
 

Returns the max of two variables that can be compared using >

Warning:
Use SPARK::max() to avoid possible confusion with std::max()

double sign double  x  )  [inline]
 

Returns the +1.0 if x is positive, -1.0 otherwise.

double sign double  retval,
double  test
[inline]
 

Returns the a if b is strictly positive, -a otherwise.

double log2 double  x  )  [inline]
 

Returns the log in base 2 of the double x

Note:
Use log() and log10() declared in to compute the logarithms in base e and 10 respectively

template<typename T>
NumericalValueTypes InfiniteOrNaN scalar  ) 
 

Checks whether the floating-point number scalar is infinite or NaN or a valid numerical scalar.

Returns:
Numerical type as enum NumericalValueTypes
Parameters:
scalar floating-point value of type T to check

:

std::ostream& operator<< std::ostream &  os,
const SPARK::TArgument argument
 

Output operator << overload for the TArgument class.

std::ostream& operator<< std::ostream &  os,
const SPARK::TTarget target
 

Output operator << overload for the TTarget class.


Variable Documentation

const double SPARK::TINY = 1.0E-30
 

Considered essentially as zero in solver (e.g., used to detect singularity).

const double SPARK::SQRT_UROUND = sqrt(UROUND)
 

Square root of the unit round-off error.



Generated on 5 Nov 2003 for VisualSPARK 2.01