next up previous contents index
Next: Input variables Up: Domains Previous: Element names   Contents   Index


Domains

The domain consists of a basic domain and maybe parameters, for further specification of the domain.

that specify the basic domain further.


The first bit (counting starts with 1) of the basic domain determines the length of the field:


The second bit indicates whether the domain is scaled:

If the domain is scaled, a scaling factor $S$ is specified. This factor $S$ is a float, the unscaled values of the domain will be multiplied with it to obtain (the values of) the scaled domain.

The scaling part is specified after the domain information (including parameters). It consists of three fields: the length field, the mantissa field and the exponent field. The first field (the length field) is 8 bits long, it is a natural number and specifies the number of bytes for both the mantissa and the exponent field. The mantissa field (second field) $S_M$ and the exponent field (third field) $S_E$ are each integers. The scaling factor $S$ is then $S=S_M*2^{S_E}$.

Example: The domain is 2 bit natural numbers with the scaling factor of $F=1*2^{-1}=1/2$ (the mantissa is $1$ and the exponent is $-1$, the length field is $1$, for one byte scaling factor field). The bits of the scaling factor are thus: 0000 0001; 0000 0001; 1111 1111. Possible values for the elements for the domain are: $\{$ $0*1/2=0$; $1*1/2=0.5$; $2*1/2=1$; $3*1/2=1.5$ $\}$. If in the element to the domain a number is set that would mean $1$ unscaled, it means with the scaling $0.5$. The bits of the entire domain are: 0; 1; 000000; 00000010; 00000001; 00000001; 11111111 (Fields in this order: 8-bit basic domain; scaled; natNumberB, with 2 bits per element; scaling factor: 1 byte per field, $S_M=1$, $S_E=-1$) (in the file, first bit at the front: 01000000 01000000 10000000 10000000 11111111)


The individual domains (including scaling factor) are padded with 0 to full Byts. So if a domain is 13 bits long, the remaining 3 bits are filled with 0, so that the domain field is 16 bit (=2 byte) long.

Table 11: 8 Bit parameters for domains
name value bit 3 till 8 description parameter
       
