It was referred to as "n" or "N" in some functions.
/**
* Constructor. Initialize the number of entries in each block @p i as
- * <tt>n[i]</tt>. The number of blocks will be the size of the vector
+ * <tt>block_sizes[i]</tt>. The number of blocks will be the size of @p
+ * block_sizes.
*/
- BlockIndices (const std::vector<size_type> &n);
+ BlockIndices (const std::vector<size_type> &block_sizes);
/**
* Specialized constructor for a structure with blocks of equal size.
/**
* Reinitialize the number of indices within each block from the given
- * argument. The number of blocks will be adjusted to the size of @p n and
- * the size of block @p i is set to <tt>n[i]</tt>.
+ * argument. The number of blocks will be adjusted to the size of
+ * <tt>block_sizes</tt> and the size of block @p i is set to
+ * <tt>block_sizes[i]</tt>.
*/
- void reinit (const std::vector<size_type> &n);
+ void reinit (const std::vector<size_type> &block_sizes);
/**
* Add another block of given size to the end of the block structure.
inline
void
-BlockIndices::reinit (const std::vector<size_type> &n)
+BlockIndices::reinit (const std::vector<size_type> &block_sizes)
{
- if (start_indices.size() != n.size()+1)
+ if (start_indices.size() != block_sizes.size()+1)
{
- n_blocks = static_cast<unsigned int>(n.size());
+ n_blocks = static_cast<unsigned int>(block_sizes.size());
start_indices.resize(n_blocks+1);
}
start_indices[0] = 0;
for (size_type i=1; i<=n_blocks; ++i)
- start_indices[i] = start_indices[i-1] + n[i-1];
+ start_indices[i] = start_indices[i-1] + block_sizes[i-1];
}
inline
-BlockIndices::BlockIndices (const std::vector<size_type> &n)
+BlockIndices::BlockIndices (const std::vector<size_type> &block_sizes)
:
- n_blocks(static_cast<unsigned int>(n.size())),
- start_indices(n.size()+1)
+ n_blocks(static_cast<unsigned int>(block_sizes.size())),
+ start_indices(block_sizes.size()+1)
{
- reinit (n);
+ reinit (block_sizes);
}
BlockVector (const BlockIndices &block_indices);
/**
- * Constructor. Set the number of blocks to <tt>n.size()</tt>. Initialize
- * the vector with the elements pointed to by the range of iterators given
- * as second and third argument. Apart from the first argument, this
- * constructor is in complete analogy to the respective constructor of the
- * <tt>std::vector</tt> class, but the first argument is needed in order to
- * know how to subdivide the block vector into different blocks.
+ * Constructor. Set the number of blocks to <tt>block_sizes.size()</tt>.
+ * Initialize the vector with the elements pointed to by the range of
+ * iterators given as second and third argument. Apart from the first
+ * argument, this constructor is in complete analogy to the respective
+ * constructor of the <tt>std::vector</tt> class, but the first argument is
+ * needed in order to know how to subdivide the block vector into different
+ * blocks.
*/
template <typename InputIterator>
- BlockVector (const std::vector<size_type> &n,
+ BlockVector (const std::vector<size_type> &block_sizes,
const InputIterator first,
const InputIterator end);
* reinit() on one of the blocks, then subsequent actions on this object may
* yield unpredictable results since they may be routed to the wrong block.
*/
- void reinit (const std::vector<size_type> &N,
+ void reinit (const std::vector<size_type> &block_sizes,
const bool fast=false);
/**
template <typename Number>
template <typename InputIterator>
-BlockVector<Number>::BlockVector (const std::vector<size_type> &n,
+BlockVector<Number>::BlockVector (const std::vector<size_type> &block_sizes,
const InputIterator first,
const InputIterator end)
{
// don't initialize them as we will
// copy elements soon
(void)end;
- reinit (n, true);
+ reinit (block_sizes, true);
InputIterator start = first;
- for (size_type b=0; b<n.size(); ++b)
+ for (size_type b=0; b<block_sizes.size(); ++b)
{
InputIterator end = start;
- std::advance (end, static_cast<signed int>(n[b]));
+ std::advance (end, static_cast<signed int>(block_sizes[b]));
std::copy (start, end, this->block(b).begin());
start = end;
};
template <typename Number>
-BlockVector<Number>::BlockVector (const std::vector<size_type> &n)
+BlockVector<Number>::BlockVector (const std::vector<size_type> &block_sizes)
{
- reinit (n, false);
+ reinit (block_sizes, false);
}
const size_type bl_sz,
const bool fast)
{
- std::vector<size_type> n(n_bl, bl_sz);
- reinit(n, fast);
+ std::vector<size_type> block_sizes(n_bl, bl_sz);
+ reinit(block_sizes, fast);
}
template <typename Number>
-void BlockVector<Number>::reinit (const std::vector<size_type> &n,
+void BlockVector<Number>::reinit (const std::vector<size_type> &block_sizes,
const bool fast)
{
- this->block_indices.reinit (n);
+ this->block_indices.reinit (block_sizes);
if (this->components.size() != this->n_blocks())
this->components.resize(this->n_blocks());
for (size_type i=0; i<this->n_blocks(); ++i)
- this->components[i].reinit(n[i], fast);
+ this->components[i].reinit(block_sizes[i], fast);
}