<commit_before>//---------------------------------------------------------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------
#ifndef __deal2__block_vector_h
#define __deal2__block_vector_h


#include <base/config.h>
#include <base/exceptions.h>
#include <lac/vector.h>
#include <lac/block_indices.h>
#include <lac/block_vector_base.h>

#include <cstdio>
#include <vector>

DEAL_II_NAMESPACE_OPEN


#ifdef DEAL_II_USE_TRILINOS
namespace TrilinosWrappers
{
  class Vector;
  class BlockVector;
}
#endif



/*! @addtogroup Vectors
 *@{
 */


/**
 * An implementation of block vectors based on deal.II vectors. While the base
 * class provides for most of the interface, this class handles the actual
 * allocation of vectors and provides functions that are specific to the
 * underlying vector type.
 *
 * @note Instantiations for this template are provided for <tt>@<float@> and
 * @<double@></tt>; others can be generated in application programs (see the
 * section on @ref Instantiations in the manual).
 *
 * @author <NAME>, <NAME>, 1999, 2000, 2001, 2002, 2004
 */
template <typename Number>
class BlockVector : public BlockVectorBase<Vector<Number> >
{
  public:
                                     /**
                                      * Typedef the base class for simpler
                                      * access to its own typedefs.
                                      */
    typedef BlockVectorBase<Vector<Number> > BaseClass;
    
                                     /**
                                      * Typedef the type of the underlying
                                      * vector.
                                      */
    typedef typename BaseClass::BlockType  BlockType;

				     /**
				      * Import the typedefs from the base
				      * class.
				      */
    typedef typename BaseClass::value_type      value_type;
    typedef typename BaseClass::real_type       real_type;
    typedef typename BaseClass::pointer         pointer;
    typedef typename BaseClass::const_pointer   const_pointer;
    typedef typename BaseClass::reference       reference;
    typedef typename BaseClass::const_reference const_reference;
    typedef typename BaseClass::size_type       size_type;
    typedef typename BaseClass::iterator        iterator;
    typedef typename BaseClass::const_iterator  const_iterator;

				     /**
				      *  Constructor. There are three
				      *  ways to use this
				      *  constructor. First, without
				      *  any arguments, it generates
				      *  an object with no
				      *  blocks. Given one argument,
				      *  it initializes <tt>num_blocks</tt>
				      *  blocks, but these blocks have
				      *  size zero. The third variant
				      *  finally initializes all
				      *  blocks to the same size
				      *  <tt>block_size</tt>.
				      *
				      *  Confer the other constructor
				      *  further down if you intend to
				      *  use blocks of different
				      *  sizes.
				      */
    explicit BlockVector (const unsigned int num_blocks = 0,
			  const unsigned int block_size = 0);
    
				     /**
				      * Copy-Constructor. Dimension set to
				      * that of V, all components are copied
				      * from V
				      */
    BlockVector (const BlockVector<Number>& V);


#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG    
				     /**
				      * Copy constructor taking a BlockVector of
				      * another data type. This will fail if
				      * there is no conversion path from
				      * <tt>OtherNumber</tt> to <tt>Number</tt>. Note that
				      * you may lose accuracy when copying
				      * to a BlockVector with data elements with
				      * less accuracy.
				      *
				      * Older versions of gcc did not honor
				      * the @p explicit keyword on template
				      * constructors. In such cases, it is
				      * easy to accidentally write code that
				      * can be very inefficient, since the
				      * compiler starts performing hidden
				      * conversions. To avoid this, this
				      * function is disabled if we have
				      * detected a broken compiler during
				      * configuration.
				      */
    template <typename OtherNumber>
    explicit
    BlockVector (const BlockVector<OtherNumber> &v);
#endif    


#ifdef DEAL_II_USE_TRILINOS
				       /**
					* A copy constructor taking a
					* (parallel) Trilinos block
					* vector and copying it into
					* the deal.II own format.
					*/
    BlockVector (const TrilinosWrappers::BlockVector &v);

#endif
                                     /**
                                      * Constructor. Set the number of
                                      * blocks to
                                      * <tt>block_sizes.size()</tt> and
                                      * initialize each block with
                                      * <tt>block_sizes[i]</tt> zero
                                      * elements.
                                      */
    BlockVector (const std::vector<unsigned int> &block_sizes);

