Dataflow Software Stack  032db78
Master Thesis of Mathijs Saey at the VUB
 All Classes Namespaces Files Functions Variables Pages
Functions | Variables
natives Namespace Reference

DVM Native Operations. More...

Functions

def dvm_Void
 Return the DVM void type. More...
 
def dvm_Bool
 Create a DVM Boolean. More...
 
def dvm_Int
 Create a DVM Integer. More...
 
def dvm_Float
 Create a DVM Float. More...
 
def dvm_String
 create a DVM String More...
 
def dvm_Array
 Create a DVM Array. More...
 
def dvm_tuple
 Create a DVM Tuple. More...
 
def dvm_noOp
 Do nothing. More...
 
def dvm_isVoid
 See if the element is void. More...
 
def dvm_equals
 Check if 2 elements are equal. More...
 
def dvm_notEqual
 Check if 2 elements are not equal. More...
 
def dvm_and
 Logical and. More...
 
def dvm_or
 Logical Or. More...
 
def dvm_xor
 Logical xor. More...
 
def dvm_not
 Negation. More...
 
def dvm_neg
 Negation. More...
 
def dvm_abs
 Absolute value. More...
 
def dvm_add
 Addition. More...
 
def dvm_sub
 Subtraction. More...
 
def dvm_mul
 Multiplication. More...
 
def dvm_div
 Subtraction. More...
 
def dvm_mod
 Modulo. More...
 
def dvm_exp
 Exponent. More...
 
def dvm_floor
 Round down. More...
 
def dvm_ceil
 Round up. More...
 
def dvm_min
 Maximum. More...
 
def dvm_max
 Minimum. More...
 
def dvm_less
 Smaller than. More...
 
def dvm_more
 Greater than. More...
 
def dvm_less_eq
 Smaller or equal than. More...
 
def dvm_more_eq
 Greatar or equal than. More...
 
def dvm_str_contains
 See if a string contains a value. More...
 
def dvm_str_find
 Return the idx of x in str. More...
 
def dvm_str_upper
 Conver a string to upper case. More...
 
def dvm_str_lower
 Conver a string to lower case. More...
 
def dvm_str_sub
 Get a substring. More...
 
def dvm_str_reverse
 Reverse a string. More...
 
def dvm_str_append
 Append 2 strings. More...
 
def dvm_arr_isEmpty
 See if an array is empty. More...
 
def dvm_arr_length
 Get the length of an array. More...
 
def dvm_arr_bound
 Get the upper bound of an array. More...
 
def dvm_arr_empty
 Create an empty array. More...
 
def dvm_arr_create
 Create an array filled with an element. More...
 
def dvm_arr_get
 Get an element from the array. More...
 
def dvm_arr_set
 Create a new array with a different element at idx. More...
 
def dvm_arr_insert
 Insert elements into an array. More...
 
def dvm_arr_replace
 Replace elements in an array. More...
 
def dvm_arr_catenate
 Array concatenation. More...
 
def dvm_arr_add_front
 Add an element to the start of an array. More...
 
def dvm_arr_add_back
 Add an element to the back of an array. More...
 
def dvm_arr_sub
 Get a subset of an array. More...
 
def dvm_arr_prune
 Create an array with the value of the first array if the value of the second array is true. More...
 
def dvm_tup_get
 Access an element of a tuple. More...
 
def dvm_range
 Generate a range. More...
 

Variables

dictionary operations
 Contains references to all the operations. More...
 

Detailed Description

DVM Native Operations.

This module defines all of the native DVM operations.

Function Documentation

def natives.dvm_Void ( )

Return the DVM void type.

def natives.dvm_Bool (   x)

Create a DVM Boolean.

def natives.dvm_Int (   x)

Create a DVM Integer.

def natives.dvm_Float (   x)

Create a DVM Float.

def natives.dvm_String (   x)

create a DVM String

def natives.dvm_Array (   x)

Create a DVM Array.

DVM arrays are indexed starting from 0.

def natives.dvm_tuple (   x)

Create a DVM Tuple.

DVM Tuples are indexed start from 0

def natives.dvm_noOp (   x)

Do nothing.

Parameters
xAny number of inputs
Returns
Nothing.
def natives.dvm_isVoid (   x)

See if the element is void.

Parameters
xA parameter of any type.
Returns
True if x is void.
def natives.dvm_equals (   l,
  r 
)

Check if 2 elements are equal.

Parameters
l,rparameters of any type.
Returns
True if l and r are equal.
def natives.dvm_notEqual (   l,
  r 
)

Check if 2 elements are not equal.

Parameters
l,rparameters of any type.
Returns
True if l and r are not equal
def natives.dvm_and (   l,
  r 
)

Logical and.

Parameters
l,rbooleans
Returns
A boolean
def natives.dvm_or (   l,
  r 
)

Logical Or.

Parameters
l,rbooleans
Returns
A boolean
def natives.dvm_xor (   l,
  r 
)

Logical xor.

Parameters
l,rbooleans
Returns
a boolean
def natives.dvm_not (   x)

Negation.

Parameters
xa boolean
Returns
the negate boolean
def natives.dvm_neg (   x)

Negation.

Parameters
xa number
Returns
negated x
def natives.dvm_abs (   x)

Absolute value.

Parameters
xa number
Returns
The absolute value of x
def natives.dvm_add (   l,
  r 
)

Addition.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_sub (   l,
  r 
)

Subtraction.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_mul (   l,
  r 
)

Multiplication.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_div (   l,
  r 
)

