pyAMaFiL 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,142 @@
1
+ #include "stdDefinitions.h"
2
+ #include "mfoGlobals.h"
3
+ #include "agmScalarField.h"
4
+ #include "agmVectorField.h"
5
+ #include "binUtilities.h"
6
+
7
+ #ifdef _WINDOWS
8
+ #pragma warning(disable:4996)
9
+ #endif
10
+
11
+ #include "DebugWrite.h"
12
+ #include "debug_data_trace_win.h"
13
+
14
+ void DebugWriteData(CubeXD *v, const char *fname, int depth, int iter)
15
+ {
16
+ #ifdef _WINDOWS
17
+ if (debug_input)
18
+ {
19
+ char buffer[256], tbuff[32];
20
+ strcpy(buffer, DEBUG_OUT_PATH);
21
+ strcat(buffer, fname);
22
+ if (depth > 0)
23
+ {
24
+ sprintf(tbuff, "_%d", depth);
25
+ strcat(buffer, tbuff);
26
+ if (iter > 0)
27
+ {
28
+ sprintf(tbuff, "_%d", iter);
29
+ strcat(buffer, tbuff);
30
+ }
31
+ }
32
+ strcat(buffer, ".bin");
33
+
34
+ debug_data_trace_win *d = new debug_data_trace_win(buffer);
35
+ d->write(v);
36
+ delete d;
37
+ }
38
+ #endif
39
+ }
40
+
41
+ void DebugWritePars(const char *fname, CagmVectorField * field, CagmScalarField * w)
42
+ {
43
+ #ifdef _WINDOWS
44
+ if (debug_input)
45
+ {
46
+ char buffer[256];
47
+ strcpy(buffer, DEBUG_OUT_PATH);
48
+ strcat(buffer, fname);
49
+ strcat(buffer, ".bin");
50
+
51
+ FILE *fid = fopen(buffer, "wb");
52
+
53
+ CbinDataStruct::WriteHeader(fid);
54
+
55
+ CbinDataStruct::Write(fid, &CommonThreadsN, 1, "CommonThreadsN");
56
+ CbinDataStruct::Write(fid, &WiegelmannThreadPriority, 1, "WiegelmannThreadPriority");
57
+
58
+ CbinDataStruct::Write(fid, &WiegelmannBoundsCorrection, 1, "WiegelmannBoundsCorrection");
59
+
60
+ CbinDataStruct::Write(fid, &WiegelmannWeightType, 1, "WiegelmannWeightType");
61
+ CbinDataStruct::Write(fid, &WiegelmannWeightBound, 1, "WiegelmannWeightBound");
62
+ CbinDataStruct::Write(fid, &WiegelmannWeightDivfree, 1, "WiegelmannWeightDivfree");
63
+
64
+ CbinDataStruct::Write(fid, &WiegelmannDerivStencil, 1, "WiegelmannDerivStencil");
65
+ CbinDataStruct::Write(fid, &WiegelmannInversionTolerance, 1, "WiegelmannInversionTolerance");
66
+ CbinDataStruct::Write(fid, &WiegelmannInversionDenom, 1, "WiegelmannInversionDenom");
67
+
68
+ CbinDataStruct::Write(fid, &WiegelmannProcStep0, 1, "WiegelmannProcStep0");
69
+
70
+ CbinDataStruct::Write(fid, &WiegelmannProcStepMax, 1, "WiegelmannProcStepMax");
71
+ CbinDataStruct::Write(fid, &WiegelmannProcMaxSteps, 1, "WiegelmannProcMaxSteps");
72
+
73
+ CbinDataStruct::Write(fid, &WiegelmannProcStepIncrInit, 1, "WiegelmannProcStepIncrInit");
74
+ CbinDataStruct::Write(fid, &WiegelmannProcStepIncrMatr, 1, "WiegelmannProcStepIncrMatr");
75
+ CbinDataStruct::Write(fid, &WiegelmannProcStepIncrMain, 1, "WiegelmannProcStepIncrMain");
76
+
77
+ CbinDataStruct::Write(fid, &WiegelmannProcStepDecrInit, 1, "WiegelmannProcStepDecrInit");
78
+ CbinDataStruct::Write(fid, &WiegelmannProcStepDecrMatr, 1, "WiegelmannProcStepDecrMatr");
79
+ CbinDataStruct::Write(fid, &WiegelmannProcStepDecrMain, 1, "WiegelmannProcStepDecrMain");
80
+
81
+ CbinDataStruct::Write(fid, &WiegelmannProcStepLimInit, 1, "WiegelmannProcStepLimInit");
82
+ CbinDataStruct::Write(fid, &WiegelmannProcStepLimMatr, 1, "WiegelmannProcStepLimMatr");
83
+ CbinDataStruct::Write(fid, &WiegelmannProcStepLimMain, 1, "WiegelmannProcStepLimMain");
84
+
85
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdWinInit, 1, "WiegelmannProcdLStdWinInit");
86
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdWinMatr, 1, "WiegelmannProcdLStdWinMatr");
87
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdWinMain, 1, "WiegelmannProcdLStdWinMain");
88
+
89
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdValInit, 1, "WiegelmannProcdLStdValInit");
90
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdValMatr, 1, "WiegelmannProcdLStdValMatr");
91
+ CbinDataStruct::Write(fid, &WiegelmannProcdLStdValMain, 1, "WiegelmannProcdLStdValMain");
92
+
93
+ CbinDataStruct::Write(fid, &WiegelmannMatryoshkaUse, 1, "WiegelmannMatryoshkaUse");
94
+ CbinDataStruct::Write(fid, &WiegelmannMatryoshkaDeepMinN, 1, "WiegelmannMatryoshkaDeepMinN");
95
+ CbinDataStruct::Write(fid, &WiegelmannMatryoshkaFactor, 1, "WiegelmannMatryoshkaFactor");
96
+
97
+ CbinDataStruct::Write(fid, &WiegelmannProcCondType, 1, "WiegelmannProcCondType");
98
+ CbinDataStruct::Write(fid, &WiegelmannProcCondAbs, 1, "WiegelmannProcCondAbs");
99
+ CbinDataStruct::Write(fid, &WiegelmannProcCondAbs2, 1, "WiegelmannProcCondAbs2");
100
+ CbinDataStruct::Write(fid, &WiegelmannProcCondLOS2, 1, "WiegelmannProcCondLOS2");
101
+ CbinDataStruct::Write(fid, &WiegelmannProcCondLOS, 1, "WiegelmannProcCondLOS");
102
+ CbinDataStruct::Write(fid, &WiegelmannProcCondBase, 1, "WiegelmannProcCondBase");
103
+ CbinDataStruct::Write(fid, &WiegelmannProcCondBase2, 1, "WiegelmannProcCondBase2");
104
+
105
+ int N[3];
106
+ field->dimensions(N);
107
+ CbinDataStruct::Write(fid, N, 3, "N");
108
+ CagmScalarField comp(N);
109
+
110
+ field->getComponent(&comp, PLANE_X);
111
+ double v = comp.sum();
112
+ CbinDataStruct::Write(fid, &v, 1, "FieldXSum");
113
+ double *a = field->getAddress(PLANE_X, 5, 7, 0);
114
+ CbinDataStruct::Write(fid, a, 1, "X570");
115
+ a = field->getAddress(PLANE_X, 7, 5, 0);
116
+ CbinDataStruct::Write(fid, a, 1, "X750");
117
+
118
+ field->getComponent(&comp, PLANE_Y);
119
+ v = comp.sum();
120
+ CbinDataStruct::Write(fid, &v, 1, "FieldYSum");
121
+ a = field->getAddress(PLANE_Y, 5, 7, 0);
122
+ CbinDataStruct::Write(fid, a, 1, "Y570");
123
+ a = field->getAddress(PLANE_Y, 7, 5, 0);
124
+ CbinDataStruct::Write(fid, a, 1, "Y750");
125
+
126
+ field->getComponent(&comp, PLANE_Z);
127
+ v = comp.sum();
128
+ CbinDataStruct::Write(fid, &v, 1, "FieldZSum");
129
+ a = field->getAddress(PLANE_Z, 5, 7, 0);
130
+ CbinDataStruct::Write(fid, a, 1, "Z570");
131
+ a = field->getAddress(PLANE_Z, 7, 5, 0);
132
+ CbinDataStruct::Write(fid, a, 1, "Z750");
133
+
134
+ v = w->sum();
135
+ CbinDataStruct::Write(fid, &v, 1, "WeightSum");
136
+
137
+ CbinDataStruct::WriteFooter(fid);
138
+
139
+ fclose(fid);
140
+ }
141
+ #endif
142
+ }
@@ -0,0 +1,114 @@
1
+ #include "stdDefinitions.h"
2
+ #include "LinesTaskQueue.h"
3
+ #include "LinesProcessor.h"
4
+ #include "agmVectorField.h"
5
+ #include "agmVectorFieldLineFuncs.h"
6
+
7
+ #define l_div_position(p, N, k1, tk) \
8
+ { \
9
+ if (p >= double((N)-1) || fabs(p-(double((N)-1))) < 1e-5) \
10
+ { \
11
+ k1 = (N)-2; \
12
+ tk = 1; \
13
+ } \
14
+ else \
15
+ { \
16
+ k1 = (int)floor(p); \
17
+ if (k1 < 0) \
18
+ { \
19
+ k1 = 0; \
20
+ tk = 0; \
21
+ } \
22
+ else \
23
+ tk = (p) - k1; \
24
+ } \
25
+ }
26
+
27
+ #define l_get_point(Ny, tfield, x1, y1, z1, tx, ty, tz) \
28
+ ((1-(tz))* ((1-(ty))* ((1-(tx))*tfield[(y1) + (z1) *Ny][x1] + (tx)*tfield[(y1) + (z1) *Ny][x1+1]) + \
29
+ (ty)* ((1-(tx))*tfield[((y1)+1) + (z1) *Ny][x1] + (tx)*tfield[((y1)+1) + (z1) *Ny][x1+1])) \
30
+ + (tz)* ((1-(ty))* ((1-(tx))*tfield[(y1) + ((z1)+1)*Ny][x1] + (tx)*tfield[(y1) + ((z1)+1)*Ny][x1+1]) + \
31
+ (ty)* ((1-(tx))*tfield[((y1)+1) + ((z1)+1)*Ny][x1] + (tx)*tfield[((y1)+1) + ((z1)+1)*Ny][x1+1])) \
32
+ )
33
+
34
+ bool fcond(void *p, const CagmRKF45Vect& v)
35
+ {
36
+ T_Lines *pp = (T_Lines *)p;
37
+ return v.e[0] < pp->absBoundAchieve || v.e[0] > (pp->N)[0] - pp->absBoundAchieve - 1
38
+ || v.e[1] < pp->absBoundAchieve || v.e[1] > (pp->N)[1] - pp->absBoundAchieve - 1
39
+ || v.e[2] < pp->absBoundAchieveBottom || v.e[2] > (pp->N)[2] - pp->absBoundAchieve - 1
40
+ ;
41
+ }
42
+
43
+ uint32_t fdata(void *p, const double /*t*/, const CagmRKF45Vect& v, CagmRKF45Vect& vp)
44
+ {
45
+ vp.e[0] = 0; vp.e[1] = 0; vp.e[2] = 0;
46
+
47
+ T_Lines *pp = (T_Lines *)p;
48
+ if ((v.e[0] >= 0 && v.e[0] <= (pp->N)[0] - 1
49
+ && v.e[1] >= 0 && v.e[1] <= (pp->N)[1] - 1
50
+ && v.e[2] >= 0 && v.e[2] <= (pp->N)[2] - 1))
51
+ {
52
+ double field[3];
53
+ ((T_Lines *)p)->vfield->getPoint(((CagmRKF45Vect&)v).v(), field);
54
+ vp.e[0] = field[0] * ((T_Lines *)p)->dir;
55
+ vp.e[1] = field[1] * ((T_Lines *)p)->dir;
56
+ vp.e[2] = field[2] * ((T_Lines *)p)->dir;
57
+ double n = 1.0/sqrt(vp.e[0]*vp.e[0] + vp.e[1]*vp.e[1] + vp.e[2]*vp.e[2]);
58
+ vp.e[0] *= n;
59
+ vp.e[1] *= n;
60
+ vp.e[2] *= n;
61
+ return 0;
62
+ }
63
+
64
+ //return (rc ? 1 : 0);
65
+ return 1;
66
+ }
67
+
68
+ //-----------------------------------------------------------------------------
69
+ CLinesProcessor::CLinesProcessor(LQPSupervisor *_supervisor, CagmVectorField *_v, int _dir, double _step, double _relErr, double _absErr
70
+ , double _boundAchieve, double _boundAchieveBottom, int _maxLength, int *_passed)
71
+ : supervisor(_supervisor)
72
+ ,v(_v)
73
+ ,dir(_dir)
74
+ ,step(_step)
75
+ ,boundAchieve(_boundAchieve)
76
+ ,boundAchieveBottom(_boundAchieveBottom)
77
+ ,maxLength(_maxLength)
78
+ ,passed(_passed)
79
+ {
80
+ rkf45 = new CagmRKF45(_absErr, _relErr, fdata, 3, nullptr, fcond, boundAchieve);
81
+ coord = new double[3*maxLength];
82
+ }
83
+
84
+ //-----------------------------------------------------------------------------
85
+ CLinesProcessor::~CLinesProcessor()
86
+ {
87
+ delete rkf45;
88
+ delete[] coord;
89
+ }
90
+
91
+ //-------------------------------------------------------------------------------------
92
+ uint32_t CLinesProcessor::setTaskParams(void *params)
93
+ {
94
+ memcpy(point, (double *)params, 3*sizeof(double));
95
+
96
+ return 0;
97
+ }
98
+
99
+ //-----------------------------------------------------------------------------
100
+ uint32_t CLinesProcessor::ActionCore()
101
+ {
102
+ int lineLength;
103
+ int code;
104
+
105
+ if ( !supervisor->needProcessing(queueID) )
106
+ return 0;
107
+
108
+ /* CagmVectorFieldOps::Status s = */
109
+ v->getOneFullLine(rkf45, point, dir, step, boundAchieve, boundAchieveBottom, maxLength, &lineLength, coord, &code);
110
+ /* uint32_t rc = */
111
+ supervisor->SetResult(queueID, point, coord, lineLength, (int)code, CagmVectorFieldOps::Status::BufferOverload);
112
+
113
+ return 0;
114
+ }
@@ -0,0 +1,240 @@
1
+ // MagFieldOps.cpp : Defines the initialization routines for the DLL.
2
+ //
3
+
4
+ #include "stdDefinitions.h"
5
+
6
+ #ifdef _WINDOWS
7
+ #include <windows.h>
8
+ #pragma warning (disable : 4996)
9
+ #endif
10
+
11
+ #include <ctime>
12
+ #include "string.h"
13
+
14
+ #include "MagFieldOps.h"
15
+
16
+ #include "mfoGlobals.h"
17
+ #include "VersionInfoResource.h"
18
+
19
+ #include "agmScalarField.h"
20
+ #include "agmVectorField.h"
21
+
22
+ //------------------------------------------------------------------
23
+ int getPriority(w_priority p)
24
+ {
25
+ int sys_p = 0;
26
+ #ifdef _WINDOWS
27
+ switch (p)
28
+ {
29
+ case lowest:
30
+ sys_p = THREAD_PRIORITY_LOWEST;
31
+ break;
32
+ case low:
33
+ sys_p = THREAD_PRIORITY_BELOW_NORMAL;
34
+ break;
35
+ case normal:
36
+ sys_p = THREAD_PRIORITY_NORMAL;
37
+ break;
38
+ case high:
39
+ sys_p = THREAD_PRIORITY_ABOVE_NORMAL;
40
+ break;
41
+ case highest:
42
+ sys_p = THREAD_PRIORITY_HIGHEST;
43
+ break;
44
+ default:
45
+ sys_p = THREAD_PRIORITY_BELOW_NORMAL;
46
+ }
47
+ #endif
48
+
49
+ return sys_p;
50
+ }
51
+
52
+ //------------------------------------------------------------------
53
+ bool mapIntproceed(bool bGet, std::string name, int &value, int defaultValue = 0)
54
+ {
55
+ auto search = mapInt.find(name);
56
+ bool rc = search != mapInt.end();
57
+ if (bGet) // return true, if exist
58
+ {
59
+ if (rc)
60
+ value = search->second;
61
+ else
62
+ value = defaultValue;
63
+ }
64
+ else
65
+ {
66
+ mapInt[name] = defaultValue;
67
+ }
68
+
69
+ return rc;
70
+ }
71
+
72
+ //------------------------------------------------------------------
73
+ bool mapDoubleproceed(bool bGet, std::string name, double &value, double defaultValue = 0)
74
+ {
75
+ auto search = mapDouble.find(name);
76
+ bool rc = search != mapDouble.end();
77
+ if (bGet) // return true, if exist
78
+ {
79
+ if (rc)
80
+ value = search->second;
81
+ else
82
+ value = defaultValue;
83
+ }
84
+ else
85
+ {
86
+ mapDouble[name] = defaultValue;
87
+ }
88
+
89
+ return rc;
90
+ }
91
+
92
+ //------------------------------------------------------------------
93
+ void _proceedGlobals(bool bGet)
94
+ {
95
+ // mapIntproceed (bGet, "synchronous", WiegelmannSynchronous, 1);
96
+ // mapIntproceed (bGet, "show_progress", WiegelmannShowProgress, 1);
97
+ // mapDoubleproceed(bGet, "show_progress_time_quant", WiegelmannShowProgressTimeQuant, 1);
98
+ // mapIntproceed (bGet, "timeout_ms", WiegelmannProcTimeoutMS, 60000);
99
+ //mapDoubleproceed(bGet, "d_functional_value_terminate_init", WiegelmannProcdLStopInit, 1e-4); // dL value ...
100
+ //mapDoubleproceed(bGet, "d_functional_value_terminate", WiegelmannProcdLStopMatr, 1e-4);
101
+ //mapDoubleproceed(bGet, "d_functional_value_terminate_main", WiegelmannProcdLStopMain, 1e-4);
102
+ //mapIntproceed (bGet, "d_functional_iterations_terminate_init", WiegelmannProcdLIterInit, 100); // ... during consequently iterations
103
+ //mapIntproceed (bGet, "d_functional_iterations_terminate", WiegelmannProcdLIterMatr, 100);
104
+ //mapIntproceed (bGet, "d_functional_iterations_terminate_main", WiegelmannProcdLIterMain, 100);
105
+ // mapDoubleproceed(bGet, "d_functional_value_max_inceasing_init", WiegelmannProcFunctionalLimitInit, 1e-4); // max. rel. avail. L increasing
106
+ // mapDoubleproceed(bGet, "d_functional_value_max_inceasing", WiegelmannProcFunctionalLimitMatr, 1e-4);
107
+ // mapDoubleproceed(bGet, "d_functional_value_max_inceasing_main", WiegelmannProcFunctionalLimitMain, 1e-4);
108
+ // int iWiegelmannMatryoshkaInterpolator;
109
+ // mapIntproceed (bGet, "dense_grid_interpolator", iWiegelmannMatryoshkaInterpolator, 0);
110
+ // mapDoubleproceed(bGet, "dense_grid_interpolator_p1", WiegelmannMatryoshkaInterpolatorP1, 2.0);
111
+ // mapDoubleproceed(bGet, "dense_grid_interpolator_p2", WiegelmannMatryoshkaInterpolatorP2, 8.0);
112
+ // mapDoubleproceed(bGet, "dense_grid_interpolator_p3", WiegelmannMatryoshkaInterpolatorP3, 0.0);
113
+ // mapIntproceed (bGet, "chunk_size_max", WiegelmannChunkSizeMax, 100);
114
+ // mapIntproceed (bGet, "chunk_size_opt", WiegelmannChunkSizeOpt, 30);
115
+ // mapIntproceed (bGet, "threads_priority", WiegelmannThreadPriority, 0);
116
+ // mapIntproceed (bGet, "metrics_diff_init", WiegelmannGetMetricsDiffInit, 0);
117
+ // mapIntproceed (bGet, "metrics_diff_prev", WiegelmannGetMetricsDiffPrev, 0);
118
+ // if (bGet)
119
+ // {
120
+ // WiegelmannMatryoshkaInterpolator = (CagmVectorFieldOps::Interpolator)iWiegelmannMatryoshkaInterpolator;
121
+ // }
122
+
123
+ mapIntproceed (bGet, "bounds_correction", WiegelmannBoundsCorrection, 0);
124
+ mapIntproceed (bGet, "threads_priority", WiegelmannThreadPriority, low);
125
+
126
+ mapIntproceed (bGet, "weight_type", WiegelmannWeightType, SWF_COS);
127
+ mapDoubleproceed(bGet, "weight_bound_size", WiegelmannWeightBound, 0.1);
128
+ mapDoubleproceed(bGet, "weight_relative_divfree", WiegelmannWeightDivfree, 1.0);
129
+
130
+ mapIntproceed (bGet, "derivative_stencil", WiegelmannDerivStencil, 3);
131
+ mapDoubleproceed(bGet, "inversion_tolerance", WiegelmannInversionTolerance, 0);
132
+ mapDoubleproceed(bGet, "inversion_denominator", WiegelmannInversionDenom, 0);
133
+
134
+ mapDoubleproceed(bGet, "step_initial", WiegelmannProcStep0, 0.1); // units of Bav/F2max
135
+
136
+ mapIntproceed (bGet, "step_max", WiegelmannProcStepMax, 1000000000); // max. aval. step
137
+ mapIntproceed (bGet, "max_iterations", WiegelmannProcMaxSteps, 100000); // max. number of step
138
+
139
+ mapDoubleproceed(bGet, "step_increment_init", WiegelmannProcStepIncrInit, 1.618);
140
+ mapDoubleproceed(bGet, "step_increment", WiegelmannProcStepIncrMatr, 1.618);
141
+ mapDoubleproceed(bGet, "step_increment_main", WiegelmannProcStepIncrMain, 1.618);
142
+ mapDoubleproceed(bGet, "step_decrement_init", WiegelmannProcStepDecrInit, 0.382);
143
+ mapDoubleproceed(bGet, "step_decrement", WiegelmannProcStepDecrMatr, 0.382);
144
+ mapDoubleproceed(bGet, "step_decrement_main", WiegelmannProcStepDecrMain, 0.382);
145
+ mapDoubleproceed(bGet, "step_terminate_init", WiegelmannProcStepLimInit, 0.01); // related to init. step
146
+ mapDoubleproceed(bGet, "step_terminate", WiegelmannProcStepLimMatr, 0.01);
147
+ mapDoubleproceed(bGet, "step_terminate_main", WiegelmannProcStepLimMain, 0.0001);
148
+
149
+ mapDoubleproceed(bGet, "d_functional_stdev_value_init", WiegelmannProcdLStdValInit, 5e-4); // min std(rel. dL) ...
150
+ mapDoubleproceed(bGet, "d_functional_stdev_value", WiegelmannProcdLStdValMatr, 5e-4);
151
+ mapDoubleproceed(bGet, "d_functional_stdev_value_main", WiegelmannProcdLStdValMain, 5e-4);
152
+ mapIntproceed (bGet, "d_functional_stdev_window_init", WiegelmannProcdLStdWinInit, 101); // ... std window size + 1
153
+ mapIntproceed (bGet, "d_functional_stdev_window_matr", WiegelmannProcdLStdWinMatr, 101);
154
+ mapIntproceed (bGet, "d_functional_stdev_window_main", WiegelmannProcdLStdWinMain, 101);
155
+
156
+ mapIntproceed (bGet, "dense_grid_use", WiegelmannMatryoshkaUse, 1);
157
+ mapIntproceed (bGet, "dense_grid_min_n", WiegelmannMatryoshkaDeepMinN, 25);
158
+ mapDoubleproceed(bGet, "dense_grid_factor", WiegelmannMatryoshkaFactor, 2.0);
159
+
160
+ mapIntproceed (bGet, "add_conditions_mode", WiegelmannProcCondType, 1); // 0 - ignore, 1 - as functional, 2 - as fixed
161
+
162
+ mapIntproceed (bGet, "add_conditions_abs", WiegelmannProcCondAbs, 2); // 0 - no limit, 1 - no less, 2 - exact
163
+ mapIntproceed (bGet, "add_conditions_abs_max", WiegelmannProcCondAbs2, 1); // 0 - no limit, 1 - no greater
164
+ mapIntproceed (bGet, "add_conditions_los", WiegelmannProcCondLOS, 2);
165
+ mapIntproceed (bGet, "add_conditions_los_max", WiegelmannProcCondLOS2, 1);
166
+ mapIntproceed (bGet, "add_conditions_xyz", WiegelmannProcCondBase, 2);
167
+ mapIntproceed (bGet, "add_conditions_xyz_max", WiegelmannProcCondBase2, 1);
168
+
169
+ mapIntproceed (bGet, "protocol_step", WiegelmannProtocolStep, 10);
170
+
171
+ mapIntproceed (bGet, "metrics_theta", WiegelmannGetMetricsTheta, 0);
172
+ mapIntproceed (bGet, "debug_input", debug_input, 0);
173
+ }
174
+
175
+ //------------------------------------------------------------------
176
+ __declspec( dllexport ) uint32_t utilInitialize()
177
+ {
178
+ _proceedGlobals(false);
179
+ _proceedGlobals();
180
+ return 0;
181
+ }
182
+
183
+ //------------------------------------------------------------------
184
+ __declspec( dllexport ) int utilSetInt(char *query, int value)
185
+ {
186
+ if (!strcmp(query, "threads_priority"))
187
+ value = getPriority((w_priority)value);
188
+ bool isNew = mapIntproceed(false, query, value, value);
189
+ _proceedGlobals();
190
+ return (isNew ? 1 : 0);
191
+ }
192
+
193
+ //------------------------------------------------------------------
194
+ __declspec( dllexport ) int utilGetInt(char *query, int *result)
195
+ {
196
+ return mapIntproceed(true, query, *result, 0);
197
+ }
198
+
199
+ //------------------------------------------------------------------
200
+ __declspec( dllexport ) int utilSetDouble(char *query, double value)
201
+ {
202
+ bool isNew = mapDoubleproceed(false, query, value, value);
203
+ _proceedGlobals();
204
+ return (isNew ? 1 : 0);
205
+ }
206
+
207
+ //------------------------------------------------------------------
208
+ __declspec( dllexport ) int utilGetDouble(char *query, double *result)
209
+ {
210
+ return mapDoubleproceed(true, query, *result, 0);
211
+ }
212
+
213
+ //------------------------------------------------------------------
214
+ __declspec(dllexport) int utilGetVersion(char *fullvers, int buflength)
215
+ {
216
+ std::string s;
217
+ s = VIR_ProductName;
218
+ s += " v.";
219
+ s += VIR_QUOTE_SUBST(VIR_Ver1);
220
+ s += ".";
221
+ s += VIR_QUOTE_SUBST(VIR_Ver2);
222
+ s += ".";
223
+ s += VIR_QUOTE_SUBST(VIR_Ver3);
224
+ s += ".";
225
+ s += VIR_QUOTE_SUBST(VIR_Ver4);
226
+ s += " (";
227
+ s += VIR_QUOTE_SUBST(VIR_T_REV);
228
+ s += VIR_QUOTE_SUBST(VIR_Revision);
229
+ s += "). ";
230
+ s += VIR_QUOTE_SUBST(VIR_COPYRIGHT);
231
+ s += ", ";
232
+ s += VIR_QUOTE_SUBST(VIR_FROM);
233
+ s += VIR_QUOTE_SUBST(VIR_Year);
234
+ s += ", ";
235
+ s += VIR_CompanyName;
236
+
237
+ strncpy(fullvers, s.c_str(), buflength);
238
+
239
+ return (int)s.length();
240
+ }