naturalNumberB 0000 00 The basic domain are the natural numbers. The following 8-bit parameter is a natural number $X$, which represents the number of bits for values of the domain. The corresponding basic domain is then $0 \ldots (2^X-1)$.
integerB 0100 00 The basic domain are the integer numbers. The following 8-bit parameter is a natural number $X$, which represents the number of bits for values of the domain. The corresponding basic domain is then $-(2^{X-1}) \ldots (2^{X-1}-1)$.
naturalNumber 0000 01 The basic domain are the natural numbers. The following 64-bit parameter is a natural number $X$, which is the largest natural number in the domain. The corresponding basic domain is then $0 \ldots X$. The bits that are needed for each value of the domain are $\lceil \log_2(X+1) \rceil$.
integer 0100 01 The basic domain are the integer numbers. The following two 64-bit parameters are two integers $X$ and $Y$. The first parameter $X$ is the smallest number in the domain. The second parameter $Y$ is the biggest number in the domain. The corresponding basic domain is then $Y \ldots X$. The bits that are needed for each value of the domain are $\lceil \log_2(Y-X+1) \rceil$. When interpreting the bits, all values $W$ ($W$ is the value of the bits as a natural number), which are greater than $X$, will be implemented as negative values with a value of $W-(X-Y+1)$. If the smallest number $X$ is greater than 0 or largest number $Y$ is less than 0, smallest number $X$ is subtracted from all numbers to save them ($W+X$).
integerValues 0100 10 The basic domain are the integer numbers The first 64-bit parameter is a natural number $N$, which indicates the number of possible values. Following after it is a second 8-bit parameter $B$, wich determines the number of bits per following value. After the first two parameters $N$ integers follow, each with $B$ bits in two's complement. This $N$ integers are all values which are contained in the basic domain. In the implementation the value $W$ in an element for the domain is mapped to / interpreted as the $W$'th number in the list (the numbering starts at 0). The bits that are needed for each value $W$ of the domain are $\lceil \log_2(N) \rceil $.
real 1000 00 The basic domain are floating point numbers. A floating point number consists of two integer fields, one the first, for the exponent $E$ and one, the second, for the mantissa $M$. The floating point number $Z$ is then $Z=M*2^E$. It follow two parameters. The first parameter specifies the domain of the mantissa and the second for the exponent. The specification of the domains is as described in this table (without the domains individually padded with 0). Both domains have to be domains for integers (ie. integer... or naturalNumber...).
realValues 1000 01 The basic domain are floating point numbers. A floating point number consists of two integer fields, one the first, for the exponent $E$ and one, the second, for the mantissa $M$. The floating point number $Z$ is then $Z=M*2^E$. The first following 64 bit parameter is a natural number $N$, which indicates the number of possible values. Then follow two parameters. The first parameter specifies the domain of the mantissa and the second for the exponent. The specification of the domains is as described in this table (without the domains individually padded with 0). Both domains must come from the domains of integers (ie. integer... or naturalNumber...). After the first three parameters $N$ floating point numbers follow, each with $B=B_M+B_E$ bits in the floating point number representation for the given mantissa and exponent domains. In which $B_M$ are the bits per mantissa and $B_E$ are the bits per exponent. This $N$ floating point numbers are all values the elements for the domain can be set to. For this the value of $W$, in an element to the domain is mapped / interpreted to the $W$'th number in the list (counting begins at 0). The bits that are needed for each value of the domain are $\lceil \log_2(N) \rceil $.
vector 1100 00
and
1100 01
The basic domain are vectors. The following parameters $E$ is the number of elements in the vectors. The ("number of") parmeter after the introduction "11 0000" is 8 bits long and after the introduction "11 0001" 64 bits. After this parameter follows a list of $E$ domains, as defined in this section. All the values of the vector domain will have the form $(D_1, \ldots , D_E)$, where $D_i$ is a value of the i'th domain in the domains list.
vectorValues 1100 10
and
1100 11
The basic domain are vectors. The following parameters $E$ is the number of elements in the vectors. The second parameter $N$ gives the number of possible vectors. Each ("number of") parmeter after the introduction "1100 10" is 8 bits long and after the introduction "1100 11" 64 bits. After the second parameter a list of $E$ domains follows, as defined in this section. Then follows a list of $N$ vectors, as described in section 21.3.1 on page [*]. The domains of the vectors are the given domains of the preceding list. Variables can also occur in the stored vectors. The domain for variables in the list has 0 bits. For a variable in the vector only the initial $1$ is written. A value of $W$ for the domain in a Fib element is interpreted as $W$'ter vector of the second list. (The counting starts at $0$.) If the specified vector contains variables, directly after the value of $W$ follow the variable identifiers of variables, as they wher defined above the current Fib element. The number of bits for the variable is given by the corresponding domain for variables "variable" (see section 21.2.4 on page [*]).
vectorOpenEnd 1110 00
and
1110 01
The basic domain are vectors. The following parameters $E$ is the minimum number of elements of the vector. The ("number of") parmeter after the introduction "1110 00 " is 8 bits long and after the introduction "1110 01 " 64 bits. After this parameter follows a list of $E$ domains, as defined in this section. All the values of the vector domain will have the form $(D_1, \ldots , D_E, \ldots ,D_E)$, where $D_i$ is a value of the i'th domain in the list. This domain is for elements that may contain vectors of different size. The number of elements for a vector of this domain is determined by the element containing the vector.
domainReference 1111 00 This is a reference to the (sub-)domain of an other element. The domain is the domain of the element with the given domain name $Name$. The first parameter is the in the compressed format coded $Name$ of the element, to which the domain refer to (see section 21.2.4 on page [*], without padding to a full byte). After it follows the $Element$ parameter, for the choosen subdomain. First follows (each) an $Element$-startbit, which indicates if an $Element$ parameter follows. If it is $0$ no $Element$ parameter follows, if it is $1$ an $Element$ parameter follows. If it is $1$ this first $Element$-startbit is followed by a 1 byte (8 bits) long natural number $Bits$, which indicates how many bits per $Element$ parameter are used. After this follows the first $Element$ parameter. After each $Element$ parameters (stored with the domain $ naturalNumberB ( Bits )$) follows again an $Element$-startbit and after it maybe the next $Element$ parameter and so forth. Example $matrix.3.1$: 2 Bits are needed to store the $Element$ parametes; the bits are (first bit on the front): 0 0 001111 0 00 11011 1 00000010 11 1 10 0 (in ther order the fields are for: domain name is 8 bit long; not scaled; domainReference; 8 bit element name; no parameter; matrixElement; $Element$ parameter follows; with each 2 bit; 3'th subdomain; $Element$ parameter follows; first subdomain; no $Element$ parameter follows )
defaultDomain 1111 01 The specified domain will be used only if for the corresponding element so far no other domain was given. As a parameter follows a domain as described in this table. The specified domain is only used, if for the corresponding element so far no other domain was given.
     


next up previous contents index
Next: Input variables Up: Domains Previous: Element names   Contents   Index
Betti Österholz 2013-02-13