MPSolve 3.2.1
Loading...
Searching...
No Matches
list.h File Reference

Custom implementation of list inside MPSolve. More...

Go to the source code of this file.

Classes

struct  mps_list_element
 
struct  mps_list
 

Macros

#define MPS_LIST_FOREACH(type, local_var, list)
 Shortcut for iterating over lists. Note that this structure is C99 only, since it would not compile under a strict C89 compiler. More...
 

Functions

mps_list_elementmps_list_element_new (void *value)
 
void mps_list_element_free (mps_list_element *el)
 
mps_list_elementmps_list_element_next (mps_list_element *el)
 
mps_list_elementmps_list_element_previous (mps_list_element *el)
 
void * mps_list_element_value (mps_list_element *el)
 
mps_listmps_list_new (void)
 Create a new empty list.
 
void mps_list_free (mps_list *list)
 Free a list and all the elements inside it.
 
int mps_list_size (mps_list *list)
 Return the number of elements in a list.
 
void mps_list_append (mps_list *list, mps_list_element *el)
 
mps_list_elementmps_list_first (mps_list *list)
 
mps_list_elementmps_list_last (mps_list *list)
 

Detailed Description

Custom implementation of list inside MPSolve.

This implementation may be a custom one or simply a wrapper around something more tested and proved to be working. Its main role is to abstract this choice to the internals of MPSolve.

Macro Definition Documentation

◆ MPS_LIST_FOREACH

#define MPS_LIST_FOREACH (   type,
  local_var,
  list 
)
Value:
for (type *__mps_local_iterator = (type*)mps_list_first (list), \
*local_var = (type*)mps_list_element_value ((mps_list_element*)__mps_local_iterator); \
__mps_local_iterator != NULL; \
__mps_local_iterator = (type*)mps_list_element_next ((mps_list_element*)__mps_local_iterator), \
local_var = (type*)mps_list_element_value ((mps_list_element*)__mps_local_iterator))
Definition: list.h:25

Shortcut for iterating over lists. Note that this structure is C99 only, since it would not compile under a strict C89 compiler.