dlinear
0.0.1
Delta-complete SMT solver for linear programming
|
A wrapper around an array of mpq_t elements. More...
#include <libqsopt_ex.h>
Public Member Functions | |
MpqArray (size_t n_elements) | |
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 | |
Obtain a constant pointer to the internal array_. | |
operator mpq_t * () | |
Obtain a pointer to the internal array. | |
size_t | size () const |
Get read-only access to the size of the 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 libqsopt_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 57 of file libqsopt_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 30 of file libqsopt_ex.cpp.
|
inlineexplicit |
Obtain a constant pointer to the internal array_.
Definition at line 83 of file libqsopt_ex.h.
|
inlineexplicit |
Obtain a pointer to the internal array.
Definition at line 89 of file libqsopt_ex.h.
void dlinear::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 61 of file libqsopt_ex.cpp.
|
inlinenodiscard |
Get read-only access to the size of the array.
Definition at line 96 of file libqsopt_ex.h.