#include <jrl-qp/internal/Workspace.h>
Public Member Functions | |
Workspace () | |
Workspace (int size) | |
Workspace (int rows, int cols) | |
void | resize (int size, bool fit=false) |
int | size () const |
void | resize (int rows, int cols, bool fit=false) |
void | changeLd (int rows, int cols, int oldLd, int newLd) |
auto | asVector (int size, NotConst={}) |
auto | asVector (int size) const |
auto | asMatrix (int rows, int cols, int ld, NotConst={}) |
auto | asMatrix (int rows, int cols, int ld) const |
void | setZero () |
Class providing a memory buffer and the ablity to see it as a matrix or vector.
|
inline |
Default constructor, providing a buffer of size 0.
|
inline |
Constructing a workspace with a buffer of a specific size.
size. | Size of the buffer |
|
inline |
Constructing a workspace able to contain a row
by col
matrix.
|
inline |
Return the buffer as a Eigen::Matrix-like object of the required sizes. Const version. See non-const version for more details
|
inline |
Return the buffer as a Eigen::Matrix-like object of the required sizes. Non const version.
rows | Number of rows. |
cols | Number of cols. |
ld | Leading dimension of the matrix. |
|
inline |
Return the buffer as a Eigen::Vector-like object of the required size. Const version.
|
inline |
Return the buffer as a Eigen::Vector-like object of the required size. Non const version.
|
inline |
Change the leading dimension used to organize data in memory.
this->asMatrix(rows, cols, oldLd) before call to this function and this->asMatrix(rows, cols, newLd) after will give the same matrix.
|
inline |
Shortcut for resize(rows*cols, fit).
|
inline |
Resize to the given size.
size | The new size. |
fit | If true, force memory reallocation even if when the previous buffer was large enough. If false, only reallocate if needed. |
|
inline |
Set all elements to the buffer to zero.
|
inline |
Get the size of the buffer.