AMPL_TUPLE#

group AMPL_TUPLE

The struct can represent a tuple with AMPL_VARIANTs as its members and maps directly to the underlying AMPL tuple.

Typedefs

typedef struct AMPL_Tuple AMPL_TUPLE#

An AMPL tuple.

Functions

int AMPL_TupleCreate(AMPL_TUPLE **tuple, size_t size, AMPL_VARIANT **v)#

Allocates an AMPL_TUPLE struct.

Parameters:
  • tuple – Pointer to the pointer of the AMPL_TUPLE struct.

  • size – Size of the tuple.

  • v – Pointer to the pointer of AMPL_VARIANT structs.

Returns:

0 iff successful.

int AMPL_TupleCreateNumeric(AMPL_TUPLE **tuple, size_t size, double *v)#

Allocates an AMPL_TUPLE struct with numeric variants.

Parameters:
  • tuple – Pointer to the pointer of the AMPL_TUPLE struct.

  • size – Size of the tuple.

  • v – Pointer to doubles.

Returns:

0 iff successful.

int AMPL_TupleCreateString(AMPL_TUPLE **tuple, size_t size, const char *const *v)#

Allocates an AMPL_TUPLE struct with string variants.

Parameters:
  • tuple – Pointer to the pointer of the AMPL_TUPLE struct.

  • size – Size of the tuple.

  • v – Pointer to strings.

Returns:

0 iff successful.

int AMPL_TupleCopy(AMPL_TUPLE **tuple, AMPL_TUPLE *copy)#

Allocates a copy of an AMPL_TUPLE struct.

Parameters:
  • tuple – Pointer to the pointer of the AMPL_TUPLE struct.

  • copy – Pointer to the AMPL_TUPLE struct to copy.

Returns:

0 iff successful.

int AMPL_TupleFree(AMPL_TUPLE **tuple)#

Frees the AMPL_TUPLE struct.

Parameters:
  • tuple – Pointer to the pointer of the AMPL_TUPLE struct.

Returns:

0 iff successful.

int AMPL_TupleCompare(AMPL_TUPLE *t1, AMPL_TUPLE *t2)#

Compares two AMPL_TUPLE structs.

Parameters:
Returns:

0 iff successful.

int AMPL_TupleGetSize(AMPL_TUPLE *tuple, size_t *size)#

Get the size of an AMPL_TUPLE struct.

Parameters:
  • tuple – Pointer to the AMPL_TUPLE struct.

  • size – Pointer to the size.

Returns:

0 iff successful.

int AMPL_TupleGetVariantPtr(AMPL_TUPLE *tuple, AMPL_VARIANT ***v)#

Get the AMPL_VARIANT at a given index of an AMPL_TUPLE struct.

Parameters:
Returns:

0 iff successful.

int AMPL_TupleGetVariant(AMPL_TUPLE *tuple, size_t index, AMPL_VARIANT **v)#

Get the AMPL_VARIANT at a given index of an AMPL_TUPLE struct.

Parameters:
Returns:

0 iff successful.

int AMPL_TupleToString(AMPL_TUPLE *tuple, char **cstr)#

Get the string representation of an AMPL_TUPLE struct.

Parameters:
  • tuple – Pointer to the AMPL_TUPLE struct.

  • cstr – Pointer to the string representation.

Returns:

0 iff successful.