Subtraction.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_mod (   l,
  r 
)

Modulo.

Parameters
l,rnumbers
Returns
modulo of l and r
def natives.dvm_exp (   l,
  r 
)

Exponent.

Parameters
l,rnumbers
Returns
A number
def natives.dvm_floor (   x)

Round down.

Parameters
xA number
Returns
A number
def natives.dvm_ceil (   x)

Round up.

Parameters
xA number
Returns
A number
def natives.dvm_min (   l,
  r 
)

Maximum.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_max (   l,
  r 
)

Minimum.

Parameters
l,rnumeric parameters
Returns
A number
def natives.dvm_less (   l,
  r 
)

Smaller than.

Parameters
l,rnumbers
Returns
true if l < r
def natives.dvm_more (   l,
  r 
)

Greater than.

Parameters
l,rnumbers
Returns
true if l > r
def natives.dvm_less_eq (   l,
  r 
)

Smaller or equal than.

Parameters
l,rnumbers
Returns
true if l =< r
def natives.dvm_more_eq (   l,
  r 
)

Greatar or equal than.

Parameters
l,rnumbers
Returns
true if l >= r
def natives.dvm_str_contains (   str,
  x 
)

See if a string contains a value.

Parameters
str,xstrings
Returns
True if x is an element of str
def natives.dvm_str_find (   str,
  x 
)

Return the idx of x in str.

Parameters
str,xstrings
Returns
the idx of x in str. -1 if x is not in str.
def natives.dvm_str_upper (   str)

Conver a string to upper case.

Parameters
stra string
Returns
the string in upper case.
def natives.dvm_str_lower (   str)

Conver a string to lower case.

Parameters
stra string
Returns
the string in lower case.
def natives.dvm_str_sub (   str,
  start,
  stop 
)

Get a substring.

Parameters
stra string
startthe index to start at.
stopthe index to stop at.
def natives.dvm_str_reverse (   str)

Reverse a string.

Parameters
stra string
Returns
the reversed string
def natives.dvm_str_append (   l,
  r 
)

Append 2 strings.

Parameters
l,rstrings
Returns
the combination of 2 strings.
def natives.dvm_arr_isEmpty (   arr)

See if an array is empty.

Parameters
arrthe array
Returns
True if the array is empty
def natives.dvm_arr_length (   arr)

Get the length of an array.

Parameters
arrAn array
Returns
the length of the array.
def natives.dvm_arr_bound (   arr)

Get the upper bound of an array.

Parameters
arrAn array
Returns
highest index of the array.
def natives.dvm_arr_empty ( )

Create an empty array.

def natives.dvm_arr_create (   length,
  fill 
)

Create an array filled with an element.

Parameters
lengththe length of the array
fillthe element to fill the array with
Returns
the new array
def natives.dvm_arr_get (   arr,
  idx 
)

Get an element from the array.

Parameters
arrthe array to taken an element from
idxthe indes to access
Returns
the element arr[idx]
def natives.dvm_arr_set (   arr,
  idx,
  el 
)

Create a new array with a different element at idx.

Parameters
arrthe array
idxthe index to modify
elthe element to insert
Returns
a new array that is identical to arr, with the element at idx replaced by el
def natives.dvm_arr_insert (   arr,
  idx,
  el 
)

Insert elements into an array.

e.g:

test = [1,2,3]
>>> natives.dvm_arr_insert(test, 1, 'a', 'b')
[1, 'a', 'b', 2, 3]
Parameters
arrthe array
idxthe start index
elthe elements to include.
Returns
A new array, which consists of arr with the elements added at index. The elements are inserted at index, but do not replace anything after index.
def natives.dvm_arr_replace (   arr,
  idx,
  el 
)

Replace elements in an array.

Similar to dvm_arr_insert, but replaces the elements starting at idx.

e.g:

test = [1,2,3]
>>> natives.dvm_arr_replace(test, 1, 'a', 'b')
[1, 'a', 'b']
Parameters
arrthe array
idxthe start index
elthe elements to include.
Returns
A new array, with the elements starting at idx replaced by el.
def natives.dvm_arr_catenate (   l,
  r,
  rest 
)

Array concatenation.

Parameters
l,rarrays.
rest(optional) other arrays to concatenate.
Returns
concatenation of l and r.
def natives.dvm_arr_add_front (   arr,
  el 
)

Add an element to the start of an array.

Parameters
arrAn array
elThe element to add.
Returns
a copy of arr with el added in front.
def natives.dvm_arr_add_back (   arr,
  el 
)

Add an element to the back of an array.

Parameters
arrAn array
elThe element to add.
Returns
a copy of arr with el added to the back.
def natives.dvm_arr_sub (   arr,
  start,
  stop 
)

Get a subset of an array.

Parameters
arrAn array
startThe idx to start at.
stopThe idx to stop at.
Returns
An array containing the elements of arr between start and stop.
def natives.dvm_arr_prune (   arr,
  bools 
)

Create an array with the value of the first array if the value of the second array is true.

Parameters
arrThe array to gather elements from.
boolsAn array of booleans.
Returns
An array with all the elements of arr for which the corresponding element in bools is true.
def natives.dvm_tup_get (   tup,
  idx 
)

Access an element of a tuple.

Parameters
tupA tuple
idxAn integer
Returns
The element found at idx in the tuple.
def natives.dvm_range (   start,
  stop 
)

Generate a range.

Parameters
start,stopThe lower and upper bounds of the range
Returns
An array containing [start..stop]

Variable Documentation

dictionary natives.operations

Contains references to all the operations.