File view_matrix_lil.hpp

Typedefs

template<typename T>
using AllocatedListOfLists = ListOfListsAllocator<ListOfLists<T>>

Allocates the memory, a ListOfLists provides access to.

Template Parameters:

T – The type of the values stored in the ListOfLists

template<typename T>
class ListOfLists : public Matrix
#include <view_matrix_lil.hpp>

A two-dimensional view that provides row-wise access to values stored in a sparse matrix in the list of lists (LIL) format.

Template Parameters:

T – The type of the values, the view provides access to

Public Types

typedef T value_type

The type of the values, the view provides access to.

typedef std::vector<T>::const_iterator value_const_iterator

An iterator that provides read-only access to the values in the view.

typedef std::vector<T>::iterator value_iterator

An iterator that provides access to the values in the view and allows to modify them.

typedef const std::vector<T> &const_row

Provides read-only access to an individual row in the view.

typedef std::vector<T> &row

Provides access to an individual row in the view and allows to modify it.

Public Functions

inline ListOfLists(std::vector<T> *array, uint32 numRows, uint32 numCols)
Parameters:
  • array – A pointer to an array of type std::vector, shape (numRows), that stores vectors corresponding to each row in the matrix

  • numRows – The number of rows in the view

  • numCols – The number of columns in the view

inline ListOfLists(const ListOfLists &other)
Parameters:

other – A const reference to an object of type ListOfLists that should be copied

inline ListOfLists(ListOfLists &&other)
Parameters:

other – A reference to an object of type ListOfLists that should be moved

inline virtual ~ListOfLists() override
inline const_row operator[](uint32 row) const

Returns a view that provides read-only access to a specific row in the view.

Parameters:

row – The index of the row

Returns:

A const_row

inline row operator[](uint32 row)

Returns a view that provides access to a specific row in the view and allows to modify it.

Parameters:

row – The index of the row

Returns:

A row

inline value_const_iterator values_cbegin(uint32 row) const

Returns a value_const_iterator to the beginning of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_const_iterator to the beginning of the values

inline value_const_iterator values_cend(uint32 row) const

Returns a value_const_iterator to the end of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_const_iterator to the end of the values

inline value_iterator values_begin(uint32 row)

Returns a value_iterator to the beginning of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_iterator to the beginning of the values

inline value_iterator values_end(uint32 row)

Returns a value_iterator to the end of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_iterator to the end of the values

inline std::vector<T> *release()

Releases the ownership of the array that stores vectors corresponding to each row in the matrix. As a result, the behavior of this view becomes undefined and it should not be used anymore. The caller is responsible for freeing the memory that is occupied by the array.

Returns:

A pointer to the array that stores vectors corresponding to each row in the matrix

Public Members

std::vector<T> *array

A pointer to an array that stores vectors corresponding to each row in the matrix.

template<typename Matrix>
class ListOfListsAllocator : public Matrix
#include <view_matrix_lil.hpp>

Allocates the memory for a two-dimensional view that provides row-wise access to values stored in a matrix in the list of lists (LIL) format.

Template Parameters:

Matrix – The type of the view

Public Functions

inline ListOfListsAllocator(uint32 numRows, uint32 numCols)
Parameters:
  • numRows – The number of rows in the view

  • numCols – The number of columns in the view

inline ListOfListsAllocator(const ListOfListsAllocator<Matrix> &other)
Parameters:

other – A reference to an object of type ListOfListsAllocator that should be copied

inline ListOfListsAllocator(ListOfListsAllocator<Matrix> &&other)
Parameters:

other – A reference to an object of type ListOfListsAllocator that should be moved

inline virtual ~ListOfListsAllocator() override
template<typename Matrix>
class IterableListOfListsDecorator : public Matrix
#include <view_matrix_lil.hpp>

Provides row-wise read and write access via iterators to the values stored in a sparse matrix in the list of lists (LIL) format.

Template Parameters:

Matrix – The type of the matrix

Subclassed by BinaryLilMatrix, LilMatrix< T >

Public Types

typedef Matrix::view_type::value_const_iterator value_const_iterator

An iterator that provides read-only access to the values in the matrix.

typedef Matrix::view_type::value_iterator value_iterator

An iterator that provides access to the values in the matrix and allows to modify them.

typedef Matrix::view_type::const_row const_row

Provides read-only access to an individual row in the matrix.

typedef Matrix::view_type::row row

Provides access to an individual row in the matrix and allows to modify it.

Public Functions

inline IterableListOfListsDecorator(typename Matrix::view_type &&view)
Parameters:

view – The view, the matrix should be backed by

inline virtual ~IterableListOfListsDecorator() override
inline const_row operator[](uint32 row) const

Returns a view that provides read-only access to a specific row in the matrix.

Parameters:

row – The index of the row

Returns:

A const_row

inline row operator[](uint32 row)

Returns a view that provides access to a specific row in the matrix and allows to modify it.

Parameters:

row – The index of the row

Returns:

A row

inline value_const_iterator values_cbegin(uint32 row) const

Returns a value_const_iterator to the beginning of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_const_iterator to the beginning of the values

inline value_const_iterator values_cend(uint32 row) const

Returns a value_const_iterator to the end of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_const_iterator to the end of the values

inline value_iterator values_begin(uint32 row)

Returns a value_iterator to the beginning of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_iterator to the beginning of the values

inline value_iterator values_end(uint32 row)

Returns a value_iterator to the end of the values in a specific row of the matrix.

Parameters:

row – The index of the row

Returns:

A value_iterator to the end of the values