lpinterface
 All Classes Namespaces Files Functions Variables Enumerations Enumerator
Public Types | Public Member Functions | List of all members
lpint::MatrixEntry< T > Class Template Reference

Matrix entry type, for use in sparse matrix. The matrix entry base class is specialized as Row and Column, for the two sparse matrix representations. The class thus represents a row or column vector with mostly zero entries. Its operator[] is overloaded to provide access as if it is a dense vector. Access using operator[] is O(n) in time, with n the number of nonzero entries. More...

#include <data_objects.hpp>

Inheritance diagram for lpint::MatrixEntry< T >:
lpint::Column< T > lpint::Row< T >

Public Types

using Index = int
 
using SizeType = std::size_t
 
using iterator_category = std::forward_iterator_tag
 
using value_type = T
 
using difference_type = int
 
using pointer = value_type *
 
using reference = value_type &
 

Public Member Functions

 MatrixEntry (MatrixEntry< T > &&)=default
 
 MatrixEntry (const MatrixEntry< T > &)=delete
 
MatrixEntry< T > & operator= (const MatrixEntry< T > &)=delete
 
MatrixEntry< T > & operator= (MatrixEntry< T > &&)=default
 
 MatrixEntry (const std::size_t size)
 
 MatrixEntry (const std::vector< T > &values, const std::vector< Index > &indices)
 
operator[] (const SizeType index) const
 Indexing operator; can be used identically to a dense vector. Will perform bounds checking ifndef NDEBUG. More...
 
lower_bound () const
 Returns the smallest entry of this matrix element.
 
upper_bound () const
 Returns the largest entry of this matrix element.
 
std::vector< T >::size_type num_nonzero () const
 Return the number of nonzero entries in the matrix entry.
 
const std::vector< T > & values () const
 Get a const reference to the underlying value array.
 
std::vector< T > & values ()
 Get a reference to the underlying value array.
 
const std::vector< Index > & nonzero_indices () const
 Get a const reference to the underlying nonzero indices.
 
std::vector< Index > & nonzero_indices ()
 Get a reference to the underlying nonzero indices.
 
iterator begin ()
 
const_iterator begin () const
 Obtain a const iterator to the begin of the underlying value array.
 
iterator end ()
 Obtain an iterator to the end of the underlying value array.
 
const_iterator end () const
 Obtain a const iterator to the end of the underlying value array.
 

Detailed Description

template<typename T>
class lpint::MatrixEntry< T >

Matrix entry type, for use in sparse matrix. The matrix entry base class is specialized as Row and Column, for the two sparse matrix representations. The class thus represents a row or column vector with mostly zero entries. Its operator[] is overloaded to provide access as if it is a dense vector. Access using operator[] is O(n) in time, with n the number of nonzero entries.

Member Function Documentation

template<typename T>
iterator lpint::MatrixEntry< T >::begin ( )
inline

Obtain an iterator to the begin of the ests/CMakeFiles/unit_tests.dir/all] Error 2

template<typename T>
T lpint::MatrixEntry< T >::operator[] ( const SizeType  index) const
inline

Indexing operator; can be used identically to a dense vector. Will perform bounds checking ifndef NDEBUG.

Parameters
indexIndex of element to retrieve.
Returns
T Element at index.

The documentation for this class was generated from the following file: