Data types
This page lists the atomic data types in Analytica. By "atomic" we mean values that appear in a single cell of an array. Some of these (like references and Structs) have additional internal structure, but that internal structure doesn't interact with array dimensionality as is thus called atomic.
Numbers
There are actually several numeric data types:
- Real numbers (64-bit floating point), which includes special values
-INF,INFandNaN. - Fixed-point numbers: Fractional numbers with 1-6 decimal places between
-9,223,372,036,854.775807and9,223,372,036,854.775807 - Integers: Between
-9,223,372,036,854,775,807and9,223,372,036,854,775,807. - Boolean: A type that can be one of the two special values
TrueorFalse. In general, you can treat also use 0 and 1 in the same way. - Complex numbers: Such as
1.23-4.56j. The real and imaginary parts are each a 32-bit floating point number. - Date-time numbers. These display by default using the data format, but can also be treated as the number of days since 1-Jan-1904. A negative number is the number of days before that date.
Text
Called "strings" in other programming languages, but in Analytica we refer to them as text values. Text literals can be written using either 'single quotes' or "double quotes". They are case-sensitive in comparisons. To escape a quote character within a text literal when it is the same character that marks the beginning and end, you need to be double it, such as "This has ""internal"" quotes.".
Special values: Null and Undefined
Null and Undefined are special values that are each considered to be its own data type. Null is used heavily to indicate an absence of data, whereas Undefined is used internally (less so by users) to mean not-yet computed or not set.
References
A reference is a pointer to a value, where the value might be an array or atom.
Handles
A handle is a pointer to an Object.
Structs
A Struct is a user-defined data type, which in general has named members of varying types and dimensionalities. An instance of a Struct is an atomic datum.
Binary data terms
An in-memory binary data term (aka blob) is an opaque sequence of arbitrary bytes, used to hold binary data in memory.
Image
The representation of a picture.
Canvas
A drawing surface used to programmatically draw images.
Expression
A parsed expression, used internally but not commonly by user logic in an Analytica model. The value of attributes like FixedDef hold parsed expressions. Functions ParsedExprFunction and ParsedExprParameters make it possible to access the internals of a parsed expression.
Optimizations
These include «LP»s, «QP»s, «NLP»s, etc. They are generally obtained by calling DefineOptimization and they represent an optimization problem.
Python values
When Using Python from Analytica, python data structures are returned as python values. The function PyExplode is used to expand these into Analytica data structures.
Linear and Quad terms
These represent a linear or quadratic combination of scalar decision variables (i.e., in a symbolic form). They are only used internally, not directly by user logic (although they can be created via LinearTermAtom and QuadraticTermAtom, and they will propagate through your own expressions during the analysis phase of an optimization). Built-in functions and operators that map a linear or quadratic expression to a linear or quadratic expression can be used on these terms. These are used by Optimizer to deduce whether an optimization problem is linear or quadratic, and to deduce the coefficients in those cases.
Enable comment auto-refresher