]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add complete_index_set().
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 May 2013 18:59:19 +0000 (18:59 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 May 2013 18:59:19 +0000 (18:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@29577 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/base/index_set.h

index 2366459758cad22fa9bcc7ff9a0efa69a0ec6b9c..366a4d36187928c4542bd91ff48cf9266ba4b0cb 100644 (file)
@@ -121,6 +121,13 @@ this function.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> New: The global function <code>complete_index_set()</code>
+creates and returns an index set of given size that contains
+every single index with this range.
+<br>
+(Wolfgang Bangerth, 2013/05/24)
+</li>
+
 <li> New: All vector classes now have a static member variable
 <code>supports_distributed_data</code> that indicates whether the
 vector class supports data that is distributed across multiple
index c0cf5a1ddd3cc471d464501aa60cec30e0176bf2..3fed2dcc20c3790156d893ab1610efee9a0b2e44 100644 (file)
@@ -571,6 +571,32 @@ private:
 };
 
 
+/**
+ * Create and return an index set of size $N$ that contains every
+ * single index within this range. In essence, this function
+ * returns an index set created by
+ * @code
+ *  IndexSet is (N);
+ *  is.add_range(0, N);
+ * @endcode
+ * This function exists so that one can create and initialize
+ * index sets that are complete in one step, or so one can write
+ * code like
+ * @code
+ *   if (my_index_set == complete_index_set(my_index_set.size())
+ *     ...
+ * @endcode
+ *
+ * @relates IndexSet
+ */
+inline
+IndexSet complete_index_set (const unsigned int N)
+{
+  IndexSet is (N);
+  is.add_range(0, N);
+  return is;
+}
+
 /* ------------------ inline functions ------------------ */
 
 inline

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.