~ubuntu-branches/ubuntu/trusty/deal.ii/trusty

« back to all changes in this revision

Viewing changes to contrib/boost/include/boost/graph/two_bit_color_map.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV, Adam C. Powell, IV, Denis Barbier
  • Date: 2010-07-29 13:47:01 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100729134701-akb8jb3stwge8tcm
Tags: 6.3.1-1
[ Adam C. Powell, IV ]
* Changed to source format 3.0 (quilt).
* Changed maintainer to debian-science with Adam Powell as uploader.
* Added source lintian overrides about Adam Powell's name.
* Added Vcs info on git repository.
* Bumped Standards-Version.
* Changed stamp-patch to patch target and fixed its application criterion.
* Moved make_dependencies and expand_instantiations to a versioned directory
  to avoid shlib package conflicts.

[ Denis Barbier ]
* New upstream release (closes: #562332).
  + Added libtbb support.
  + Forward-ported all patches.
* Updates for new PETSc version, including workaround for different versions
  of petsc and slepc.
* Add debian/watch.
* Update to debhelper 7.
* Added pdebuild patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#ifndef BOOST_TWO_BIT_COLOR_MAP_HPP
14
14
#define BOOST_TWO_BIT_COLOR_MAP_HPP
15
15
 
16
 
#include <boost/property_map.hpp>
 
16
#include <boost/property_map/property_map.hpp>
17
17
#include <boost/shared_array.hpp>
 
18
#include <algorithm>
18
19
 
19
20
namespace boost {
20
21
 
50
51
  explicit two_bit_color_map(std::size_t n, const IndexMap& index = IndexMap())
51
52
    : n(n), index(index), data(new unsigned char[(n + 3) / 4])
52
53
  {
 
54
    // Fill to white
 
55
    std::fill(data.get(), data.get() + (n + 3) / 4, 0);
53
56
  }
54
57
};
55
58
 
59
62
    typename two_bit_color_map<IndexMap>::key_type key) 
60
63
{
61
64
  typename property_traits<IndexMap>::value_type i = get(pm.index, key);
62
 
  assert (i < pm.n);
 
65
  assert ((std::size_t)i < pm.n);
63
66
  return two_bit_color_type((pm.data.get()[i / 4] >> ((i % 4) * 2)) & 3);
64
67
}
65
68
 
70
73
    two_bit_color_type value)
71
74
{
72
75
  typename property_traits<IndexMap>::value_type i = get(pm.index, key);
73
 
  assert (i < pm.n);
 
76
  assert ((std::size_t)i < pm.n);
74
77
  assert (value >= 0 && value < 4);
75
78
  std::size_t byte_num = i / 4;
76
79
  std::size_t bit_position = ((i % 4) * 2);
88
91
} // end namespace boost
89
92
 
90
93
#endif // BOOST_TWO_BIT_COLOR_MAP_HPP
 
94
 
 
95
#ifdef BOOST_GRAPH_USE_MPI
 
96
#  include <boost/graph/distributed/two_bit_color_map.hpp>
 
97
#endif