RNAblueprint-1.3.2
pairing_matrix.h
Go to the documentation of this file.
1 
11 #ifndef PAIRING_MATRIX_H
12 #define PAIRING_MATRIX_H
13 
14 // include common header with graph definition and global variables
15 #include "common.h"
16 
17 // include standard library parts
18 #include <sstream>
19 #include <unordered_map>
20 
21 namespace design {
22  namespace detail {
23  //typedefs
24  typedef matrix< SolutionSizeType, A_Size, A_Size > rnaMatrix;
25 
26  class Fibonacci {
27  public:
28  Fibonacci(unsigned int l);
29 
30  unsigned int get(unsigned int n) {
31  return numbers[n - 1];
32  };
33  private:
34  std::vector< unsigned int > numbers;
35  };
36 
37  // Class to get Pairing numbers implemented as a Singleton to be unique
38  class PairingMatrix {
39  public:
40  static PairingMatrix* Instance();
41  // interface
42  SolutionSizeType get(unsigned int l, unsigned int b1, unsigned int b2);
43  protected:
44  PairingMatrix();
45  ~PairingMatrix();
46  private:
47  static PairingMatrix * _instance;
48  std::vector< rnaMatrix > p;
49  void extend(unsigned int newlength);
50  rnaMatrix multiply(rnaMatrix a, rnaMatrix b);
51  unsigned int length;
52  };
53  }
54 }
55 
56 
57 #endif /* PAIRING_MATRIX_H */
58 
59 /*
60  * \endcond INTERNAL
61  */
This file holds all global includes, definitions and variables.
All classes and functions for the RNA design library are under the design namespace.
Definition: RNAblueprint.h:101