Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F76533531
distrib.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Aug 8, 13:23
Size
727 B
Mime Type
text/x-c++
Expires
Sat, Aug 10, 13:23 (2 d)
Engine
blob
Format
Raw Data
Handle
19727629
Attached To
rSTICAZZI yearII_reports
distrib.h
View Options
#ifndef __DISTRIB_H__
#define __DISTRIB_H__
#include <complex>
#include "symbasic/svector.h"
namespace
dstb
{
class
gaussian
{
typedef
std
::
complex
<
double
>
cmpx
;
public:
gaussian
(
double
_x0
=
0
,
double
s_norm
=
1
,
unsigned
int
n
=
1
,
const
SVector
<
double
,
2
>&
bounds
=
{
0
,
1
})
:
x0
(
_x0
),
sigma
(
s_norm
*
(
bounds
[
1
]
-
bounds
[
0
])),
k0
(
2
*
M_PI
*
n
/
(
bounds
[
1
]
-
bounds
[
0
])),
C
(
sqrt
(
sigma
*
sqrt
(
M_PI
)))
{}
cmpx
operator
()(
double
x
)
const
{
using
namespace
std
::
complex_literals
;
return
C
*
exp
(
1
i
*
k0
*
x
-
pow
((
x
-
x0
)
/
sigma
,
2
)
/
2
);
}
private:
double
x0
,
sigma
,
k0
;
const
double
C
;
};
}
#endif
Event Timeline
Log In to Comment