So-Bogus
A c++ sparse block matrix library aimed at Second Order cone problems
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
bogus::SparseBlockIndex< true, Index_, BlockPtr_, ArrayType > Struct Template Reference

Compressed index, compatible with usual BSR/BSC formats. More...

#include <CompressedSparseBlockIndex.hpp>

Inheritance diagram for bogus::SparseBlockIndex< true, Index_, BlockPtr_, ArrayType >:
bogus::SparseBlockIndexBase< SparseBlockIndex< true, Index_, BlockPtr_, ArrayType > >

Public Types

typedef Index_ Index
 
typedef BlockPtr_ BlockPtr
 
typedef SparseBlockIndexBase
< SparseBlockIndex< true,
Index_, BlockPtr_, ArrayType > > 
Base
 
typedef Base::InnerOffsetsType InnerOffsetsType
 
typedef Base::InnerIterator InnerIterator
 
typedef ArrayType< Index >::Type Inner
 
typedef ArrayType< Index >::Type Outer
 
typedef SparseBlockIndexTraits
< SparseBlockIndex< true,
Index_, BlockPtr_, ArrayType > > 
Traits
 

Public Member Functions

void resizeOuter (Index size)
 
void reserve (Index nnz)
 
Index outerSize () const
 
Index nonZeros () const
 
const InnerOffsetsType & innerOffsetsArray () const
 
template<bool Ordered>
void insert (Index outIdx, Index inIdx, BlockPtr ptr)
 
void insertBack (Index outIdx, Index inIdx, BlockPtr ptr)
 
void finalize ()
 Finalizes the outer indices vector. More...
 
void clear ()
 
SparseBlockIndexoperator= (const SparseBlockIndex &compressed)
 
template<typename SourceDerived >
SparseBlockIndexoperator= (const SparseBlockIndexBase< SourceDerived > &source)
 
SparseBlockIndexmove (SparseBlockIndex &compressed)
 
template<typename SourceDerived >
SparseBlockIndexmove (const SparseBlockIndexBase< SourceDerived > &source)
 
Index size (const Index outerIdx) const
 
const Index * rowIndex () const
 
const Index * columns () const
 
const Index * outerIndexPtr () const
 
const Index * innerIndexPtr () const
 
SparseBlockIndex< true, Index_,
BlockPtr_, ArrayType > & 
derived ()
 
const SparseBlockIndex< true,
Index_, BlockPtr_, ArrayType > & 
derived () const
 
Index innerSize () const
 Number of elements of the minor indexing direction. More...
 
bool hasInnerOffsets () const
 Returns whether the innerOffsetsArray() has been filled.
 
const Index * innerOffsetsData () const
 Same as innerOffsetsArray, but returns a pointer instead. Assumes hasInnerOffsets()
 
InnerIterator begin (const Index outerIdx) const
 Returns an iterator to the first non-empty block of outerIdx.
 
InnerIterator last (const Index outerIdx) const
 Returns an iterator to the last non-empty block of outerIdx.
 
InnerIterator end (const Index outerIdx) const
 Returns an iterator to the end of outerIdx.
 

Public Attributes

InnerOffsetsType innerOffsets
 
Inner inner
 Vector of inner indices.
 
Outer outer
 Vector encoding the start and end of inner vectors.
 
bool valid
 Whether this index is currently valid.
 

Detailed Description

template<typename Index_, typename BlockPtr_, template< typename > class ArrayType>
struct bogus::SparseBlockIndex< true, Index_, BlockPtr_, ArrayType >

Compressed index, compatible with usual BSR/BSC formats.

Member Function Documentation

template<typename Index_ , typename BlockPtr_ , template< typename > class ArrayType>
void bogus::SparseBlockIndex< true, Index_, BlockPtr_, ArrayType >::finalize ( )

Finalizes the outer indices vector.

Before calling this function, outer[i] contains the number of blocks in the i th inner vector

After calling this functions, outer[i] contains the index of the start of the i th inner vector in inner, and outer[i+1] its end

Index bogus::SparseBlockIndexBase< SparseBlockIndex< true, Index_, BlockPtr_, ArrayType > >::innerSize ( ) const
inherited

Number of elements of the minor indexing direction.

i.e. number of cols for a row-major index

template<typename Index_ , typename BlockPtr_ , template< typename > class ArrayType>
template<bool Ordered>
void bogus::SparseBlockIndex< true, Index_, BlockPtr_, ArrayType >::insert ( Index  outIdx,
Index  inIdx,
BlockPtr  ptr 
)
Warning
Only works for ordered insertion, and a call to finalize() is always required once insertion is finished

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