|
3 | 3 |
|
4 | 4 | * File: weight/MarkovProcess.cxx
|
5 | 5 | *
|
6 |
| - * Copyright (c) 2004-2021 by Stuart Ansell |
| 6 | + * Copyright (c) 2004-2023 by Stuart Ansell |
7 | 7 | *
|
8 | 8 | * This program is free software: you can redistribute it and/or modify
|
9 | 9 | * it under the terms of the GNU General Public License as published by
|
|
31 | 31 | #include <string>
|
32 | 32 | #include <algorithm>
|
33 | 33 | #include <memory>
|
34 |
| -#include <boost/multi_array.hpp> |
35 | 34 |
|
36 | 35 | #include "Exception.h"
|
37 | 36 | #include "FileReport.h"
|
38 | 37 | #include "NameStack.h"
|
39 | 38 | #include "RegMethod.h"
|
40 | 39 | #include "OutputLog.h"
|
41 | 40 | #include "Vec3D.h"
|
| 41 | +#include "dataSlice.h" |
| 42 | +#include "multiData.h" |
42 | 43 | #include "BasicMesh3D.h"
|
43 | 44 | #include "BaseMap.h"
|
44 | 45 |
|
45 |
| - |
46 | 46 | #include "LineTrack.h"
|
47 | 47 | #include "ObjectTrackAct.h"
|
48 | 48 | #include "ObjectTrackPoint.h"
|
@@ -111,13 +111,13 @@ MarkovProcess::initializeData(const WWG& wSet,
|
111 | 111 | const WWGWeight& wMesh=wSet.getMesh(meshIndex);
|
112 | 112 | const Geometry::BasicMesh3D& grid=wMesh.getGeomGrid();
|
113 | 113 |
|
114 |
| - WX=static_cast<long int>(grid.getXSize()); |
115 |
| - WY=static_cast<long int>(grid.getYSize()); |
116 |
| - WZ=static_cast<long int>(grid.getZSize()); |
| 114 | + WX=grid.getXSize(); |
| 115 | + WY=grid.getYSize(); |
| 116 | + WZ=grid.getZSize(); |
117 | 117 |
|
118 | 118 | FSize=WX*WY*WZ;
|
119 | 119 |
|
120 |
| - fluxField.resize(boost::extents[FSize][FSize]); |
| 120 | + fluxField.resize(FSize,FSize); |
121 | 121 |
|
122 | 122 | return;
|
123 | 123 | }
|
@@ -145,29 +145,33 @@ MarkovProcess::computeMatrix(const Simulation& System,
|
145 | 145 | const Geometry::BasicMesh3D& grid=wMesh.getGeomGrid();
|
146 | 146 | const std::vector<Geometry::Vec3D> midPts=grid.midPoints();
|
147 | 147 |
|
148 |
| - if (static_cast<long int>(midPts.size())!=FSize) |
149 |
| - throw ColErr::MisMatch<long int> |
150 |
| - (static_cast<long int>(midPts.size()),FSize,"MidPts.size != FSize"); |
| 148 | + if (midPts.size()!=FSize) |
| 149 | + throw ColErr::MisMatch<size_t> |
| 150 | + (midPts.size(),FSize,"MidPts.size != FSize"); |
151 | 151 |
|
152 |
| - for(long int i=0;i<FSize;i++) |
153 |
| - fluxField[i][i]=1.0; |
| 152 | + for(size_t i=0;i<FSize;i++) |
| 153 | + fluxField.get()[i][i]=1.0; |
154 | 154 |
|
155 |
| - for(long int i=0;i<FSize;i++) |
| 155 | + for(size_t i=0;i<FSize;i++) |
156 | 156 | {
|
157 |
| - const size_t uI(static_cast<size_t>(i)); |
158 |
| - ModelSupport::ObjectTrackPoint OTrack(midPts[uI]); |
159 |
| - for(long int j=i+1;j<FSize;j++) |
| 157 | + ModelSupport::ObjectTrackPoint OTrack(midPts[i]); |
| 158 | + for(size_t j=i+1;j<FSize;j++) |
160 | 159 | {
|
161 |
| - const size_t uJ(static_cast<size_t>(i)); |
162 |
| - OTrack.addUnit(System,j,midPts[uJ]); |
163 |
| - double DistT=OTrack.getDistance(j)/r2Length; |
| 160 | + OTrack.addUnit(System,j,midPts[j]); |
| 161 | + double DistT=OTrack.getDistance(static_cast<long int>(j))/r2Length; |
164 | 162 | if (DistT<1.0) DistT=1.0;
|
165 |
| - const double AT=OTrack.getAttnSum(j); // this can take an |
| 163 | + const double AT=OTrack.getAttnSum(static_cast<long int>(j)); // this can take an |
166 | 164 | const double WFactor= -densityFactor*AT-r2Power*log(DistT);
|
167 | 165 | if (WFactor>-20)
|
168 |
| - fluxField[i][j]=fluxField[j][i]= -WFactor; |
| 166 | + { |
| 167 | + fluxField.get()[i][j]= -WFactor; |
| 168 | + fluxField.get()[j][i]= -WFactor; |
| 169 | + } |
169 | 170 | else
|
170 |
| - fluxField[i][j]=fluxField[j][i]=0.0; |
| 171 | + { |
| 172 | + fluxField.get()[i][j]= 0.0; |
| 173 | + fluxField.get()[j][i]= 0.0; |
| 174 | + } |
171 | 175 | }
|
172 | 176 | }
|
173 | 177 | return;
|
|
0 commit comments