AMPL_SETINSTANCE#

group AMPL_SETINSTANCE

Functions for set instances:

Functions

AMPL_ERRORINFO *AMPL_SetInstanceGetSize(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, size_t *size)#

Get the number of tuples in this set instance.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of set instance as string.

  • index – Index of instance as tuple.

  • size – Pointer to the number of tuples in the set instance.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceContains(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_TUPLE *tuple, bool *contains)#

Check wether this set instance contains the specified tuple.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of set instance as string.

  • index – Index of instance as tuple.

  • tuple – Pointer to the tuple to be found.

  • contains – True if the set instance contains the tuple, false otherwise (pointer to bool).

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceGetValues(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_TUPLE ***tuples, size_t *size)#

Get the values of this set instance as tuples.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of set instance as string.

  • index – Index of instance as tuple.

  • tuples – Pointer to the tuples that represents the values.

  • size – Pointer to the number of tuples in the set instance.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceGetValuesDataframe(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_DATAFRAME **dataframe)#

Get the values of this set instance in a Dataframe.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of set instance as string.

  • index – Index of instance as tuple.

  • dataframe – Pointer to the dataframe that represents the values.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceSetValues(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_ARGS *args, size_t size)#

Set the values of this set instance with AMPL_ARGS.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of entity as string.

  • index – Index of instance as tuple.

  • args – Pointer to the arguments that represents the values.

  • size – Pointer to the number of arguments in the set instance.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceSetValuesTuples(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_TUPLE **tuples, size_t size)#

Set the values of this set instance using tuples.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of entity as string.

  • index – Index of instance as tuple.

  • tuples – Pointer to the tuples that represents the values.

  • size – Pointer to the number of tuples in the set instance.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceSetValuesDataframe(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, AMPL_DATAFRAME *data)#

Set the values of this set instance using a Dataframe.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of entity as string.

  • index – Index of instance as tuple.

  • data – Pointer to the dataframe that represents the values.

Returns:

Pointer to the AMPL_ERRORINFO struct.

AMPL_ERRORINFO *AMPL_SetInstanceToString(AMPL *ampl, const char *entityname, AMPL_TUPLE *index, char **str)#

Returns a string representation of this set instance.

Parameters:
  • ampl – Pointer to the AMPL struct.

  • entityname – Name of set instance as string.

  • index – Index of instance as tuple.

  • str – Pointer to the string representation of the set instance.

Returns:

Pointer to the AMPL_ERRORINFO struct.