				     /**
				      * 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<commit_msg>Reindent one comment.<commit_after>//---------------------------------------------------------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//---------------------------------------------------------------------------
#ifndef __deal2__block_vector_h
#define __deal2__block_vector_h


#include <base/config.h>
#include <base/exceptions.h>
#include <lac/vector.h>
#include <lac/block_indices.h>
#include <lac/block_vector_base.h>

#include <cstdio>
#include <vector>

DEAL_II_NAMESPACE_OPEN


#ifdef DEAL_II_USE_TRILINOS
namespace TrilinosWrappers
{
  class Vector;
  class BlockVector;
}
#endif



/*! @addtogroup Vectors
 *@{
 */


/**
 * An implementation of block vectors based on deal.II vectors. While the base
 * class provides for most of the interface, this class handles the actual
 * allocation of vectors and provides functions that are specific to the
 * underlying vector type.
 *
 * @note Instantiations for this template are provided for <tt>@<float@> and
 * @<double@></tt>; others can be generated in application programs (see the
 * section on @ref Instantiations in the manual).
 *
 * @author <NAME>, <NAME>, 1999, 2000, 2001, 2002, 2004
 */
template <typename Number>
class BlockVector : public BlockVectorBase<Vector<Number> >
{
  public:
                                     /**
                                      * Typedef the base class for simpler
                                      * access to its own typedefs.
                                      */
    typedef BlockVectorBase<Vector<Number> > BaseClass;
    
                                     /**
                                      * Typedef the type of the underlying
                                      * vector.
                                      */
    typedef typename BaseClass::BlockType  BlockType;

				     /**
				      * Import the typedefs from the base
				      * class.
				      */
    typedef typename BaseClass::value_type      value_type;
    typedef typename BaseClass::real_type       real_type;
    typedef typename BaseClass::pointer         pointer;
    typedef typename BaseClass::const_pointer   const_pointer;
    typedef typename BaseClass::reference       reference;
    typedef typename BaseClass::const_reference const_reference;
    typedef typename BaseClass::size_type       size_type;
    typedef typename BaseClass::iterator        iterator;
    typedef typename BaseClass::const_iterator  const_iterator;

				     /**
				      *  Constructor. There are three
				      *  ways to use this
				      *  constructor. First, without
				      *  any arguments, it generates
				      *  an object with no
				      *  blocks. Given one argument,
				      *  it initializes <tt>num_blocks</tt>
				      *  blocks, but these blocks have
				      *  size zero. The third variant
				      *  finally initializes all
				      *  blocks to the same size
				      *  <tt>block_size</tt>.
				      *
				      *  Confer the other constructor
				      *  further down if you intend to
				      *  use blocks of different
				      *  sizes.
				      */
    explicit BlockVector (const unsigned int num_blocks = 0,
			  const unsigned int block_size = 0);
    
				     /**
				      * Copy-Constructor. Dimension set to
				      * that of V, all components are copied
				      * from V
				      */
    BlockVector (const BlockVector<Number>& V);


#ifndef DEAL_II_EXPLICIT_CONSTRUCTOR_BUG    
				     /**
				      * Copy constructor taking a BlockVector of
				      * another data type. This will fail if
				      * there is no conversion path from
				      * <tt>OtherNumber</tt> to <tt>Number</tt>. Note that
				      * you may lose accuracy when copying
				      * to a BlockVector with data elements with
				      * less accuracy.
				      *
				      * Older versions of gcc did not honor
				      * the @p explicit keyword on template
				      * constructors. In such cases, it is
				      * easy to accidentally write code that
				      * can be very inefficient, since the
				      * compiler starts performing hidden
				      * conversions. To avoid this, this
				      * function is disabled if we have
				      * detected a broken compiler during
				      * configuration.
				      */
    template <typename OtherNumber>
    explicit
    BlockVector (const BlockVector<OtherNumber> &v);
#endif    


#ifdef DEAL_II_USE_TRILINOS
				     /**
				      * A copy constructor taking a
				      * (parallel) Trilinos block
				      * vector and copying it into
				      * the deal.II own format.
				      */
    BlockVector (const TrilinosWrappers::BlockVector &v);

#endif
                                     /**
                                      * Constructor. Set the number of
                                      * blocks to
                                      * <tt>block_sizes.size()</tt> and
                                      * initialize each block with
                                      * <tt>block_sizes[i]</tt> zero
                                      * elements.
                                      */
    BlockVector (const std::vector<unsigned int> &block_sizes);

				     /**
				      * 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
{'fraction_non_alphanumeric': 0.09753548724200993, 'fraction_numerical': 0.011495253853522599, 'mean_word_length': 1.5350993377483444, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1870274', 'n_tokens_mistral': 3456, 'n_tokens_neox': 2735, 'n_words': 984}