33 #ifndef SCALAR_VECTOR_ADAPTER_HH_
34 #define SCALAR_VECTOR_ADAPTER_HH_
48 template<
class AT,
class ST>
54 static const int blockSize = AT::blockSize;
61 {
return BlockRef(m_src[i/blockSize], i%blockSize);}
63 inline const value_type &operator [] (
size_t i)
const {
return (i);}
65 void resize(
size_t newSize,
bool bCopyValues=
true)
67 m_src.resize_exactly(newSize/blockSize, bCopyValues);
69 void reserve(
size_t newCapacity,
bool bCopyValues=
true)
71 m_src.reserve_exactly(newCapacity/blockSize, bCopyValues);
73 void print(
const char *
const text = NULL)
const
78 size_t size()
const {
return (m_src.size()*blockSize);}
Definition: scalar_vector_adapter.hh:49
void print(const char *const text=NULL) const
Definition: scalar_vector_adapter.hh:73
void reserve(size_t newCapacity, bool bCopyValues=true)
Definition: scalar_vector_adapter.hh:69
encapsulated_vector_type & m_src
Definition: scalar_vector_adapter.hh:80
ST::vector_type::value_type value_type
Definition: scalar_vector_adapter.hh:53
ScalarVectorAdapter(encapsulated_vector_type &vec)
Definition: scalar_vector_adapter.hh:58
value_type & operator[](size_t i)
Definition: scalar_vector_adapter.hh:60
AT::vector_type encapsulated_vector_type
Definition: scalar_vector_adapter.hh:52
size_t size() const
Definition: scalar_vector_adapter.hh:78
void resize(size_t newSize, bool bCopyValues=true)
Definition: scalar_vector_adapter.hh:65
double & BlockRef(T &vec, size_t i)
Definition: blocks.h:66
T value_type
Definition: sparsematrix_interface.h:2