|
|
delpi
0.0.1
DElta-complete LP solver
|
A wrapper around an array of mpq_t elements. More...
#include <qsopt_ex.h>
Public Member Functions | |
| MpqArray (size_t n_elements=0) | |
| Construct a new MpqArray object, allocating the array with n_elements elements. | |
| ~MpqArray () | |
| Destroy the MpqArray object, freeing the array. | |
| operator const mpq_t *const * () const | |
| Obtain a constant pointer to the internal array_. | |
| operator mpq_t ** () | |
| Obtain a constant pointer to the internal array_. | |
| operator const mpq_t * () const | |
| Obtain a constant pointer to the internal array_. | |
| operator mpq_t * () | |
| Obtain a pointer to the internal array. | |
| void | Resize (size_t nElements) |
| Resize the array to have nElements elements. | |
Private Member Functions | |
| void | AllocateMpqArray (size_t n_elements) |
| Allocate the array with n_elements elements. | |
| void | FreeMpqArray () |
| Free the array of mpq_t. | |
Private Attributes | |
| mpq_t * | array_ |
| array of mpq_t. It is allocated by AllocateMpqArray() and freed by FreeMpqArray(). | |
A wrapper around an array of mpq_t elements.
It is used to pass around arrays of mpq_t, ensuring they are cleaned up after use. The array is allocated by AllocateMpqArray() and freed by FreeMpqArray().
Definition at line 66 of file qsopt_ex.h.
|
explicit |
Construct a new MpqArray object, allocating the array with n_elements elements.
| n_elements | The number of elements in the array. |
Definition at line 60 of file qsopt_ex.cpp.
|
private |
Allocate the array with n_elements elements.
The array has a peculiar structure, where the element at index -1 is the size of the array. All the other n_elements elements are mpq_t.
| n_elements | The number of elements in the array. |
Definition at line 34 of file qsopt_ex.cpp.
|
inline |
Obtain a constant pointer to the internal array_.
Definition at line 95 of file qsopt_ex.h.
|
inline |
Obtain a constant pointer to the internal array_.
Definition at line 84 of file qsopt_ex.h.
|
inline |
Obtain a pointer to the internal array.
Definition at line 101 of file qsopt_ex.h.
|
inline |
Obtain a constant pointer to the internal array_.
Definition at line 89 of file qsopt_ex.h.
| void delpi::qsopt_ex::MpqArray::Resize | ( | size_t | nElements | ) |
Resize the array to have nElements elements.
All the previous elements are lost.
| nElements | new number of elements in the array |
Definition at line 64 of file qsopt_ex.cpp.