multovl  1.3
Multiple overlaps of genomic regions
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
randomplacer.hh
1 /* <LICENSE>
2 License for the MULTOVL multiple genomic overlap tools
3 
4 Copyright (c) 2007-2012, Dr Andras Aszodi,
5 Campus Science Support Facilities GmbH (CSF),
6 Dr-Bohr-Gasse 3, A-1030 Vienna, Austria, Europe.
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions are
11 met:
12 
13  * Redistributions of source code must retain the above copyright notice,
14  this list of conditions and the following disclaimer.
15  * Redistributions in binary form must reproduce the above copyright notice,
16  this list of conditions and the following disclaimer in the documentation
17  and/or other materials provided with the distribution.
18  * Neither the name of the Campus Science Support Facilities GmbH
19  nor the names of its contributors may be used to endorse
20  or promote products derived from this software without specific prior
21  written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
24 AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
27 THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 </LICENSE> */
35 #ifndef MULTOVL_PROB_RANDOMPLACER_HEADER
36 #define MULTOVL_PROB_RANDOMPLACER_HEADER
37 
38 // == Header randomplacer.hh ==
39 
44 
45 // -- Library headers --
46 
47 #include "freeregions.hh"
48 
49 // -- System headers --
50 
51 #include <vector>
52 
53 namespace multovl {
54 namespace prob {
55 
56 // == Classes ==
57 
63 {
64  public:
65 
68  _placed(),
69  _lengths()
70  {}
71 
74  explicit RandomPlacer(const std::vector<Region>& Regions);
75 
79  bool add(unsigned int len);
80 
84  void random_placement(const FreeRegions& frees, UniformGen& rng);
85 
87  const std::vector<Region>& get_regions() const { return _placed; }
88 
89  private:
90 
91  // data
92  std::vector<Region> _placed;
93  std::vector<unsigned int> _lengths;
94 };
95 
96 } // namespace prob
97 } // namespace multovl
98 
99 #endif // MULTOVL_PROB_RANDOMPLACER_HEADER
bool add(unsigned int len)
RandomPlacer()
Init to empty.
Definition: randomplacer.hh:67
Convenience class that wraps a uniform RND generator.
Definition: randomgen.hh:51
const std::vector< Region > & get_regions() const
Returns the randomly placed regions after a random_placement(...) call.
Definition: randomplacer.hh:87
void random_placement(const FreeRegions &frees, UniformGen &rng)
Definition: freeregions.hh:67
Definition: randomplacer.hh:62