modelObject

Data element object

Extends from ElementIcon (Icon for the elements).

Information

The object element has been included to join similarities between variables and attributes in the same implementation.
The only difference between variables and attributes is the functions to manage them. Attribute functions have to manage the entity to whom the attribute is associated.

This element represents a matrix of real values stored in dynamic memory. The reference to that matrix is stored in the parameter P.
In the case of a variable (objType == 0, by default), the matrix is initialized with the InitialValue.

The functions included to manage objects are:

  • ObjCreate, allocates the memory for the object and returns a reference (pointer).
  • ObjDelete, frees the memory and destroys the object.
  • ObjUpdateSize, allocates or frees memory depending on the new size of the object, without changing the reference.
  • ObjUpdatePos, updates the value of one of the positions of the object ([row,col]).
  • ObjUpdate, updates all the positions of the object.
  • ObjReadPos, returns the value of a given position of the object.
  • ObjReadI1, returns the number of rows (index1) of the object.
  • ObjeRealI2, returns the number of columns (index2) of the object.
  • ObjLCreate, creates a list of objects and returns a reference to the list.
  • ObjLDelete, frees the memory of the list and destroys it.
  • ObjLAdd, adds a new object to the list, ordered using the parameter number.
  • ObjLLength, returns the length of the list.
  • ObjLReadPos, returns the value in position [row,col] of the object in the position number of the list.
  • ObjLCopy, duplicates one list into another.

Parameters

TypeNameDefaultDescription
IntegerNumber1Number of the object
Integerrows1size of the attribute in rows
Integercols1size of the attribute in columns
RealInitialValue[0]Initial values for the variable
IntegerobjType0Object Type (0 == variable, 1 == attribute)
IntegerPObjects.ObjCreate(rows, cols, foo = Number)pointer to actual matrix of values