UltraScan III
Namespaces
Classes
Files
File List
File Members
utils
us_math2.h
Go to the documentation of this file.
1
#ifndef US_MATH_H
3
#define US_MATH_H
4
5
#include <QtCore>
6
#include "
us_extern.h
"
7
#include "
us_dataIO.h
"
8
#include "
us_solution.h
"
9
10
#define sq(x) ((x) * (x))
11
#ifndef max
12
#define max(a,b) (((a) > (b)) ? (a) : (b))
13
#endif
14
15
#ifndef min
16
#define min(a,b) (((a) < (b)) ? (a) : (b))
17
#endif
18
19
#ifndef swap_double
20
// No need to protect a and b for swap
21
#define swap_double(a,b) {double t = a; a=b; b=t;}
22
#endif
23
25
class
US_UTIL_EXTERN
US_Math2
26
{
27
public
:
29
class
Peptide
30
{
31
public
:
32
uint
a
;
33
uint
b
;
34
uint
c
;
35
uint
d
;
36
uint
e
;
37
uint
f
;
38
uint
g
;
39
uint
h
;
40
uint
i
;
41
uint
j
;
42
uint
k
;
43
uint
l
;
44
uint
m
;
45
uint
n
;
46
uint
o
;
47
uint
p
;
48
uint
q
;
49
uint
r
;
50
uint
s
;
51
uint
t
;
52
uint
u
;
53
uint
v
;
54
uint
w
;
55
uint
x
;
56
uint
y
;
57
uint
z
;
58
uint
dab
;
59
uint
dpr
;
60
double
vbar
;
61
double
vbar20
;
62
double
mw
;
63
double
vbar_sum
;
64
double
weight
;
65
double
e280
;
66
uint
residues
;
67
};
68
70
class
SolutionData
71
{
72
public
:
73
double
density
;
74
double
viscosity
;
75
double
vbar
;
76
double
vbar20
;
77
double
density_wt
;
78
double
density_tb
;
79
double
viscosity_wt
;
80
double
viscosity_tb
;
81
double
buoyancyb
;
82
double
buoyancyw
;
83
double
s20w_correction
;
84
double
D20w_correction
;
85
bool
manual
;
86
};
87
88
92
static
double
box_muller(
double
,
double
);
93
95
static
double
ranf (
void
);
96
107
static
double
linefit (
double
**,
double
**,
double
*,
double
*,
double
*,
108
double
* ,
int
);
109
127
static
int
nearest_curve_point(
double
*,
double
*,
const
int
,
bool
,
128
double
&,
double
&,
double
*,
double
*,
129
double
*,
double
* );
130
140
static
bool
intersect(
double
&,
double
&,
double
&,
double
&,
141
double
*,
double
* );
142
154
155
static
bool
intersect(
double
*,
double
*,
int
,
double
*,
double
*,
int
,
156
double
*,
double
* );
161
162
static
void
calc_vbar(
Peptide
&,
const
QString&,
double
);
163
167
170
static
double
adjust_vbar20
(
double
vbar,
double
degC )
171
{
return
vbar + 4.25e-4 * ( degC - 20.0 ); }
172
174
177
static
double
adjust_vbar
(
double
vbar,
double
degC )
178
{
return
vbar + 4.25e-4 * ( 20.0 - degC ); }
179
183
184
static
void
data_correction(
double
, SolutionData& );
185
191
static
double
normal_distribution(
double
,
double
,
double
);
192
196
197
static
double
time_correction(
const
QVector< US_DataIO::EditedData >& );
198
201
static
uint
randomize(
void
);
202
206
static
uint
randomize(
uint
);
207
251
static
int
nnls(
252
double
* a,
int
a_dim1,
int
m,
int
n,
253
double
* b,
254
double
* x,
255
double
* rnorm = NULL,
256
double
* wp = NULL,
257
double
* zzp = NULL,
258
int
* indexp = NULL
259
);
260
267
static
void
gaussian_smoothing( QVector< double >&,
int
);
268
273
static
double
calcCommonVbar(
US_Solution
&,
double
);
274
280
static
double
erfc(
double
);
281
289
static
int
best_grid_reps(
int
&,
int
& );
290
291
private
:
292
293
static
void
_nnls_g1 (
double
a,
double
b,
double
*,
double
*,
double
* );
294
static
int
_nnls_h12(
int
,
int
,
int
,
int
m,
double
*,
int
,
295
double
*,
double
*,
int
,
int
,
int
);
296
};
297
#endif
298
Generated on Sun Jun 21 2015 11:40:42 for UltraScan III by
1.8.3.1-20130324