Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Frida
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coenen, Joachim
Frida
Commits
fa2476ed
Commit
fa2476ed
authored
16 years ago
by
Wuttke, Joachim
Browse files
Options
Downloads
Patches
Plain Diff
cv-auxiliary-parameters are per-file
parent
844fbe63
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/curve.cpp
+38
-21
38 additions, 21 deletions
src/curve.cpp
src/curve.h
+1
-1
1 addition, 1 deletion
src/curve.h
src/frida2.cpp
+13
-14
13 additions, 14 deletions
src/frida2.cpp
src/olm.h
+3
-0
3 additions, 0 deletions
src/olm.h
with
55 additions
and
36 deletions
src/curve.cpp
+
38
−
21
View file @
fa2476ed
...
...
@@ -18,6 +18,24 @@ using namespace std;
#include
"../../code/lmfit/lmmin.h"
#include
"xax.h"
//! local functions (wouldn't suffice "static" ??)
namespace
NCurveFile
{
void
IntegrateFile
(
const
COlc
*
fin
,
const
int
k
,
const
string
&
mode
,
const
int
ip
,
const
string
&
name
,
const
CCoord
&
ico
);
double
NumericIntegral
(
const
COlc
*
fc
,
const
CCurve
*
c
,
const
int
k
,
const
int
j
,
const
double
low
,
const
double
hig
);
// parameters for numeric integration:
double
numint_bound_low
=-
INFINITY
,
numint_bound_hig
=
INFINITY
;
// tuning parameters:
int
numint_mode
=
4
;
int
numint_cvmode
=-
1
;
double
numint_epsabs
=
1e-10
,
numint_epsrel
=
1e-10
;
};
//***************************************************************************//
//* generic operations on curves *//
...
...
@@ -63,7 +81,7 @@ int CCurve::Load(FILE *fd, uint nz)
//! Create curve files.
void
NCurveFile
::
Create
(
bool
refers_to_data
,
bool
with_convolution
)
void
NCurveFile
::
Create
(
bool
refers_to_data
)
{
static
int
default_no
=
0
;
...
...
@@ -87,6 +105,9 @@ void NCurveFile::Create( bool refers_to_data, bool with_convolution )
f
.
weight_y_log
=
false
;
f
.
expr
=
expr
;
f
.
T
=
T
;
f
.
cv_intmod
=
NCurveFile
::
numint_cvmode
;
f
.
cv_epsabs
=
NCurveFile
::
numint_epsabs
;
f
.
cv_epsrel
=
NCurveFile
::
numint_epsrel
;
vector
<
double
>
P
(
np
,
1.0
);
// use f to create output file(s)
...
...
@@ -249,7 +270,7 @@ void NCurveFile::SetFixed(string how)
}
//! Set convolution
//! Set convolution
.
void
NCurveFile
::
SetConvolution
(
bool
onoff
)
{
...
...
@@ -266,6 +287,21 @@ void NCurveFile::SetConvolution( bool onoff )
fc
->
kconv
=
k
;
}
//! Set auxiliary parameters for numeric convolution.
void
NCurveFile
::
SetConvEps
()
{
static
double
epsabs
=
1e-10
,
epsrel
=
1e-10
;
epsrel
=
dask
(
"Eps rel for convolution"
,
epsrel
);
epsabs
=
dask
(
"Eps abs for convolution"
,
epsabs
);
COlc
*
fc
;
NOlm
::
IterateC
fiter
;
while
(
(
fc
=
fiter
())
)
{
fc
->
cv_epsabs
=
epsabs
;
fc
->
cv_epsrel
=
epsrel
;
}
}
//! Set auxiliary parameters (weighing, ..).
void
NCurveFile
::
SetProperties
(
string
which
)
...
...
@@ -524,25 +560,6 @@ double myeval( double x, void* data )
}
//! local functions (wouldn't suffice "static" ??)
namespace
NCurveFile
{
void
IntegrateFile
(
const
COlc
*
fin
,
const
int
k
,
const
string
&
mode
,
const
int
ip
,
const
string
&
name
,
const
CCoord
&
ico
);
double
NumericIntegral
(
const
COlc
*
fc
,
const
CCurve
*
c
,
const
int
k
,
const
int
j
,
const
double
low
,
const
double
hig
);
// parameters for numeric integration:
double
numint_bound_low
=-
INFINITY
,
numint_bound_hig
=
INFINITY
;
// tuning parameters:
int
numint_mode
=
4
;
int
numint_cvmode
=-
1
;
double
numint_epsabs
=
1e-10
,
numint_epsrel
=
1e-10
;
};
//! display or change tuning parameters for numeric integration
void
NCurveFile
::
SetIntTuningPars
(
string
which
)
...
...
This diff is collapsed.
Click to expand it.
src/curve.h
+
1
−
1
View file @
fa2476ed
...
...
@@ -19,7 +19,7 @@ class CCurve {
//! NCurFil holds operations on curve files
namespace
NCurveFile
{
void
Create
(
bool
refers_to_data
,
bool
with_convolution
);
void
Create
(
bool
refers_to_data
);
void
SetConvolution
(
bool
onoff
);
...
...
This diff is collapsed.
Click to expand it.
src/frida2.cpp
+
13
−
14
View file @
fa2476ed
...
...
@@ -98,7 +98,6 @@ int main()
}
else
if
(
cmd
==
"c"
)
{
cout
<<
"Curves:
\n
"
" cc create
\n
"
" ccv create (with convolution)
\n
"
" cca create artificial curve (no data reference)
\n
"
"Basic operations:
\n
"
" cv set file to convolute with (cv-: no convolution)
\n
"
...
...
@@ -112,24 +111,26 @@ int main()
"Special operations:
\n
"
" c_cd calculate cumulative probability distribution
\n
"
"Fit tuning parameters:
\n
"
" cs
show parameters
\n
"
" cs
?
show parameters
\n
"
" csf set gradient step factor
\n
"
" cse set sqrt of differentiation step
\n
"
" csc set number of calls
\n
"
" csp set print frequency
\n
"
" csm set fit metric
\n
"
"
Numeric integration tuning parameters
:
\n
"
" cn
show parameters
\n
"
"
Tuning parameters for integration
:
\n
"
" cn
?
show parameters
\n
"
" cnm set integration mode
\n
"
" cnv set convolution mode
\n
"
" cna set eps abs
\n
"
" cnr set eps rel
\n
"
;
" cnr set eps rel
\n
"
"Tuning parameters for convolution:
\n
"
" cv? show parameters
\n
"
" cvm set integration mode
\n
"
" cva set eps abs
\n
"
" cvr set eps rel
\n
"
;
}
else
if
(
cmd
==
"cc"
)
{
NCurveFile
::
Create
(
true
,
false
);
}
else
if
(
cmd
==
"ccv"
)
{
NCurveFile
::
Create
(
true
,
true
);
NCurveFile
::
Create
(
true
);
}
else
if
(
cmd
==
"cca"
)
{
NCurveFile
::
Create
(
false
,
false
);
NCurveFile
::
Create
(
false
);
}
else
if
(
cmd
==
"cv"
)
{
NCurveFile
::
SetConvolution
(
true
);
...
...
@@ -153,16 +154,14 @@ int main()
}
else
if
(
cmd
==
"c_cd"
)
{
NCurveFile
::
CumulativeDistribution
();
}
else
if
(
cmd
==
"cs"
)
{
NCurveFile
::
SetFitTuningPars
(
"?"
);
}
else
if
(
cmd
.
substr
(
0
,
2
)
==
"cs"
)
{
NCurveFile
::
SetFitTuningPars
(
cmd
.
substr
(
2
));
}
else
if
(
cmd
==
"cn"
)
{
NCurveFile
::
SetIntTuningPars
(
"?"
);
}
else
if
(
cmd
.
substr
(
0
,
2
)
==
"cn"
)
{
NCurveFile
::
SetIntTuningPars
(
cmd
.
substr
(
2
));
}
else
if
(
cmd
.
substr
(
0
,
2
)
==
"cv"
)
{
NCurveFile
::
SetConvTuningPars
(
cmd
.
substr
(
2
));
}
else
if
(
cmd
==
"d"
)
{
cout
<<
"Show directory:
\n
"
...
...
This diff is collapsed.
Click to expand it.
src/olm.h
+
3
−
0
View file @
fa2476ed
...
...
@@ -49,6 +49,9 @@ class COlc : public COlo { // on-line curves
vector
<
CCurve
>
VC
;
bool
weight_y_log
;
uint
kconv
;
uint
cv_intmod
;
double
cv_epsabs
;
double
cv_epsrel
;
inline
COlc
()
:
weight_y_log
(
false
),
kconv
(
-
1
)
{
;
};
inline
uint
nScan
(
void
)
const
{
return
VC
.
size
();
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment