20 #ifndef LIBMESH_COUPLING_MATRIX_H
21 #define LIBMESH_COUPLING_MATRIX_H
24 #include "libmesh/libmesh_common.h"
36 class ConstCouplingAccessor;
37 class CouplingAccessor;
39 class ConstCouplingRow;
41 class ConstCouplingRowConstIterator;
68 const unsigned int j)
const;
75 const unsigned int j);
81 unsigned int size()
const;
87 void resize(
const unsigned int n);
144 operator bool()
const {
145 const std::size_t max_size = std::numeric_limits<std::size_t>::max();
149 CouplingMatrix::rc_type::const_iterator lb = std::upper_bound
161 const std::size_t lastloc = lb->second;
164 const std::size_t firstloc = lb->first;
165 libmesh_assert_less_equal(firstloc, lastloc);
166 libmesh_assert_less_equal(firstloc,
_location);
168 CouplingMatrix::rc_type::const_iterator
next = lb;
173 libmesh_assert_greater(
next->first, lastloc+1);
197 template <
typename T>
202 const bool as_bool = new_value;
203 libmesh_assert_equal_to(new_value, as_bool);
211 const std::size_t max_size = std::numeric_limits<std::size_t>::max();
215 CouplingMatrix::rc_type::iterator lb =
227 if (new_value ==
true)
233 const std::size_t firstloc = lb->first;
234 const std::size_t lastloc = lb->second;
235 libmesh_assert_less_equal(firstloc, lastloc);
236 libmesh_assert_less_equal(firstloc,
_location);
240 CouplingMatrix::rc_type::const_iterator
next = lb;
245 libmesh_assert_greater(
next->first, lastloc+1);
252 if (new_value ==
false)
262 libmesh_assert_less (lb->first, lastloc);
268 libmesh_assert_less (firstloc, lb->second);
274 libmesh_assert_less_equal(
_location+1, lastloc);
278 libmesh_assert_less_equal(firstloc,
_location-1);
281 (lb, std::make_pair(firstloc,
_location-1));
289 CouplingMatrix::rc_type::iterator
next = lb;
291 const std::size_t nextloc =
293 std::numeric_limits<std::size_t>::max() :
297 libmesh_assert_greater(nextloc, lastloc+1);
305 next->first = firstloc;
351 const std::size_t max_size = std::numeric_limits<std::size_t>::max();
368 const std::size_t lastloc =
_begin_it->second;
370 const std::size_t firstloc =
_begin_it->first;
371 libmesh_assert_less_equal(firstloc, lastloc);
376 if (zero_location > lastloc)
387 CouplingMatrix::rc_type::const_iterator
prev =
391 if (
prev->second < zero_location)
432 return !(*
this == other);
463 CouplingMatrix::rc_type::const_iterator it_in) :
476 libmesh_assert_equal_to
477 (
_location, std::numeric_limits<size_t>::max());
484 libmesh_assert_not_equal_to
485 (
_location, std::numeric_limits<std::size_t>::max());
491 libmesh_assert_not_equal_to
492 (
_location, std::numeric_limits<std::size_t>::max());
502 _location = std::numeric_limits<std::size_t>::max();
508 _location = std::numeric_limits<std::size_t>::max();
513 _location = std::numeric_limits<std::size_t>::max();
536 return !(*
this == other);
546 CouplingMatrix::rc_type::const_iterator
_it;
561 (*
this, std::numeric_limits<std::size_t>::max(),
580 const unsigned int j)
const
582 libmesh_assert_less (i,
_size);
583 libmesh_assert_less (j,
_size);
585 const std::size_t location = std::size_t(i)*
_size + j;
595 const unsigned int j)
597 const std::size_t location = std::size_t(i)*
_size + j;
640 #endif // LIBMESH_COUPLING_MATRIX_H