gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
random_tools.hpp File Reference
#include <iostream>
#include <cstdio>
#include "gambit/Utils/threadsafe_rng.hpp"
Include dependency graph for random_tools.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Cholesky
 
class  Ran_old
 
class  Ran
 
class  ExponDev
 
class  NormalDev
 
class  BasicDevs
 
class  MultiNormalDev
 
class  AdvanceDevs
 
class  RandomPlane
 
class  RandomBasis
 
class  TransformRandomBasis
 
class  MultiNormDev
 

Functions

template<typename T >
T * matrix (const int xN)
 
template<typename T >
T ** matrix (const int xN, const int yN)
 
template<typename T >
T *** matrix (const int xN, const int yN, const int zN)
 
template<typename T >
T * matrix (const int xN, T in)
 
template<typename T >
T ** matrix (const int xN, const int yN, T in)
 
template<typename T >
T *** matrix (const int xN, const int yN, const int zN, T in)
 
template<typename T >
T * matrix (const int xN, T *in)
 
template<typename T >
T ** matrix (const int xN, const int yN, T **in)
 
template<typename T >
T *** matrix (const int xN, const int yN, const int zN, T ***in)
 
template<typename T >
void del (T *temp)
 
template<typename T >
void del (T **temp, int xN)
 
template<typename T >
void del (T ***temp, int xN, int yN)
 
template<class T >
const T SQ (const T a)
 
template<class T >
const T SQR (const T a)
 

Function Documentation

◆ del() [1/3]

template<typename T >
void del ( T *  temp)

Definition at line 130 of file random_tools.hpp.

131 {
132  delete[] temp;
133  temp = NULL;
134 }

◆ del() [2/3]

template<typename T >
void del ( T **  temp,
int  xN 
)

Definition at line 137 of file random_tools.hpp.

138 {
139  for (int i = 0; i < xN; i++)
140  delete[] temp[i];
141 
142  delete[] temp;
143  temp = NULL;
144 }

◆ del() [3/3]

template<typename T >
void del ( T ***  temp,
int  xN,
int  yN 
)

Definition at line 147 of file random_tools.hpp.

148 {
149  for (int i = 0; i < xN; i++)
150  {
151  for (int j = 0; j < yN; j++)
152  delete[] temp[i][j];
153  delete[] temp[i];
154  }
155 
156  delete[] temp;
157  temp = NULL;
158 }

◆ matrix() [1/9]

template<typename T >
T* matrix ( const int  xN)

Definition at line 9 of file random_tools.hpp.

10 {
11  T *temp = new T[xN];
12 
13  return temp;
14 }

◆ matrix() [2/9]

template<typename T >
T** matrix ( const int  xN,
const int  yN 
)

Definition at line 17 of file random_tools.hpp.

18 {
19  T **temp = new T*[xN];
20 
21  for (int i = 0; i < xN; i++)
22  temp[i] = new T[yN];
23 
24  return temp;
25 }

◆ matrix() [3/9]

template<typename T >
T*** matrix ( const int  xN,
const int  yN,
const int  zN 
)

Definition at line 28 of file random_tools.hpp.

29 {
30  T ***temp = new T**[xN];
31 
32  for (int i = 0; i < xN; i++)
33  {
34  temp[i] = new T*[yN];
35  for (int j = 0; j < yN; j++)
36  temp[i][j] = new T[zN];
37  }
38  return temp;
39 }

◆ matrix() [4/9]

template<typename T >
T* matrix ( const int  xN,
in 
)

Definition at line 42 of file random_tools.hpp.

43 {
44  T *temp = new T[xN];
45 
46  for (int i = 0; i < xN; i++)
47  temp[i] = in;
48 
49  return temp;
50 }

◆ matrix() [5/9]

template<typename T >
T** matrix ( const int  xN,
const int  yN,
in 
)

Definition at line 53 of file random_tools.hpp.

54 {
55  T **temp = new T*[xN];
56 
57  for (int i = 0; i < xN; i++)
58  {
59  temp[i] = new T[yN];
60  for (int j = 0; j < yN; j++)
61  temp[i][j] = in;
62  }
63 
64  return temp;
65 }

◆ matrix() [6/9]

template<typename T >
T*** matrix ( const int  xN,
const int  yN,
const int  zN,
in 
)

Definition at line 68 of file random_tools.hpp.

69 {
70  T ***temp = new T**[xN];
71 
72  for (int i = 0; i < xN; i++)
73  {
74  temp[i] = new T*[yN];
75  for (int j = 0; j < yN; j++)
76  {
77  temp[i][j] = new T[zN];
78  for (int k = 0; k < zN; k++)
79  temp[i][j][k] = in;
80  }
81  }
82  return temp;
83 }

◆ matrix() [7/9]

template<typename T >
T* matrix ( const int  xN,
T *  in 
)

Definition at line 86 of file random_tools.hpp.

87 {
88  T *temp = new T[xN];
89  for (int i = 0; i < xN; i++)
90  temp[i] = in[i];
91 
92  return temp;
93 }

◆ matrix() [8/9]

template<typename T >
T** matrix ( const int  xN,
const int  yN,
T **  in 
)

Definition at line 96 of file random_tools.hpp.

97 {
98  T **temp = new T*[xN];
99 
100  for (int i = 0; i < xN; i++)
101  {
102  temp[i] = new T[yN];
103  for (int j = 0; j < yN; j++)
104  temp[i][j] = in[i][j];
105  }
106 
107  return temp;
108 }

◆ matrix() [9/9]

template<typename T >
T*** matrix ( const int  xN,
const int  yN,
const int  zN,
T ***  in 
)

Definition at line 111 of file random_tools.hpp.

112 {
113  T ***temp = new T**[xN];
114 
115  for (int i = 0; i < xN; i++)
116  {
117  temp[i] = new T*[yN];
118  for (int j = 0; j < yN; j++)
119  {
120  temp[i][j] = new T[zN];
121  for (int k = 0; k < zN; k++)
122  temp[i][j][k] = in[i][j][k];
123  }
124  }
125  return temp;
126 }

◆ SQ()

template<class T >
const T SQ ( const T  a)
inline

Definition at line 161 of file random_tools.hpp.

161 {return a*a;}

◆ SQR()

template<class T >
const T SQR ( const T  a)
inline

Definition at line 164 of file random_tools.hpp.

References Cholesky::el, and Cholesky::num.

164 {return a*a;}