From c0f32b9f2038157766d41e52c7b65f232f041b16 Mon Sep 17 00:00:00 2001 From: "Dmitry Yu. Naumov" <github@naumov.de> Date: Mon, 21 Sep 2015 21:47:29 +0000 Subject: [PATCH] Use 'std::size_t' everywhere instead of 'size_t'. This is automatic replacement with ag '(?<!std::)size_t(?!\w)' --ignore-dir=ThirdParty -l | xargs perl -pi.bak -e 's/(?<!std::)size_t(?!\w)/std::size_t/g' --- .../DataView/CondFromRasterDialog.cpp | 4 +- .../DataView/DiagramView/DetailWindow.cpp | 8 +- .../DataView/DiagramView/DiagramList.cpp | 48 +++++----- .../DiagramView/DiagramPrefsDialog.cpp | 6 +- .../DataView/DirectConditionGenerator.cpp | 18 ++-- .../DataView/ElementTreeModel.cpp | 4 +- .../DataExplorer/DataView/ElementTreeView.cpp | 4 +- .../DataExplorer/DataView/GMSHPrefsDialog.cpp | 2 +- .../DataExplorer/DataView/GeoTreeModel.cpp | 28 +++--- .../DataExplorer/DataView/GeoTreeView.cpp | 4 +- .../DataExplorer/DataView/LineEditDialog.cpp | 10 +- .../DataView/LinearEditDialog.cpp | 20 ++-- .../DataView/MergeGeometriesDialog.cpp | 2 +- .../DataExplorer/DataView/MshModel.cpp | 4 +- .../DataExplorer/DataView/MshView.cpp | 4 +- .../DataView/NetCdfConfigureDialog.cpp | 22 ++--- .../DataView/StationTreeModel.cpp | 8 +- .../DataExplorer/DataView/StationTreeView.cpp | 6 +- .../DataView/StratView/StratBar.cpp | 6 +- .../DataView/StratView/StratScene.cpp | 4 +- .../VtkVis/VtkAppendArrayFilter.cpp | 6 +- .../VtkVis/VtkColorByHeightFilter.cpp | 4 +- .../VtkVis/VtkColorLookupTable.cpp | 24 ++--- .../VtkVis/VtkCompositeGeoObjectFilter.cpp | 2 +- .../VtkVis/VtkCompositePointToGlyphFilter.cpp | 4 +- .../VtkImageDataToLinePolyDataFilter.cpp | 2 +- .../VtkVis/VtkPolylinesSource.cpp | 2 +- .../DataExplorer/VtkVis/VtkStationSource.cpp | 14 +-- .../DataExplorer/VtkVis/VtkSurfacesSource.cpp | 10 +- .../VtkVis/VtkTextureOnSurfaceFilter.cpp | 8 +- .../DataExplorer/VtkVis/VtkVisHelper.cpp | 6 +- Applications/DataExplorer/mainwindow.cpp | 8 +- .../Utils/FileConverter/ConvertSHPToGLI.cpp | 34 +++---- .../Utils/FileConverter/ConvertVtkToOsg.cpp | 2 +- .../FileConverter/generateBCFromPolyline.cpp | 12 +-- .../Utils/FileConverter/generateBCandGLI.cpp | 18 ++-- ...CreateBoundaryConditionsAlongPolylines.cpp | 2 +- .../Utils/MeshEdit/NodeReordering.cpp | 14 +-- Applications/Utils/MeshEdit/moveMeshNodes.cpp | 26 ++--- BaseLib/DateTools.cpp | 4 +- BaseLib/FileTools.cpp | 16 ++-- BaseLib/Histogram.h | 4 +- BaseLib/StringTools.cpp | 4 +- FileIO/AsciiRasterInterface.cpp | 12 +-- FileIO/AsciiRasterInterface.h | 2 +- FileIO/FEFLOWInterface.cpp | 56 +++++------ FileIO/FEFLOWInterface.h | 10 +- FileIO/GmshIO/GMSHPoint.cpp | 2 +- FileIO/GmshIO/GMSHPolygonTree.cpp | 96 +++++++++---------- FileIO/Legacy/MeshIO.cpp | 10 +- FileIO/PetrelInterface.cpp | 2 +- FileIO/RapidXmlIO/RapidStnInterface.cpp | 4 +- FileIO/TetGenInterface.cpp | 20 ++-- FileIO/XmlIO/Qt/XmlStnInterface.cpp | 12 +-- GeoLib/Surface.cpp | 2 +- MathLib/LinAlg/PETSc/PETScVector.h | 6 +- MeshGeoToolsLib/GeoMapper.cpp | 6 +- MeshLib/Mesh.cpp | 28 +++--- .../Mesh2MeshPropertyInterpolation.cpp | 28 +++--- .../MeshGenerators/ConvertRasterToMesh.cpp | 32 +++---- MeshLib/MeshGenerators/MeshLayerMapper.cpp | 2 +- MeshLib/MeshGenerators/VtkMeshConverter.cpp | 68 ++++++------- MeshLib/MeshQuality/AngleSkewMetric.cpp | 4 +- MeshLib/MeshQuality/EdgeRatioMetric.cpp | 30 +++--- MeshLib/MeshQuality/ElementQualityInterface.h | 2 +- MeshLib/MeshQuality/ElementQualityMetric.cpp | 8 +- MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp | 4 +- MeshLib/MeshSearch/NodeSearch.cpp | 2 +- MeshLib/Node.cpp | 2 +- SimpleTests/MatrixTests/MatMult.cpp | 2 +- SimpleTests/MatrixTests/MatVecMultNDPerm.cpp | 4 +- .../MatrixTests/MatVecMultNDPermOpenMP.cpp | 4 +- .../MatrixTests/MatVecMultPthreads.cpp | 2 +- SimpleTests/MeshTests/MeshRead.cpp | 2 +- SimpleTests/MeshTests/MeshSearchTest.cpp | 20 ++-- .../SolverTests/BiCGStabDiagPrecond.cpp | 4 +- ...onjugateGradientDiagonalPreconditioned.cpp | 4 +- .../ConjugateGradientUnpreconditioned.cpp | 4 +- SimpleTests/SolverTests/GMResDiagPrecond.cpp | 4 +- Tests/BaseLib/excludeObjectCopy.cpp | 2 +- .../InSituLib/TestVtkMappedPropertyVector.cpp | 6 +- .../TestVtkMeshNodalCoordinatesTemplate.cpp | 4 +- Tests/MathLib/TestLinearSolver.cpp | 6 +- Tests/MathLib/TestNonlinearPicard.cpp | 2 +- Tests/TestTools.h | 4 +- 85 files changed, 481 insertions(+), 481 deletions(-) diff --git a/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp b/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp index e82e1cf4091..df1ff79eab1 100644 --- a/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp +++ b/Applications/DataExplorer/DataView/CondFromRasterDialog.cpp @@ -70,7 +70,7 @@ void CondFromRasterDialog::accept() std::string mesh_name (this->meshBox->currentText().toStdString()); std::string raster_name (this->rasterEdit->text().toStdString()); double scaling_factor = this->scalingEdit->text().toDouble(); - std::vector< std::pair<size_t,double> > direct_values; + std::vector< std::pair<std::size_t,double> > direct_values; if (mesh_name.empty()) { @@ -84,7 +84,7 @@ void CondFromRasterDialog::accept() } MeshLib::Mesh* mesh (NULL); - for (size_t i=0; i<_msh_vec.size(); i++) + for (std::size_t i=0; i<_msh_vec.size(); i++) if (_msh_vec[i]->getName().compare(mesh_name) == 0) { mesh = _msh_vec[i]; diff --git a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.cpp b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.cpp index 2c026851438..75d06344eb3 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DetailWindow.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DetailWindow.cpp @@ -73,7 +73,7 @@ DetailWindow::DetailWindow(QString filename, QWidget* parent) : QWidget(parent) std::vector<DiagramList*> lists; DiagramList::readList(filename, lists); - for (size_t i = 0; i < lists.size(); i++) + for (std::size_t i = 0; i < lists.size(); i++) stationView->addGraph(lists[i]); resizeWindow(); @@ -87,13 +87,13 @@ DetailWindow::DetailWindow(DiagramList* list, QWidget* parent) : QWidget(parent) resizeWindow(); } -DetailWindow::DetailWindow(std::vector<size_t> data, QWidget* parent) : QWidget(parent) +DetailWindow::DetailWindow(std::vector<std::size_t> data, QWidget* parent) : QWidget(parent) { setupUi(this); - size_t nEntries = data.size(); + std::size_t nEntries = data.size(); std::vector< std::pair<float, float> > list_data(nEntries); - for (size_t i=0; i<nEntries; i++) + for (std::size_t i=0; i<nEntries; i++) list_data.push_back(std::pair<float, float>(static_cast<float>(i), static_cast<float>(data[i]))); DiagramList* list = new DiagramList(); diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp index 2e98007532f..6eb7b9992df 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp @@ -36,8 +36,8 @@ DiagramList::~DiagramList() float DiagramList::calcMinXValue() { float min = std::numeric_limits<float>::max(); - size_t nCoords = _coords.size(); - for (size_t i = 0; i < nCoords; i++) + std::size_t nCoords = _coords.size(); + for (std::size_t i = 0; i < nCoords; i++) if (_coords[i].first < min) min = _coords[i].first; return min; @@ -46,8 +46,8 @@ float DiagramList::calcMinXValue() float DiagramList::calcMaxXValue() { float max = std::numeric_limits<float>::lowest(); - size_t nCoords = _coords.size(); - for (size_t i = 0; i < nCoords; i++) + std::size_t nCoords = _coords.size(); + for (std::size_t i = 0; i < nCoords; i++) if (_coords[i].first > max) max = _coords[i].first; return max; @@ -56,8 +56,8 @@ float DiagramList::calcMaxXValue() float DiagramList::calcMinYValue() { float min = std::numeric_limits<float>::max(); - size_t nCoords = _coords.size(); - for (size_t i = 0; i < nCoords; i++) + std::size_t nCoords = _coords.size(); + for (std::size_t i = 0; i < nCoords; i++) if (_coords[i].second < min) min = _coords[i].second; return min; @@ -66,8 +66,8 @@ float DiagramList::calcMinYValue() float DiagramList::calcMaxYValue() { float max = std::numeric_limits<float>::lowest(); - size_t nCoords = _coords.size(); - for (size_t i = 0; i < nCoords; i++) + std::size_t nCoords = _coords.size(); + for (std::size_t i = 0; i < nCoords; i++) if (_coords[i].second > max) max = _coords[i].second; return max; @@ -81,8 +81,8 @@ bool DiagramList::getPath(QPainterPath &path, float scaleX, float scaleY) QPainterPath pp(QPointF(p.x() * scaleX, p.y() * scaleY)); path = pp; - size_t nCoords = _coords.size(); - for (size_t i = 1; i < nCoords; i++) + std::size_t nCoords = _coords.size(); + for (std::size_t i = 1; i < nCoords; i++) { getPoint(p,i); path.lineTo(QPointF(p.x() * scaleX, p.y() * scaleY)); @@ -93,7 +93,7 @@ bool DiagramList::getPath(QPainterPath &path, float scaleX, float scaleY) return false; } -bool DiagramList::getPoint(QPointF &p, size_t i) +bool DiagramList::getPoint(QPointF &p, std::size_t i) { if (i < _coords.size()) { @@ -233,13 +233,13 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis std::vector<SensorDataType> const& time_series_names (data->getTimeSeriesNames()); int nLists(time_series_names.size()); - std::vector<size_t> time_steps; + std::vector<std::size_t> time_steps; if (data->getStepSize()>0) { - const size_t start = data->getStartTime(); - const size_t end = data->getEndTime(); - const size_t stepsize = data->getStepSize(); - for (size_t i = start; i <= end; i+=stepsize) + const std::size_t start = data->getStartTime(); + const std::size_t end = data->getEndTime(); + const std::size_t stepsize = data->getStepSize(); + for (std::size_t i = start; i <= end; i+=stepsize) time_steps.push_back(i); } else @@ -251,7 +251,7 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis is_date = true; - size_t nValues (time_steps.size()); + std::size_t nValues (time_steps.size()); for (int i = 0; i < nLists; i++) { @@ -268,7 +268,7 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis QDateTime startDate(getDateTime(QString::fromStdString(BaseLib::int2date(time_steps[0])))); lists[i]->setStartDate(startDate); int numberOfSecs(0); - for (size_t j = 0; j < nValues; j++) + for (std::size_t j = 0; j < nValues; j++) { numberOfSecs = startDate.secsTo(getDateTime(QString::fromStdString(BaseLib::int2date(time_steps[j])))); lists[i]->addNextPoint(numberOfSecs, (*time_series)[j]); @@ -277,7 +277,7 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis else { l->setXUnit("time step"); - for (size_t j = 0; j < nValues; j++) + for (std::size_t j = 0; j < nValues; j++) lists[i]->addNextPoint(time_steps[j], (*time_series)[j]); } @@ -294,8 +294,8 @@ void DiagramList::setList(std::vector< std::pair<QDateTime, float> > coords) this->_startDate = coords[0].first; _coords.push_back(std::pair<float, float>(0.0f, coords[0].second)); - size_t nCoords = coords.size(); - for (size_t i = 1; i < nCoords; i++) + std::size_t nCoords = coords.size(); + for (std::size_t i = 1; i < nCoords; i++) { numberOfDays = this->_startDate.daysTo(coords[i].first); _coords.push_back(std::pair<float, float>(static_cast<float>(numberOfDays), coords[i].second)); @@ -307,14 +307,14 @@ void DiagramList::setList(std::vector< std::pair<QDateTime, float> > coords) void DiagramList::setList(std::vector< std::pair<float, float> > coords) { this->_startDate = QDateTime(); - size_t nCoords = coords.size(); - for (size_t i = 0; i < nCoords; i++) + std::size_t nCoords = coords.size(); + for (std::size_t i = 0; i < nCoords; i++) _coords.push_back(coords[i]); update(); } -size_t DiagramList::size() +std::size_t DiagramList::size() { if (!(_coords.empty())) return _coords.size(); diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp index 447f88db854..887c3845445 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp @@ -81,7 +81,7 @@ void DiagramPrefsDialog::accept() window_is_empty = true; } - for (size_t i = 0; i < _list.size(); i++) + for (std::size_t i = 0; i < _list.size(); i++) if (this->_visability[i]->isChecked()) { _window->addList(_list[i]); @@ -129,7 +129,7 @@ int DiagramPrefsDialog::loadFile(const QString &filename) { if (DiagramList::readList(filename, _list)) { - for (size_t i = 0; i < _list.size(); i++) + for (std::size_t i = 0; i < _list.size(); i++) { //_list[i]->setName(stationTypeLabel->text() + ": " + stationNameLabel->text()); _list[i]->setXLabel("Time"); @@ -170,7 +170,7 @@ int DiagramPrefsDialog::loadList(const std::vector< std::pair<QDateTime, float> void DiagramPrefsDialog::createVisibilityCheckboxes() { - for (size_t i = 0; i < _list.size(); i++) + for (std::size_t i = 0; i < _list.size(); i++) { QCheckBox* box = new QCheckBox(_list[i]->getName()); box->setChecked(true); diff --git a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp index 9f6efe305c2..b2b6a3c1572 100644 --- a/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp +++ b/Applications/DataExplorer/DataView/DirectConditionGenerator.cpp @@ -29,7 +29,7 @@ #include <cmath> #include <limits> -const std::vector< std::pair<size_t,double> >& DirectConditionGenerator::directToSurfaceNodes(const MeshLib::Mesh &mesh, const std::string &filename) +const std::vector< std::pair<std::size_t,double> >& DirectConditionGenerator::directToSurfaceNodes(const MeshLib::Mesh &mesh, const std::string &filename) { if (_direct_values.empty()) { @@ -41,14 +41,14 @@ const std::vector< std::pair<size_t,double> >& DirectConditionGenerator::directT const MathLib::Vector3 dir(0,0,-1); const std::vector<GeoLib::Point*> surface_nodes(MeshLib::MeshSurfaceExtraction::getSurfaceNodes(mesh, dir, 90) ); - const size_t nNodes(surface_nodes.size()); + const std::size_t nNodes(surface_nodes.size()); const double no_data (raster->getNoDataValue()); _direct_values.reserve(nNodes); - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) { double val (raster->getValueAtPoint(*surface_nodes[i])); val = (val == no_data) ? 0 : val; - _direct_values.push_back (std::pair<size_t, double>(surface_nodes[i]->getID(), val)); + _direct_values.push_back (std::pair<std::size_t, double>(surface_nodes[i]->getID(), val)); } delete raster; } @@ -59,7 +59,7 @@ const std::vector< std::pair<size_t,double> >& DirectConditionGenerator::directT } -const std::vector< std::pair<size_t,double> >& DirectConditionGenerator::directWithSurfaceIntegration(MeshLib::Mesh &mesh, const std::string &filename, double scaling) +const std::vector< std::pair<std::size_t,double> >& DirectConditionGenerator::directWithSurfaceIntegration(MeshLib::Mesh &mesh, const std::string &filename, double scaling) { if (_direct_values.empty()) { @@ -74,14 +74,14 @@ const std::vector< std::pair<size_t,double> >& DirectConditionGenerator::directW std::vector<double> node_area_vec = MeshLib::MeshSurfaceExtraction::getSurfaceAreaForNodes(*sfc_mesh); const std::vector<MeshLib::Node*> &surface_nodes (sfc_mesh->getNodes()); - const size_t nNodes(sfc_mesh->getNNodes()); + const std::size_t nNodes(sfc_mesh->getNNodes()); const double no_data (raster->getNoDataValue()); _direct_values.reserve(nNodes); - for (size_t i=0; i<nNodes; ++i) + for (std::size_t i=0; i<nNodes; ++i) { double val (raster->getValueAtPoint(*surface_nodes[i])); val = (val == no_data) ? 0 : ((val*node_area_vec[i])/scaling); - _direct_values.push_back (std::pair<size_t, double>(surface_nodes[i]->getID(), val)); + _direct_values.push_back (std::pair<std::size_t, double>(surface_nodes[i]->getID(), val)); } delete raster; @@ -99,7 +99,7 @@ int DirectConditionGenerator::writeToFile(const std::string &name) const if (out) { - for (std::vector< std::pair<size_t,double> >::const_iterator it = _direct_values.begin(); it != _direct_values.end(); ++it) + for (std::vector< std::pair<std::size_t,double> >::const_iterator it = _direct_values.begin(); it != _direct_values.end(); ++it) out << it->first << "\t" << it->second << "\n"; out.close(); diff --git a/Applications/DataExplorer/DataView/ElementTreeModel.cpp b/Applications/DataExplorer/DataView/ElementTreeModel.cpp index ed02f4250d2..ac7734bc374 100644 --- a/Applications/DataExplorer/DataView/ElementTreeModel.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeModel.cpp @@ -79,8 +79,8 @@ void ElementTreeModel::setElement(vtkUnstructuredGridAlgorithm const*const grid, elemItem->appendChild(nodeListItem); //const std::vector<MeshLib::Node*> nodes_vec = grid->getNodes(); - size_t nElemNodes = elem->getNBaseNodes(); - for (size_t i = 0; i < nElemNodes; i++) + std::size_t nElemNodes = elem->getNBaseNodes(); + for (std::size_t i = 0; i < nElemNodes; i++) { const MeshLib::Node* node = elem->getNode(i); QList<QVariant> nodeData; diff --git a/Applications/DataExplorer/DataView/ElementTreeView.cpp b/Applications/DataExplorer/DataView/ElementTreeView.cpp index dbf5f11cd72..50004e2a29a 100644 --- a/Applications/DataExplorer/DataView/ElementTreeView.cpp +++ b/Applications/DataExplorer/DataView/ElementTreeView.cpp @@ -29,8 +29,8 @@ void ElementTreeView::updateView() { setAlternatingRowColors(true); setColumnWidth(0,125); - size_t nColumns = (this->model() != NULL) ? this->model()->columnCount() : 0; - for (size_t i = 1; i < nColumns; i++) + std::size_t nColumns = (this->model() != NULL) ? this->model()->columnCount() : 0; + for (std::size_t i = 1; i < nColumns; i++) resizeColumnToContents(i); this->expandAll(); } diff --git a/Applications/DataExplorer/DataView/GMSHPrefsDialog.cpp b/Applications/DataExplorer/DataView/GMSHPrefsDialog.cpp index 075c84f2720..2c6b30126bb 100644 --- a/Applications/DataExplorer/DataView/GMSHPrefsDialog.cpp +++ b/Applications/DataExplorer/DataView/GMSHPrefsDialog.cpp @@ -69,7 +69,7 @@ GMSHPrefsDialog::GMSHPrefsDialog(const GeoLib::GEOObjects* geoObjects, QDialog* for (unsigned k(0); k < geo_station_names.size(); ++k) geoNames.push_back (geo_station_names[k]); - size_t nGeoObjects(geoNames.size()); + std::size_t nGeoObjects(geoNames.size()); QStringList list; for (unsigned i = 0; i < nGeoObjects; ++i) diff --git a/Applications/DataExplorer/DataView/GeoTreeModel.cpp b/Applications/DataExplorer/DataView/GeoTreeModel.cpp index ab603ec6ded..1966d9cb2ac 100644 --- a/Applications/DataExplorer/DataView/GeoTreeModel.cpp +++ b/Applications/DataExplorer/DataView/GeoTreeModel.cpp @@ -53,9 +53,9 @@ void GeoTreeModel::addPointList(QString geoName, GeoLib::PointVec const& pointVe GeoObjectListItem* pointList = new GeoObjectListItem(pointData, geo, points, GeoLib::GEOTYPE::POINT); geo->appendChild(pointList); - size_t nPoints = points->size(); + std::size_t nPoints = points->size(); - for (size_t j = 0; j < nPoints; j++) + for (std::size_t j = 0; j < nPoints; j++) { const GeoLib::Point &pnt(*(*points)[j]); QList<QVariant> pnt_data; @@ -106,7 +106,7 @@ void GeoTreeModel::addPolylineList(QString geoName, GeoLib::PolylineVec const& p void GeoTreeModel::appendPolylines(const std::string &name, GeoLib::PolylineVec const& polylineVec) { - for (size_t i = 0; i < _lists.size(); i++) + for (std::size_t i = 0; i < _lists.size(); i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) for (int j = 0; j < _lists[i]->childCount(); j++) @@ -129,12 +129,12 @@ void GeoTreeModel::appendPolylines(const std::string &name, GeoLib::PolylineVec void GeoTreeModel::addChildren(GeoObjectListItem* plyList, GeoLib::PolylineVec const& polyline_vec, - size_t start_index, - size_t end_index) + std::size_t start_index, + std::size_t end_index) { const std::vector<GeoLib::Polyline*> lines = *(polyline_vec.getVector()); - for (size_t i = start_index; i < end_index; i++) + for (std::size_t i = start_index; i < end_index; i++) { QList<QVariant> line_data; line_data.reserve(4); @@ -194,7 +194,7 @@ void GeoTreeModel::addSurfaceList(QString geoName, GeoLib::SurfaceVec const& sur void GeoTreeModel::appendSurfaces(const std::string &name, GeoLib::SurfaceVec const& surfaceVec) { - for (size_t i = 0; i < _lists.size(); i++) + for (std::size_t i = 0; i < _lists.size(); i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) { @@ -220,13 +220,13 @@ void GeoTreeModel::appendSurfaces(const std::string &name, GeoLib::SurfaceVec co void GeoTreeModel::addChildren(GeoObjectListItem* sfcList, GeoLib::SurfaceVec const& surface_vec, - size_t start_index, - size_t end_index) + std::size_t start_index, + std::size_t end_index) { const std::vector<GeoLib::Surface*>* surfaces = surface_vec.getVector(); const std::vector<GeoLib::Point*> &nodesVec(*((*surfaces)[start_index]->getPointVec())); - for (size_t i = start_index; i < end_index; i++) + for (std::size_t i = start_index; i < end_index; i++) { QList<QVariant> surface; surface.reserve(4); @@ -274,7 +274,7 @@ void GeoTreeModel::addChildren(GeoObjectListItem* sfcList, */ void GeoTreeModel::removeGeoList(const std::string &name, GeoLib::GEOTYPE type) { - for (size_t i = 0; i < _lists.size(); i++) + for (std::size_t i = 0; i < _lists.size(); i++) if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) { for (int j = 0; j < _lists[i]->childCount(); j++) @@ -296,8 +296,8 @@ void GeoTreeModel::removeGeoList(const std::string &name, GeoLib::GEOTYPE type) vtkPolyDataAlgorithm* GeoTreeModel::vtkSource(const std::string &name, GeoLib::GEOTYPE type) const { - size_t nLists = _lists.size(); - for (size_t i = 0; i < nLists; i++) + std::size_t nLists = _lists.size(); + for (std::size_t i = 0; i < nLists; i++) { if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) for (int j = 0; j < _lists[i]->childCount(); j++) @@ -313,7 +313,7 @@ vtkPolyDataAlgorithm* GeoTreeModel::vtkSource(const std::string &name, GeoLib::G void GeoTreeModel::setNameForItem(const std::string &name, GeoLib::GEOTYPE type, - size_t id, + std::size_t id, std::string item_name) { std::string geo_type_str(""); diff --git a/Applications/DataExplorer/DataView/GeoTreeView.cpp b/Applications/DataExplorer/DataView/GeoTreeView.cpp index 7d78a8be100..0dd601c0c10 100644 --- a/Applications/DataExplorer/DataView/GeoTreeView.cpp +++ b/Applications/DataExplorer/DataView/GeoTreeView.cpp @@ -221,7 +221,7 @@ void GeoTreeView::setElementAsCondition(bool set_on_points) { const TreeItem* item = static_cast<GeoTreeModel*>(model())->getItem( this->selectionModel()->currentIndex()); - const size_t id = item->row(); + const std::size_t id = item->row(); const GeoLib::GEOTYPE type = static_cast<GeoObjectListItem*>(item->parentItem())->getType(); const std::string geometry_name = item->parentItem()->parentItem()->data(0).toString().toStdString(); emit requestCondSetupDialog(geometry_name, type, id, set_on_points); @@ -231,7 +231,7 @@ void GeoTreeView::setNameForElement() { const TreeItem* item = static_cast<GeoTreeModel*>(model())->getItem( this->selectionModel()->currentIndex()); - const size_t id = item->row(); + const std::size_t id = item->row(); const GeoLib::GEOTYPE type = static_cast<GeoObjectListItem*>(item->parentItem())->getType(); const std::string geometry_name = item->parentItem()->parentItem()->data(0).toString().toStdString(); emit requestNameChangeDialog(geometry_name, type, id); diff --git a/Applications/DataExplorer/DataView/LineEditDialog.cpp b/Applications/DataExplorer/DataView/LineEditDialog.cpp index 60dc2d95d59..5ce5f424675 100644 --- a/Applications/DataExplorer/DataView/LineEditDialog.cpp +++ b/Applications/DataExplorer/DataView/LineEditDialog.cpp @@ -25,9 +25,9 @@ LineEditDialog::LineEditDialog(const GeoLib::PolylineVec &ply_vec, QDialog* pare this->proximityEdit->setValidator(new QDoubleValidator(0, 100, 8, this)); - size_t nPly(ply_vec.size()); + std::size_t nPly(ply_vec.size()); QStringList list; - for (size_t i = 0; i < nPly; i++) + for (std::size_t i = 0; i < nPly; i++) { std::string ply_name(""); ply_vec.getNameOfElementByID(i, ply_name); @@ -75,7 +75,7 @@ void LineEditDialog::on_deselectPlyButton_pressed() void LineEditDialog::accept() { - std::vector<size_t> selectedIndeces = this->getSelectedIndeces(_selPly->stringList()); + std::vector<std::size_t> selectedIndeces = this->getSelectedIndeces(_selPly->stringList()); if (!selectedIndeces.empty()) { @@ -101,9 +101,9 @@ void LineEditDialog::reject() this->done(QDialog::Rejected); } -std::vector<size_t> LineEditDialog::getSelectedIndeces(QStringList list) +std::vector<std::size_t> LineEditDialog::getSelectedIndeces(QStringList list) { - std::vector<size_t> indexList; + std::vector<std::size_t> indexList; for (QStringList::iterator it = list.begin(); it != list.end(); ++it) { QString s = it->mid(5, it->indexOf(" ") - 5); diff --git a/Applications/DataExplorer/DataView/LinearEditDialog.cpp b/Applications/DataExplorer/DataView/LinearEditDialog.cpp index ab8aa62a3c1..9324b0fc031 100644 --- a/Applications/DataExplorer/DataView/LinearEditDialog.cpp +++ b/Applications/DataExplorer/DataView/LinearEditDialog.cpp @@ -15,7 +15,7 @@ #include "LinearEditDialog.h" LinearEditDialog::LinearEditDialog(const GeoLib::Polyline &line, - const std::vector<size_t> &dis_nodes, + const std::vector<std::size_t> &dis_nodes, const std::vector<double> &dis_values, QDialog* parent) : QDialog(parent), _line(line) @@ -24,14 +24,14 @@ LinearEditDialog::LinearEditDialog(const GeoLib::Polyline &line, setupDialog(dis_nodes, dis_values); } -void LinearEditDialog::setupDialog(const std::vector<size_t> &dis_nodes, +void LinearEditDialog::setupDialog(const std::vector<std::size_t> &dis_nodes, const std::vector<double> &dis_values) { - size_t nPoints(_line.getNumberOfPoints()); + std::size_t nPoints(_line.getNumberOfPoints()); this->tableWidget->setRowCount(nPoints); QList<QString> indexlist; - for (size_t i = 0; i < nPoints; i++) + for (std::size_t i = 0; i < nPoints; i++) { indexlist.push_back(QString::number(i)); QTableWidgetItem *newItem = new QTableWidgetItem(""); @@ -40,8 +40,8 @@ void LinearEditDialog::setupDialog(const std::vector<size_t> &dis_nodes, QStringList vHeaders(indexlist); tableWidget->setVerticalHeaderLabels(vHeaders); - size_t nValues (dis_values.size()); - for (size_t i = 0; i < nValues; i++) + std::size_t nValues (dis_values.size()); + for (std::size_t i = 0; i < nValues; i++) tableWidget->item(dis_nodes[i],0)->setText(QString::number(dis_values[i])); } @@ -53,8 +53,8 @@ void LinearEditDialog::on_comboBox_currentIndexChanged(int index) { if (index > 0) //elevation { - size_t nRows = tableWidget->rowCount(); - for (size_t i = 0; i < nRows; i++) + std::size_t nRows = tableWidget->rowCount(); + for (std::size_t i = 0; i < nRows; i++) tableWidget->item(i,0)->setText(QString::number(_line.getPoint(i)->getCoords()[2])); } } @@ -63,8 +63,8 @@ void LinearEditDialog::accept() { std::vector< std::pair<std::size_t,double> > linear_values; - size_t nRows = tableWidget->rowCount(); - for (size_t i = 0; i < nRows; i++) + std::size_t nRows = tableWidget->rowCount(); + for (std::size_t i = 0; i < nRows; i++) { QString row_text (tableWidget->item(i,0)->text()); if (row_text.length() > 0) diff --git a/Applications/DataExplorer/DataView/MergeGeometriesDialog.cpp b/Applications/DataExplorer/DataView/MergeGeometriesDialog.cpp index 9a822ad1dec..791d580fdf0 100644 --- a/Applications/DataExplorer/DataView/MergeGeometriesDialog.cpp +++ b/Applications/DataExplorer/DataView/MergeGeometriesDialog.cpp @@ -36,7 +36,7 @@ MergeGeometriesDialog::MergeGeometriesDialog(GeoLib::GEOObjects* geoObjects, QDi //geoNames.reserve(geo_station_names.size()); //std::copy(geo_station_names.begin(), geo_station_names.end(), std::back_inserter(geoNames)); - size_t nGeoObjects(geoNames.size()); + std::size_t nGeoObjects(geoNames.size()); QStringList list; for (unsigned i = 0; i < nGeoObjects; ++i) diff --git a/Applications/DataExplorer/DataView/MshModel.cpp b/Applications/DataExplorer/DataView/MshModel.cpp index c82285bce65..2a9a67515e2 100644 --- a/Applications/DataExplorer/DataView/MshModel.cpp +++ b/Applications/DataExplorer/DataView/MshModel.cpp @@ -69,11 +69,11 @@ void MshModel::addMeshObject(const MeshLib::Mesh* mesh) // display elements const std::vector<MeshLib::Element*> &elems = mesh->getElements(); - const size_t nElems (elems.size()); + const std::size_t nElems (elems.size()); QString elem_type_string(""); MeshLib::MeshElemType elem_type(MeshLib::MeshElemType::INVALID); - for (size_t i = 0; i < nElems; i++) + for (std::size_t i = 0; i < nElems; i++) { const MeshLib::Element* current_element (elems[i]); MeshLib::MeshElemType t (current_element->getGeomType()); diff --git a/Applications/DataExplorer/DataView/MshView.cpp b/Applications/DataExplorer/DataView/MshView.cpp index 31b88e53f6f..17f92284089 100644 --- a/Applications/DataExplorer/DataView/MshView.cpp +++ b/Applications/DataExplorer/DataView/MshView.cpp @@ -55,8 +55,8 @@ void MshView::updateView() { setAlternatingRowColors(true); setColumnWidth(0,125); - size_t nColumns = (this->model() != NULL) ? this->model()->columnCount() : 0; - for (size_t i = 1; i < nColumns; i++) + std::size_t nColumns = (this->model() != NULL) ? this->model()->columnCount() : 0; + for (std::size_t i = 1; i < nColumns; i++) resizeColumnToContents(i); } diff --git a/Applications/DataExplorer/DataView/NetCdfConfigureDialog.cpp b/Applications/DataExplorer/DataView/NetCdfConfigureDialog.cpp index 2e5e1fa769a..3e6a65df46c 100644 --- a/Applications/DataExplorer/DataView/NetCdfConfigureDialog.cpp +++ b/Applications/DataExplorer/DataView/NetCdfConfigureDialog.cpp @@ -229,7 +229,7 @@ void NetCdfConfigureDialog::getDimEdges(int dimId, unsigned &size, double &first int sizeOfDim = tmpVarOfDim->get_dim(0)->size(); size = sizeOfDim; double arrayOfDimStart[1] = {0}; - size_t edgeOfArray[1] = {1}; + std::size_t edgeOfArray[1] = {1}; long edgeOrigin[1] = {0}; tmpVarOfDim->set_cur(edgeOrigin); tmpVarOfDim->get(arrayOfDimStart,edgeOfArray); @@ -313,7 +313,7 @@ double NetCdfConfigureDialog::getResolution() void NetCdfConfigureDialog::createDataObject() { - size_t* length = new size_t[_currentVar->num_dims()]; + std::size_t* length = new std::size_t[_currentVar->num_dims()]; double originLon = 0, originLat = 0; double lastLon = 0, lastLat = 0; unsigned sizeLon = 0, sizeLat = 0; @@ -328,7 +328,7 @@ void NetCdfConfigureDialog::createDataObject() // set up array double* data_array = new double[sizeLat*sizeLon]; - for(size_t i=0; i < (sizeLat*sizeLon); i++) data_array[i]=0; + for(std::size_t i=0; i < (sizeLat*sizeLon); i++) data_array[i]=0; //Time-Dimension: if (_currentVar->num_dims() > 2) @@ -344,7 +344,7 @@ void NetCdfConfigureDialog::createDataObject() _currentVar->get(data_array,length); //create Array of Values - for (size_t i=0; i < (sizeLat*sizeLon); i++) + for (std::size_t i=0; i < (sizeLat*sizeLon); i++) { //data_array[i] = data_array[i] - 273; // convert from kalvin to celsius if (data_array[i] < -9999 ) data_array[i] = -9999; // all values < -10000, set to "no-value" @@ -407,22 +407,22 @@ std::string NetCdfConfigureDialog::getName() return name; } -void NetCdfConfigureDialog::reverseNorthSouth(double* data, size_t width, size_t height) +void NetCdfConfigureDialog::reverseNorthSouth(double* data, std::size_t width, std::size_t height) { double* cp_array = new double[width*height]; - for (size_t i=0; i<height; i++) + for (std::size_t i=0; i<height; i++) { - for (size_t j=0; j<width; j++) + for (std::size_t j=0; j<width; j++) { - size_t old_index((width*height)-(width*(i+1))); - size_t new_index(width*i); + std::size_t old_index((width*height)-(width*(i+1))); + std::size_t new_index(width*i); cp_array[new_index+j] = data[old_index+j]; } } - size_t length(height*width); - for (size_t i=0; i<length; i++) + std::size_t length(height*width); + for (std::size_t i=0; i<length; i++) data[i] = cp_array[i]; delete[] cp_array; diff --git a/Applications/DataExplorer/DataView/StationTreeModel.cpp b/Applications/DataExplorer/DataView/StationTreeModel.cpp index 79a2eee786d..6307f48d95b 100644 --- a/Applications/DataExplorer/DataView/StationTreeModel.cpp +++ b/Applications/DataExplorer/DataView/StationTreeModel.cpp @@ -95,8 +95,8 @@ GeoLib::Station* StationTreeModel::stationFromIndex( const QModelIndex& index, vtkPolyDataAlgorithm* StationTreeModel::vtkSource(const std::string &name) const { - size_t nLists = _lists.size(); - for (size_t i = 0; i < nLists; i++) + std::size_t nLists = _lists.size(); + for (std::size_t i = 0; i < nLists; i++) if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) return dynamic_cast<BaseItem*>(_lists[i]->getItem())->vtkSource(); return nullptr; @@ -149,7 +149,7 @@ void StationTreeModel::removeStationList(QModelIndex index) ModelTreeItem* item = static_cast<ModelTreeItem*>(getItem(index)); // also delete the lists entry in the list directory of the model - for (size_t i = 0; i < _lists.size(); i++) + for (std::size_t i = 0; i < _lists.size(); i++) if (item == _lists[i]) _lists.erase(_lists.begin() + i); @@ -163,7 +163,7 @@ void StationTreeModel::removeStationList(QModelIndex index) */ void StationTreeModel::removeStationList(const std::string &name) { - for (size_t i = 0; i < _lists.size(); i++) + for (std::size_t i = 0; i < _lists.size(); i++) if ( name.compare( _lists[i]->data(0).toString().toStdString() ) == 0 ) removeStationList(createIndex(_lists[i]->row(), 0, _lists[i])); } diff --git a/Applications/DataExplorer/DataView/StationTreeView.cpp b/Applications/DataExplorer/DataView/StationTreeView.cpp index 84d4abfc8a4..624666825e8 100644 --- a/Applications/DataExplorer/DataView/StationTreeView.cpp +++ b/Applications/DataExplorer/DataView/StationTreeView.cpp @@ -244,15 +244,15 @@ void StationTreeView::writeStratigraphiesAsImages(QString listName) toStdString())) ->getColorLookupTable(); std::vector<ModelTreeItem*> lists = static_cast<StationTreeModel*>(model())->getLists(); - size_t nLists = lists.size(); - for (size_t i = 0; i < nLists; i++) + std::size_t nLists = lists.size(); + for (std::size_t i = 0; i < nLists; i++) if ( listName.toStdString().compare( lists[i]->data(0).toString().toStdString() ) == 0 ) { const std::vector<GeoLib::Point*>* stations = dynamic_cast<BaseItem*>(lists[i]->getItem())->getStations(); - for (size_t i = 0; i < stations->size(); i++) + for (std::size_t i = 0; i < stations->size(); i++) { StratWindow* stratView = new StratWindow(static_cast<GeoLib::StationBorehole*>((* diff --git a/Applications/DataExplorer/DataView/StratView/StratBar.cpp b/Applications/DataExplorer/DataView/StratView/StratBar.cpp index 6778f935a18..0dbd2dd24f9 100644 --- a/Applications/DataExplorer/DataView/StratView/StratBar.cpp +++ b/Applications/DataExplorer/DataView/StratView/StratBar.cpp @@ -52,11 +52,11 @@ void StratBar::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, //pen.setWidth(1); std::vector<GeoLib::Point*> profile = _station->getProfile(); std::vector<std::string> soilNames = _station->getSoilNames(); - size_t nLayers = profile.size(); + std::size_t nLayers = profile.size(); painter->drawLine(0, 0, BARWIDTH + 5, 0); - for (size_t i = 1; i < nLayers; i++) + for (std::size_t i = 1; i < nLayers; i++) { top += height; height = logHeight(((*(profile[i - 1]))[2] - (*(profile[i]))[2])); @@ -79,7 +79,7 @@ double StratBar::totalLogHeight() const double height = 0; std::vector<GeoLib::Point*> profile = _station->getProfile(); - for (size_t i = 1; i < profile.size(); i++) + for (std::size_t i = 1; i < profile.size(); i++) height += ( log((*(profile[i - 1]))[2] - (*(profile[i]))[2] + 1) * 100 ); return height; diff --git a/Applications/DataExplorer/DataView/StratView/StratScene.cpp b/Applications/DataExplorer/DataView/StratView/StratScene.cpp index 8ed9ef072fd..19de852fa7e 100644 --- a/Applications/DataExplorer/DataView/StratView/StratScene.cpp +++ b/Applications/DataExplorer/DataView/StratView/StratScene.cpp @@ -76,7 +76,7 @@ void StratScene::addDepthLabels(std::vector<GeoLib::Point*> profile, double offs textBounds = depthText[0]->boundingRect(); depthText[0]->setPos(offset + textBounds.width() / 2, vertPos); - for (size_t i = 1; i < profile.size(); i++) + for (std::size_t i = 1; i < profile.size(); i++) { depthText.push_back(addNonScalableText(QString::number((*(profile[i]))[2]))); vertPos += log((*(profile[i - 1]))[2] - (*(profile[i]))[2] + 1) * 100; @@ -104,7 +104,7 @@ void StratScene::addSoilNameLabels(std::vector<std::string> soilNames, //textBounds = soilText[0]->boundingRect(); soilText[0]->setPos(offset /* - textBounds.width() */, vertPos); - for (size_t i = 1; i < soilNames.size(); i++) + for (std::size_t i = 1; i < soilNames.size(); i++) { soilText.push_back(addNonScalableText(QString::fromStdString(soilNames[i]))); halfHeight = log((*(profile[i - 1]))[2] - (*(profile[i]))[2] + 1) * 100 / 2; diff --git a/Applications/DataExplorer/VtkVis/VtkAppendArrayFilter.cpp b/Applications/DataExplorer/VtkVis/VtkAppendArrayFilter.cpp index 1ff0e6b0f66..fc14ea6bf07 100644 --- a/Applications/DataExplorer/VtkVis/VtkAppendArrayFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkAppendArrayFilter.cpp @@ -59,15 +59,15 @@ int VtkAppendArrayFilter::RequestData( vtkInformation*, vtkSmartPointer<vtkDoubleArray> colors = vtkSmartPointer<vtkDoubleArray>::New(); colors->SetNumberOfComponents(1); - size_t arrayLength = this->_array.size(); + std::size_t arrayLength = this->_array.size(); colors->SetNumberOfValues(arrayLength); colors->SetName("Selection"); - size_t nCells = input->GetNumberOfCells(); + std::size_t nCells = input->GetNumberOfCells(); if (nCells > arrayLength) WARN("VtkAppendArrayFilter::RequestData(): Number of cells exceeds selection array length. Surplus cells won't be examined."); - for (size_t i = 0; i < arrayLength; i++) + for (std::size_t i = 0; i < arrayLength; i++) colors->SetValue(i, _array[i]); vtkInformation* outInfo = outputVector->GetInformationObject(0); diff --git a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp index 61e011617a9..71dfbde0f27 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorByHeightFilter.cpp @@ -75,12 +75,12 @@ int VtkColorByHeightFilter::RequestData( vtkInformation*, vtkSmartPointer<vtkFloatArray> colors = vtkSmartPointer<vtkFloatArray>::New(); colors->SetNumberOfComponents(1); - size_t nPoints = input->GetNumberOfPoints(); + std::size_t nPoints = input->GetNumberOfPoints(); colors->SetNumberOfValues(nPoints); colors->SetName("Colors"); // Inserts height values as a new scalar array - for (size_t i = 0; i < nPoints; i++) + for (std::size_t i = 0; i < nPoints; i++) { double p[3]; input->GetPoint(i,p); diff --git a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp index be433fb3e1e..818d881aa78 100644 --- a/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp +++ b/Applications/DataExplorer/VtkVis/VtkColorLookupTable.cpp @@ -63,30 +63,30 @@ void VtkColorLookupTable::Build() { // make sure that color map starts with the first color in the dictionary unsigned char startcolor[4] = { 0, 0 , 0 , 0 }; - std::pair<size_t, unsigned char*> lastValue(0, startcolor); - size_t nextIndex(0); + std::pair<std::size_t, unsigned char*> lastValue(0, startcolor); + std::size_t nextIndex(0); for (std::map<double, unsigned char*>::const_iterator it = _dict.begin(); it != _dict.end(); ++it) { double val = (it->first < range[0]) ? range[0] : ((it->first > range[1]) ? range[1] : it->first); - nextIndex = static_cast<size_t>( std::floor(val-range[0]) ); + nextIndex = static_cast<std::size_t>( std::floor(val-range[0]) ); this->SetTableValue(nextIndex, it->second); if ( nextIndex - lastValue.first > 0 ) - for (size_t i = lastValue.first + 1; i < nextIndex; i++) + for (std::size_t i = lastValue.first + 1; i < nextIndex; i++) { unsigned char int_rgba[4]; double pos = (i - lastValue.first) / (static_cast<double>(nextIndex - lastValue.first)); if (_type == VtkColorLookupTable::LUTType::LINEAR) - for (size_t j = 0; j < 4; j++) + for (std::size_t j = 0; j < 4; j++) int_rgba[j] = linInterpolation( (lastValue.second)[j], (it->second)[j], pos); else if (_type == VtkColorLookupTable::LUTType::EXPONENTIAL) - for (size_t j = 0; j < 4; j++) + for (std::size_t j = 0; j < 4; j++) int_rgba[j] = expInterpolation((lastValue.second)[j], (it->second)[j], 0.2, pos); else // no interpolation - for (size_t j = 0; j < 4; j++) + for (std::size_t j = 0; j < 4; j++) int_rgba[j] = (lastValue.second)[j]; this->SetTableValue(i, int_rgba); @@ -106,8 +106,8 @@ void VtkColorLookupTable::writeToFile(const std::string &filename) strout << "Writing color table to " << filename << " ... "; std::ofstream out( filename.c_str(), std::ios::out ); - size_t nColors = this->GetNumberOfTableValues(); - for (size_t i = 0; i < nColors; i++) + std::size_t nColors = this->GetNumberOfTableValues(); + for (std::size_t i = 0; i < nColors; i++) { unsigned char rgba[4]; this->GetTableValue(i, rgba); @@ -140,7 +140,7 @@ void VtkColorLookupTable::GetTableValue(vtkIdType idx, unsigned char rgba[4]) void VtkColorLookupTable::setColor(double pos, unsigned char rgba[4]) { unsigned char* dict_rgba = new unsigned char[4]; - for (size_t i = 0; i < 4; i++) + for (std::size_t i = 0; i < 4; i++) dict_rgba[i] = rgba[i]; _dict.insert( std::pair<double, unsigned char*>(pos, dict_rgba) ); } @@ -152,11 +152,11 @@ void VtkColorLookupTable::getColor(vtkIdType indx, unsigned char rgba[4]) const ? static_cast<vtkIdType>(this->TableRange[0]) : (indx >=this->TableRange[1] ? static_cast<vtkIdType>(this->TableRange[1]) - 1 : indx)); indx = - static_cast<size_t>( std::floor( (indx - this->TableRange[0]) * + static_cast<std::size_t>( std::floor( (indx - this->TableRange[0]) * (this->NumberOfColors / (this->TableRange[1] - this->TableRange[0])) ) ); unsigned char* _rgba; _rgba = this->Table->GetPointer(indx * 4); - for (size_t i = 0; i < 4; i++) + for (std::size_t i = 0; i < 4; i++) rgba[i] = _rgba[i]; } diff --git a/Applications/DataExplorer/VtkVis/VtkCompositeGeoObjectFilter.cpp b/Applications/DataExplorer/VtkVis/VtkCompositeGeoObjectFilter.cpp index 83a01794efc..d910a68ab37 100644 --- a/Applications/DataExplorer/VtkVis/VtkCompositeGeoObjectFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkCompositeGeoObjectFilter.cpp @@ -88,7 +88,7 @@ void VtkCompositeGeoObjectFilter::init() _outputAlgorithm = surface; } -void VtkCompositeGeoObjectFilter::SetIndex(size_t idx) +void VtkCompositeGeoObjectFilter::SetIndex(std::size_t idx) { _threshold->ThresholdBetween(idx, idx); } diff --git a/Applications/DataExplorer/VtkVis/VtkCompositePointToGlyphFilter.cpp b/Applications/DataExplorer/VtkVis/VtkCompositePointToGlyphFilter.cpp index 4aa23833f09..e1c799588b6 100644 --- a/Applications/DataExplorer/VtkVis/VtkCompositePointToGlyphFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkCompositePointToGlyphFilter.cpp @@ -36,9 +36,9 @@ void VtkCompositePointToGlyphFilter::init() this->_inputDataObjectType = VTK_DATA_SET; this->_outputDataObjectType = VTK_POLY_DATA; - size_t nPoints = static_cast<vtkDataSetAlgorithm*>(_inputAlgorithm) + std::size_t nPoints = static_cast<vtkDataSetAlgorithm*>(_inputAlgorithm) ->GetOutput()->GetPointData()->GetNumberOfTuples(); - int phi (10 - static_cast<size_t>(nPoints / 2000.0)); + int phi (10 - static_cast<std::size_t>(nPoints / 2000.0)); int theta (phi); if (phi < 4) { diff --git a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp index ffafc82de87..e466a601e9e 100644 --- a/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkImageDataToLinePolyDataFilter.cpp @@ -121,7 +121,7 @@ int VtkImageDataToLinePolyDataFilter::RequestData(vtkInformation*, // Compute the new point location double newPt[3]; - for(size_t i = 0; i < 3; ++i) + for(std::size_t i = 0; i < 3; ++i) newPt[i] = p[i] + dir[i] * length; // Copy the old point diff --git a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp index d0080c48235..1308802c341 100644 --- a/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkPolylinesSource.cpp @@ -107,7 +107,7 @@ int VtkPolylinesSource::RequestData( vtkInformation* request, unsigned lastMaxIndex (0); const std::size_t nPolylines (_polylines->size()); - for (size_t j = 0; j < nPolylines; j++) + for (std::size_t j = 0; j < nPolylines; j++) { const int numPoints = (*_polylines)[j]->getNumberOfPoints(); const bool isClosed = (*_polylines)[j]->isClosed(); diff --git a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp index 5606bc70ddb..917ac8c1676 100644 --- a/Applications/DataExplorer/VtkVis/VtkStationSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkStationSource.cpp @@ -84,13 +84,13 @@ int VtkStationSource::RequestData( vtkInformation* request, if (!_stations) return 0; - size_t nStations = _stations->size(); + std::size_t nStations = _stations->size(); if (nStations == 0) return 0; bool useStationValues(false); double sValue=static_cast<GeoLib::Station*>((*_stations)[0])->getStationValue(); - for (size_t i = 1; i < nStations; i++) + for (std::size_t i = 1; i < nStations; i++) if (static_cast<GeoLib::Station*>((*_stations)[i])->getStationValue() != sValue) { useStationValues = true; @@ -129,8 +129,8 @@ int VtkStationSource::RequestData( vtkInformation* request, strat_ids->SetNumberOfComponents(1); strat_ids->SetName("Stratigraphies"); - size_t lastMaxIndex(0); - size_t site_count(0); + std::size_t lastMaxIndex(0); + std::size_t site_count(0); // Generate graphic objects for (std::vector<GeoLib::Point*>::const_iterator it = _stations->begin(); @@ -150,9 +150,9 @@ int VtkStationSource::RequestData( vtkInformation* request, static_cast<GeoLib::StationBorehole*>(*it)->getProfile(); std::vector<std::string> soilNames = static_cast<GeoLib::StationBorehole*>(*it)->getSoilNames(); - const size_t nLayers = profile.size(); + const std::size_t nLayers = profile.size(); - for (size_t i = 1; i < nLayers; i++) + for (std::size_t i = 1; i < nLayers; i++) { double* pCoords = const_cast<double*>(profile[i]->getCoords()); double loc[3] = { pCoords[0], pCoords[1], pCoords[2] }; @@ -206,7 +206,7 @@ void VtkStationSource::SetUserProperty( QString name, QVariant value ) Q_UNUSED(value); } -size_t VtkStationSource::GetIndexByName( std::string const& name ) +std::size_t VtkStationSource::GetIndexByName( std::string const& name ) { vtkIdType max_key(0); for (std::map<std::string, vtkIdType>::const_iterator it = _id_map.begin(); diff --git a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp index c27ea81e1c6..0bb14922fb1 100644 --- a/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp +++ b/Applications/DataExplorer/VtkVis/VtkSurfacesSource.cpp @@ -67,7 +67,7 @@ int VtkSurfacesSource::RequestData( vtkInformation* request, return 0; const std::vector<GeoLib::Point*>* surfacePoints = (*_surfaces)[0]->getPointVec(); - size_t nPoints = surfacePoints->size(); + std::size_t nPoints = surfacePoints->size(); vtkSmartPointer<vtkInformation> outInfo = outputVector->GetInformationObject(0); vtkSmartPointer<vtkPolyData> output = @@ -85,7 +85,7 @@ int VtkSurfacesSource::RequestData( vtkInformation* request, sfcIDs->SetNumberOfComponents(1); sfcIDs->SetName("SurfaceIDs"); - for (size_t i = 0; i < nPoints; ++i) + for (std::size_t i = 0; i < nPoints; ++i) { const double* coords = const_cast<double*>((*surfacePoints)[i]->getCoords()); newPoints->SetPoint(i, coords); @@ -95,15 +95,15 @@ int VtkSurfacesSource::RequestData( vtkInformation* request, for (std::vector<GeoLib::Surface*>::const_iterator it = _surfaces->begin(); it != _surfaces->end(); ++it) { - const size_t nTriangles = (*it)->getNTriangles(); + const std::size_t nTriangles = (*it)->getNTriangles(); - for (size_t i = 0; i < nTriangles; ++i) + for (std::size_t i = 0; i < nTriangles; ++i) { vtkTriangle* new_tri = vtkTriangle::New(); new_tri->GetPointIds()->SetNumberOfIds(3); const GeoLib::Triangle* triangle = (**it)[i]; - for (size_t j = 0; j < 3; ++j) + for (std::size_t j = 0; j < 3; ++j) new_tri->GetPointIds()->SetId(j, ((*triangle)[j])); newPolygons->InsertNextCell(new_tri); sfcIDs->InsertNextValue(count); diff --git a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp index 868ec744fd0..c44a5f4b592 100644 --- a/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp +++ b/Applications/DataExplorer/VtkVis/VtkTextureOnSurfaceFilter.cpp @@ -66,8 +66,8 @@ int VtkTextureOnSurfaceFilter::RequestData( vtkInformation* request, int dims[3]; this->GetTexture()->GetInput()->GetDimensions(dims); - size_t imgWidth = dims[0]; - size_t imgHeight = dims[1]; + std::size_t imgWidth = dims[0]; + std::size_t imgHeight = dims[1]; std::pair<int, int> min((int)_origin.first, (int)_origin.second); std::pair<int, int> max((int)(_origin.first + (imgWidth * _scalingFactor)), @@ -77,12 +77,12 @@ int VtkTextureOnSurfaceFilter::RequestData( vtkInformation* request, vtkPoints* points = input->GetPoints(); vtkSmartPointer<vtkFloatArray> textureCoordinates = vtkSmartPointer<vtkFloatArray>::New(); textureCoordinates->SetNumberOfComponents(2); - size_t nPoints = points->GetNumberOfPoints(); + std::size_t nPoints = points->GetNumberOfPoints(); textureCoordinates->SetNumberOfTuples(nPoints); textureCoordinates->SetName("textureCoords"); /* // adaptation for netcdf-curtain for TERENO Demo double dist(0.0); - for (size_t i = 0; i < nPoints; i++) + for (std::size_t i = 0; i < nPoints; i++) { double coords[3]; if ((i==0) || (i==173)) diff --git a/Applications/DataExplorer/VtkVis/VtkVisHelper.cpp b/Applications/DataExplorer/VtkVis/VtkVisHelper.cpp index 888b84f2cb9..b2d8a243bc7 100644 --- a/Applications/DataExplorer/VtkVis/VtkVisHelper.cpp +++ b/Applications/DataExplorer/VtkVis/VtkVisHelper.cpp @@ -25,13 +25,13 @@ vtkImageData* VtkVisHelper::QImageToVtkImageData(QImage &img) { - size_t imgWidth = img.width(), imgHeight = img.height(); + std::size_t imgWidth = img.width(), imgHeight = img.height(); vtkSmartPointer<vtkUnsignedCharArray> data = vtkSmartPointer<vtkUnsignedCharArray>::New(); data->SetNumberOfComponents(3); data->SetNumberOfTuples( imgWidth * imgHeight ); - for (size_t j = 0; j < imgHeight; j++) - for (size_t i = 0; i < imgWidth; i++) + for (std::size_t j = 0; j < imgHeight; j++) + for (std::size_t i = 0; i < imgWidth; i++) { QRgb pix = img.pixel(i,j); const float color[3] = { static_cast<float>(qRed(pix)), diff --git a/Applications/DataExplorer/mainwindow.cpp b/Applications/DataExplorer/mainwindow.cpp index c08b8424704..144c7591d77 100644 --- a/Applications/DataExplorer/mainwindow.cpp +++ b/Applications/DataExplorer/mainwindow.cpp @@ -279,7 +279,7 @@ MainWindow::MainWindow(QWidget* parent /* = 0*/) _vtkWidget = visualizationWidget->vtkWidget; QDesktopWidget* desktopWidget = QApplication::desktop(); const unsigned int screenCount = desktopWidget->screenCount(); - for (size_t i = 0; i < screenCount; ++i) + for (std::size_t i = 0; i < screenCount; ++i) _screenGeometries.push_back(desktopWidget->availableGeometry((int)i)); // Setup import files menu @@ -472,7 +472,7 @@ void MainWindow::loadFile(ImportFileType::type t, const QString &fileName) std::string unique_name; std::vector<std::string> errors; if (! Legacy::readGLIFileV4(fileName.toStdString(), _project.getGEOObjects(), unique_name, errors)) { - for (size_t k(0); k<errors.size(); k++) + for (std::size_t k(0); k<errors.size(); k++) OGSError::box(QString::fromStdString(errors[k])); } } @@ -918,7 +918,7 @@ void MainWindow::callGMSH(std::vector<std::string> & selectedGeometries, { std::string fname (fileName.toStdString()); std::string gmsh_command = "\"" + gmsh_path + "\" -2 -algo meshadapt " + fname; - size_t pos (fname.rfind (".")); + std::size_t pos (fname.rfind (".")); if (pos != std::string::npos) fname = fname.substr (0, pos); gmsh_command += " -o " + fname + ".msh"; @@ -988,7 +988,7 @@ void MainWindow::showDiagramPrefsDialog() } } -void MainWindow::showGeoNameDialog(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, size_t id) +void MainWindow::showGeoNameDialog(const std::string &geometry_name, const GeoLib::GEOTYPE object_type, std::size_t id) { std::string old_name = this->_project.getGEOObjects()->getElementNameByID(geometry_name, object_type, id); SetNameDialog dlg(GeoLib::convertGeoTypeToString(object_type), id, old_name); diff --git a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp index 09047537942..69fbc401abe 100644 --- a/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp +++ b/Applications/Utils/FileConverter/ConvertSHPToGLI.cpp @@ -40,10 +40,10 @@ void convertPoints (DBFHandle dbf_handle, std::string const& out_fname, - size_t x_id, - size_t y_id, - size_t z_id, - std::vector<size_t> const& name_component_ids, + std::size_t x_id, + std::size_t y_id, + std::size_t z_id, + std::vector<std::size_t> const& name_component_ids, std::string& points_group_name, bool station) { @@ -58,13 +58,13 @@ void convertPoints (DBFHandle dbf_handle, double x(DBFReadDoubleAttribute(dbf_handle, k, x_id)); double y(DBFReadDoubleAttribute(dbf_handle, k, y_id)); double z(0.0); - if (z_id != std::numeric_limits<size_t>::max()) + if (z_id != std::numeric_limits<std::size_t>::max()) z = DBFReadDoubleAttribute(dbf_handle, k, z_id); name.clear(); if (!name_component_ids.empty()) { - for (size_t j(0); j < name_component_ids.size(); j++) - if (name_component_ids[j] != std::numeric_limits<size_t>::max()) { + for (std::size_t j(0); j < name_component_ids.size(); j++) + if (name_component_ids[j] != std::numeric_limits<std::size_t>::max()) { name += DBFReadStringAttribute(dbf_handle, k, name_component_ids[j]); name += " "; } @@ -107,7 +107,7 @@ void printFieldInformationTable(DBFHandle const& dbf_handle, std::size_t n_field out << "************************************************" << std::endl; out << "field idx | name of field | data type of field " << std::endl; out << "------------------------------------------------" << std::endl; - for (size_t field_idx(0); field_idx < n_fields; field_idx++) { + for (std::size_t field_idx(0); field_idx < n_fields; field_idx++) { DBFGetFieldInfo(dbf_handle, field_idx, field_name, &width, &n_decimals); if (field_idx < 10) out << " " << field_idx << " |"; @@ -186,7 +186,7 @@ int main (int argc, char* argv[]) std::size_t n_fields(DBFGetFieldCount(dbf_handle)); printFieldInformationTable(dbf_handle, n_fields); - size_t x_id, y_id, z_id; + std::size_t x_id, y_id, z_id; INFO("Please give the field idx that should be used for reading the x coordinate: "); std::cin >> x_id; INFO("Please give the field idx that should be used for reading the y coordinate: "); @@ -195,26 +195,26 @@ int main (int argc, char* argv[]) std::cin >> z_id; if (z_id > n_fields) - z_id = std::numeric_limits<size_t>::max(); + z_id = std::numeric_limits<std::size_t>::max(); - size_t n_name_components; + std::size_t n_name_components; INFO("Please give the number of fields that should be added to name: "); std::cin >> n_name_components; - std::vector<size_t> name_component_ids (n_name_components, - std::numeric_limits<size_t>::max()); + std::vector<std::size_t> name_component_ids (n_name_components, + std::numeric_limits<std::size_t>::max()); if (n_name_components != 0) { - for (size_t j(0); j < n_name_components; j++) + for (std::size_t j(0); j < n_name_components; j++) { INFO("- please give the field idx that should be used for reading the name: "); std::cin >> name_component_ids[j]; } } - for (size_t j(0); j < n_name_components; j++) + for (std::size_t j(0); j < n_name_components; j++) if (name_component_ids[j] > n_fields) - name_component_ids[j] = std::numeric_limits<size_t>::max(); + name_component_ids[j] = std::numeric_limits<std::size_t>::max(); - size_t station (0); + std::size_t station (0); INFO("Should I read the information as GeoLib::Station (0) or as GeoLib::Point (1)? Please give the number: "); std::cin >> station; diff --git a/Applications/Utils/FileConverter/ConvertVtkToOsg.cpp b/Applications/Utils/FileConverter/ConvertVtkToOsg.cpp index 626bd5fd543..75a87717bc9 100644 --- a/Applications/Utils/FileConverter/ConvertVtkToOsg.cpp +++ b/Applications/Utils/FileConverter/ConvertVtkToOsg.cpp @@ -52,7 +52,7 @@ void replaceExt(string& s, const string& newExt) // Get file extension string getFileExt(const string& s) { - size_t i = s.rfind('.', s.length()); + std::size_t i = s.rfind('.', s.length()); if (i != string::npos) return s.substr(i + 1, s.length() - i); return ""; diff --git a/Applications/Utils/FileConverter/generateBCFromPolyline.cpp b/Applications/Utils/FileConverter/generateBCFromPolyline.cpp index 55562d65da7..4b3f3215206 100644 --- a/Applications/Utils/FileConverter/generateBCFromPolyline.cpp +++ b/Applications/Utils/FileConverter/generateBCFromPolyline.cpp @@ -56,10 +56,10 @@ int main (int argc, char* argv[]) std::cout << "could not found polylines" << std::endl; return -1; } - const size_t n_ply (ply_vec->size()); + const std::size_t n_ply (ply_vec->size()); - std::vector<size_t> ply_pnt_ids; - for (size_t k(0); k < n_ply; k++) + std::vector<std::size_t> ply_pnt_ids; + for (std::size_t k(0); k < n_ply; k++) { std::string ply_name; if (ply_vec->getNameOfElementByID(k, ply_name)) @@ -70,8 +70,8 @@ int main (int argc, char* argv[]) { std::cout << "found polyline " << ply_name << std::endl; GeoLib::Polyline const* ply (ply_vec->getElementByName(ply_name)); - const size_t n_ply_pnts (ply->getNumberOfPoints()); - for (size_t j(0); j < n_ply_pnts; j++) + const std::size_t n_ply_pnts (ply->getNumberOfPoints()); + for (std::size_t j(0); j < n_ply_pnts; j++) ply_pnt_ids.push_back (ply->getPointID(j)); } } @@ -88,7 +88,7 @@ int main (int argc, char* argv[]) if (gli_out && bc_out) { gli_out << "#POINTS" << "\n"; - for (size_t k(0); k < ply_pnt_ids.size(); k++) + for (std::size_t k(0); k < ply_pnt_ids.size(); k++) { gli_out << k << " " << *((*geo_pnts)[ply_pnt_ids[k]]) << " $NAME PLYPNT" << argv[2] << k << "\n"; diff --git a/Applications/Utils/FileConverter/generateBCandGLI.cpp b/Applications/Utils/FileConverter/generateBCandGLI.cpp index b8777c7ad70..d4437c253f4 100644 --- a/Applications/Utils/FileConverter/generateBCandGLI.cpp +++ b/Applications/Utils/FileConverter/generateBCandGLI.cpp @@ -54,10 +54,10 @@ int main (int argc, char* argv[]) std::cout << "could not found surfaces" << std::endl; return -1; } - const size_t n_sfc (sfc_vec->size()); + const std::size_t n_sfc (sfc_vec->size()); - std::vector<size_t> sfc_pnt_ids; - for (size_t k(0); k < n_sfc; k++) + std::vector<std::size_t> sfc_pnt_ids; + for (std::size_t k(0); k < n_sfc; k++) { std::string sfc_name; if (sfc_vec->getNameOfElementByID(k, sfc_name)) @@ -65,11 +65,11 @@ int main (int argc, char* argv[]) { std::cout << k << ": " << sfc_name << std::endl; GeoLib::Surface const* sfc (sfc_vec->getElementByName(sfc_name)); - const size_t n_triangles (sfc->getNTriangles()); - for (size_t j(0); j < n_triangles; j++) + const std::size_t n_triangles (sfc->getNTriangles()); + for (std::size_t j(0); j < n_triangles; j++) { GeoLib::Triangle const* tri ((*sfc)[j]); - for (size_t i(0); i < 3; i++) + for (std::size_t i(0); i < 3; i++) sfc_pnt_ids.push_back ((*tri)[i]); } } @@ -78,10 +78,10 @@ int main (int argc, char* argv[]) // make entries unique std::cout << "make points unique ... " << std::flush; std::sort (sfc_pnt_ids.begin(), sfc_pnt_ids.end()); - std::vector<size_t>::iterator it (sfc_pnt_ids.begin()); + std::vector<std::size_t>::iterator it (sfc_pnt_ids.begin()); while (it != sfc_pnt_ids.end()) { - std::vector<size_t>::iterator next (it); + std::vector<std::size_t>::iterator next (it); ++next; if (next != sfc_pnt_ids.end()) { @@ -103,7 +103,7 @@ int main (int argc, char* argv[]) if (gli_out && bc_out) { gli_out << "#POINTS" << "\n"; - for (size_t k(0); k < sfc_pnt_ids.size(); k++) + for (std::size_t k(0); k < sfc_pnt_ids.size(); k++) { gli_out << k << " " << *((*geo_pnts)[sfc_pnt_ids[k]]) << " $NAME " << k << "\n"; diff --git a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp index 55d4cfc1e6e..8b15779cadd 100644 --- a/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp +++ b/Applications/Utils/MeshEdit/CreateBoundaryConditionsAlongPolylines.cpp @@ -219,7 +219,7 @@ int main (int argc, char* argv[]) std::vector<GeoLib::Point*> const* merged_pnts(pnt_vec->getVector()); std::vector<GeoLib::Point> pnts_with_id; - const size_t n_merged_pnts(merged_pnts->size()); + const std::size_t n_merged_pnts(merged_pnts->size()); for(std::size_t k(0); k<n_merged_pnts; ++k) { pnts_with_id.emplace_back(*((*merged_pnts)[k]), k); } diff --git a/Applications/Utils/MeshEdit/NodeReordering.cpp b/Applications/Utils/MeshEdit/NodeReordering.cpp index 44c0c5b8c46..71ad6bb25d5 100644 --- a/Applications/Utils/MeshEdit/NodeReordering.cpp +++ b/Applications/Utils/MeshEdit/NodeReordering.cpp @@ -39,29 +39,29 @@ void reorderNodes(std::vector<MeshLib::Element*> &elements) switch (elements[i]->getGeomType()) { case MeshLib::MeshElemType::TETRAHEDRON: - for(size_t j = 0; j < 4; ++j) + for(std::size_t j = 0; j < 4; ++j) elements[i]->setNode(j, nodes[(j+1)%4]); break; case MeshLib::MeshElemType::PYRAMID: - for(size_t j = 0; j < 5; ++j) + for(std::size_t j = 0; j < 5; ++j) elements[i]->setNode(j, nodes[(j+1)%5]); break; case MeshLib::MeshElemType::PRISM: - for(size_t j = 0; j < 3; ++j) + for(std::size_t j = 0; j < 3; ++j) { elements[i]->setNode(j, nodes[j+3]); elements[i]->setNode(j+3, nodes[j]); } break; case MeshLib::MeshElemType::HEXAHEDRON: - for(size_t j = 0; j < 4; ++j) + for(std::size_t j = 0; j < 4; ++j) { elements[i]->setNode(j, nodes[j+4]); elements[i]->setNode(j+4, nodes[j]); } break; default: - for(size_t j = 0; j < nElemNodes; ++j) + for(std::size_t j = 0; j < nElemNodes; ++j) elements[i]->setNode(j, nodes[nElemNodes - j - 1]); } } @@ -76,10 +76,10 @@ void reorderNodes2(std::vector<MeshLib::Element*> &elements) const unsigned nElemNodes (elements[i]->getNBaseNodes()); std::vector<MeshLib::Node*> nodes(elements[i]->getNodes(), elements[i]->getNodes() + nElemNodes); - for(size_t j = 0; j < nElemNodes; ++j) + for(std::size_t j = 0; j < nElemNodes; ++j) if (elements[i]->getGeomType() == MeshLib::MeshElemType::PRISM) { - for(size_t j = 0; j < 3; ++j) + for(std::size_t j = 0; j < 3; ++j) { elements[i]->setNode(j, nodes[j+3]); elements[i]->setNode(j+3, nodes[j]); diff --git a/Applications/Utils/MeshEdit/moveMeshNodes.cpp b/Applications/Utils/MeshEdit/moveMeshNodes.cpp index 38be498f68e..84879cd68c9 100644 --- a/Applications/Utils/MeshEdit/moveMeshNodes.cpp +++ b/Applications/Utils/MeshEdit/moveMeshNodes.cpp @@ -64,7 +64,7 @@ int main (int argc, char* argv[]) std::cout << std::endl; std::cout << "Usage: " << argv[0] << " <msh-file.msh> <keyword> [<value1>] [<value2>]" << std::endl; std::cout << "Available keywords:" << std::endl; - //for (size_t i=0; i<keywords.size(); i++) + //for (std::size_t i=0; i<keywords.size(); i++) std::cout << "\t" << "-ALL <value1> <value2> : changes the elevation of all mesh nodes by <value2> in direction <value1> [x,y,z]." << std::endl; std::cout << "\t" << "-MESH <value1> <value2> : changes the elevation of mesh nodes based on a second mesh <value1> with a search range of <value2>." << std::endl; std::cout << "\t" << "-LOWPASS : applies a lowpass filter over node elevation using directly connected nodes." << std::endl; @@ -84,7 +84,7 @@ int main (int argc, char* argv[]) } bool is_keyword(false); - for (size_t i=0; i<keywords.size(); i++) + for (std::size_t i=0; i<keywords.size(); i++) if (current_key.compare(keywords[i])==0) { is_keyword = true; @@ -94,13 +94,13 @@ int main (int argc, char* argv[]) if (!is_keyword) { std::cout << "Keyword not recognised. Available keywords:" << std::endl; - for (size_t i=0; i<keywords.size(); i++) + for (std::size_t i=0; i<keywords.size(); i++) std::cout << keywords[i] << std::endl; return -1; } MeshLib::Mesh* mesh (FileIO::readMeshFromFile(msh_name)); - //std::vector<size_t> del_nodes; + //std::vector<std::size_t> del_nodes; // Start keyword-specific selection of nodes @@ -117,9 +117,9 @@ int main (int argc, char* argv[]) const double value(strtod(argv[4],0)); std::cout << "Moving all mesh nodes by " << value << " in direction " << idx << " (" << dir << ")..." << std::endl; //double value(-10); - const size_t nNodes(mesh->getNNodes()); + const std::size_t nNodes(mesh->getNNodes()); std::vector<MeshLib::Node*> nodes (mesh->getNodes()); - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) { (*nodes[i])[idx] += value; } @@ -144,10 +144,10 @@ int main (int argc, char* argv[]) MathLib::Point3d const& min(bounding_box.getMinPoint()); MathLib::Point3d const& max(bounding_box.getMaxPoint()); - const size_t nNodes(mesh->getNNodes()); + const std::size_t nNodes(mesh->getNNodes()); std::vector<MeshLib::Node*> nodes (mesh->getNodes()); - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) { bool is_inside (containsPoint(*nodes[i], min, max)); if (is_inside) @@ -163,24 +163,24 @@ int main (int argc, char* argv[]) // weighted by 2 and the elevation of each connected node weighted by 1 if (current_key.compare("-LOWPASS")==0) { - const size_t nNodes(mesh->getNNodes()); + const std::size_t nNodes(mesh->getNNodes()); std::vector<MeshLib::Node*> nodes (mesh->getNodes()); std::vector<double> elevation(nNodes); - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) elevation[i] = (*nodes[i])[2]; - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) { const std::vector<MeshLib::Node*> conn_nodes (nodes[i]->getConnectedNodes()); const unsigned nConnNodes (conn_nodes.size()); elevation[i] = (2*(*nodes[i])[2]); - for (size_t j=0; j<nConnNodes; ++j) + for (std::size_t j=0; j<nConnNodes; ++j) elevation[i] += (*conn_nodes[j])[2]; elevation[i] /= (nConnNodes+2); } - for (size_t i=0; i<nNodes; i++) + for (std::size_t i=0; i<nNodes; i++) (*nodes[i])[2] = elevation[i]; } /**** add other keywords here ****/ diff --git a/BaseLib/DateTools.cpp b/BaseLib/DateTools.cpp index a48976ec9fc..d42cdf73ece 100644 --- a/BaseLib/DateTools.cpp +++ b/BaseLib/DateTools.cpp @@ -93,9 +93,9 @@ int strDate2int(const std::string &s) std::string str(s); if (s.length() > 10) str = s.substr(0,10); - size_t sep ( str.find(".",0) ); + std::size_t sep ( str.find(".",0) ); int d ( atoi(str.substr(0, sep).c_str()) ); - size_t sep2 ( str.find(".", sep + 1) ); + std::size_t sep2 ( str.find(".", sep + 1) ); int m ( atoi(str.substr(sep + 1,sep2 - (sep + 1)).c_str()) ); int y ( atoi(str.substr(sep2 + 1, s.length() - (sep2 + 1)).c_str()) ); return date2int(y, m, d); diff --git a/BaseLib/FileTools.cpp b/BaseLib/FileTools.cpp index 821ea0f9263..f1524006e11 100644 --- a/BaseLib/FileTools.cpp +++ b/BaseLib/FileTools.cpp @@ -65,7 +65,7 @@ void truncateFile( std::string const& filename) * found. */ static -size_t findLastPathSeparator(std::string const& path) +std::size_t findLastPathSeparator(std::string const& path) { return path.find_last_of("/\\"); } @@ -74,7 +74,7 @@ size_t findLastPathSeparator(std::string const& path) * This could be used to extract file extension. */ static -size_t findLastDot(std::string const& path) +std::size_t findLastDot(std::string const& path) { return path.find_last_of("."); } @@ -82,12 +82,12 @@ size_t findLastDot(std::string const& path) std::string dropFileExtension(std::string const& filename) { // Look for dots in filename. - const size_t p = findLastDot(filename); + const std::size_t p = findLastDot(filename); if (p == std::string::npos) return filename; // Check position of the last path separator. - const size_t s = findLastPathSeparator(filename); + const std::size_t s = findLastPathSeparator(filename); if (s != std::string::npos && p < s) return filename; @@ -96,7 +96,7 @@ std::string dropFileExtension(std::string const& filename) std::string extractBaseName(std::string const& pathname) { - const size_t p = findLastPathSeparator(pathname); + const std::size_t p = findLastPathSeparator(pathname); return pathname.substr(p + 1); } @@ -109,7 +109,7 @@ std::string extractBaseNameWithoutExtension(std::string const& pathname) std::string getFileExtension(const std::string &path) { const std::string str = extractBaseName(path); - const size_t p = findLastDot(str); + const std::size_t p = findLastDot(str); if (p == std::string::npos) return std::string(); return str.substr(p + 1); @@ -124,7 +124,7 @@ std::string copyPathToFileName(const std::string &file_name, const std::string &source) { // check if file_name already contains a full path - const size_t pos = findLastPathSeparator(file_name); + const std::size_t pos = findLastPathSeparator(file_name); if (pos != std::string::npos) return file_name; @@ -133,7 +133,7 @@ std::string copyPathToFileName(const std::string &file_name, std::string extractPath(std::string const& pathname) { - const size_t pos = findLastPathSeparator(pathname); + const std::size_t pos = findLastPathSeparator(pathname); return pathname.substr(0, pos + 1); } } // end namespace BaseLib diff --git a/BaseLib/Histogram.h b/BaseLib/Histogram.h index 3df0f8f38ef..6dea4c4f4ac 100644 --- a/BaseLib/Histogram.h +++ b/BaseLib/Histogram.h @@ -143,11 +143,11 @@ public: out << "# Histogram for parameter " << param_name << " of data set " << data_set_name << "\n"; std::size_t const n_bins = this->getNrBins(); - std::vector<size_t> const& bin_cnts(this->getBinCounts()); + std::vector<std::size_t> const& bin_cnts(this->getBinCounts()); double const min (this->getMinimum()); double const bin_width (this->getBinWidth()); - for (size_t k(0); k < n_bins; k++) + for (std::size_t k(0); k < n_bins; k++) out << min+k*bin_width << " " << bin_cnts[k] << "\n"; out.close (); return 0; diff --git a/BaseLib/StringTools.cpp b/BaseLib/StringTools.cpp index 26b6ba3d127..0da26d250c0 100644 --- a/BaseLib/StringTools.cpp +++ b/BaseLib/StringTools.cpp @@ -83,7 +83,7 @@ std::string propertyTreeToString(boost::property_tree::ptree const& tree) } // end namespace BaseLib #ifdef MSVC -void correctScientificNotation(std::string filename, size_t precision) +void correctScientificNotation(std::string filename, std::size_t precision) { std::ifstream stream; std::ofstream outputStream; @@ -125,7 +125,7 @@ void correctScientificNotation(std::string filename, size_t precision) while (!isdigit(word[i])) --i; - size_t erasePos = wordSize - 3 - (wordSize - 1 - i); + std::size_t erasePos = wordSize - 3 - (wordSize - 1 - i); std::string eraseString = word.substr(erasePos, 1); if (eraseString.find("0") != std::string::npos) word.erase(erasePos, 1); diff --git a/FileIO/AsciiRasterInterface.cpp b/FileIO/AsciiRasterInterface.cpp index ebc7f8f54f0..4374cbddb71 100644 --- a/FileIO/AsciiRasterInterface.cpp +++ b/FileIO/AsciiRasterInterface.cpp @@ -51,8 +51,8 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromASCFile(std::string const& fn std::string s; // read the data into the double-array for (std::size_t j(0); j < n_rows; ++j) { - const size_t idx ((n_rows - j - 1) * n_cols); - for (size_t i(0); i < n_cols; ++i) { + const std::size_t idx ((n_rows - j - 1) * n_cols); + for (std::size_t i(0); i < n_cols; ++i) { in >> s; values[idx+i] = strtod(BaseLib::replaceString(",", ".", s).c_str(),0); @@ -132,10 +132,10 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromSurferFile(std::string const& double* values = new double[n_cols*n_rows]; std::string s; // read the data into the double-array - for (size_t j(0); j < n_rows; ++j) + for (std::size_t j(0); j < n_rows; ++j) { - const size_t idx (j * n_cols); - for (size_t i(0); i < n_cols; ++i) + const std::size_t idx (j * n_cols); + for (std::size_t i(0); i < n_cols; ++i) { in >> s; const double val (strtod(BaseLib::replaceString(",", ".", s).c_str(),0)); @@ -153,7 +153,7 @@ GeoLib::Raster* AsciiRasterInterface::getRasterFromSurferFile(std::string const& } } -bool AsciiRasterInterface::readSurferHeader(std::ifstream &in, size_t &n_cols, std::size_t &n_rows, +bool AsciiRasterInterface::readSurferHeader(std::ifstream &in, std::size_t &n_cols, std::size_t &n_rows, double &xllcorner, double &yllcorner, double &cell_size, double &min, double &max) { std::string tag; diff --git a/FileIO/AsciiRasterInterface.h b/FileIO/AsciiRasterInterface.h index ee82a8e0589..866e97f20d0 100644 --- a/FileIO/AsciiRasterInterface.h +++ b/FileIO/AsciiRasterInterface.h @@ -49,7 +49,7 @@ private: double &no_data_val); /// Reads the header of a Surfer grd-file. - static bool readSurferHeader(std::ifstream &in, size_t &n_cols, std::size_t &n_rows, + static bool readSurferHeader(std::ifstream &in, std::size_t &n_cols, std::size_t &n_rows, double &xllcorner, double &yllcorner, double &cell_size, double &min, double &max); }; diff --git a/FileIO/FEFLOWInterface.cpp b/FileIO/FEFLOWInterface.cpp index 4101c680a03..93bc929061e 100644 --- a/FileIO/FEFLOWInterface.cpp +++ b/FileIO/FEFLOWInterface.cpp @@ -74,7 +74,7 @@ MeshLib::Mesh* FEFLOWInterface::readFEFLOWFile(const std::string &filename) // create node pointers with dummy coordinates to create element objects. // True coordinates are set later in COOR and ELEV_I. vec_nodes.resize(fem_dim.n_nodes); - size_t count = 0; + std::size_t count = 0; double dummy_coords[3] = {}; std::generate(vec_nodes.begin(), vec_nodes.end(), [&]() { return new MeshLib::Node(dummy_coords, count++); }); line_stream.clear(); @@ -107,7 +107,7 @@ MeshLib::Mesh* FEFLOWInterface::readFEFLOWFile(const std::string &filename) } vec_elements.reserve(fem_dim.n_elements); - for (size_t i=0; i<fem_dim.n_elements; i++) + for (std::size_t i=0; i<fem_dim.n_elements; i++) { getline(in, line_string); vec_elements.push_back(readElement(fem_dim, eleType, line_string, vec_nodes)); @@ -201,10 +201,10 @@ MeshLib::Mesh* FEFLOWInterface::readFEFLOWFile(const std::string &filename) void FEFLOWInterface::readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes) { - const size_t no_nodes_per_layer = (fem_class.dimension == 2) ? fem_dim.n_nodes : fem_dim.n_nodes / (fem_class.n_layers3d + 1); + const std::size_t no_nodes_per_layer = (fem_class.dimension == 2) ? fem_dim.n_nodes : fem_dim.n_nodes / (fem_class.n_layers3d + 1); assert(no_nodes_per_layer>0); - const size_t n_lines = (no_nodes_per_layer-1) / 12 + 1; - const size_t n_layers = (fem_class.dimension == 3) ? fem_class.n_layers3d + 1 : 1; + const std::size_t n_lines = (no_nodes_per_layer-1) / 12 + 1; + const std::size_t n_layers = (fem_class.dimension == 3) ? fem_class.n_layers3d + 1 : 1; std::string line_string; std::stringstream line_stream; double x; @@ -213,7 +213,7 @@ void FEFLOWInterface::readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fe for (unsigned k = 0; k < 2; k++) { // each line - for (size_t i = 0; i < n_lines; i++) + for (std::size_t i = 0; i < n_lines; i++) { getline(in, line_string); line_stream.str(line_string); @@ -222,9 +222,9 @@ void FEFLOWInterface::readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fe if (i * 12 + j >= no_nodes_per_layer) break; line_stream >> x >> dummy_char; - for (size_t l = 0; l < n_layers; l++) + for (std::size_t l = 0; l < n_layers; l++) { - const size_t n = i * 12 + l * no_nodes_per_layer + j; + const std::size_t n = i * 12 + l * no_nodes_per_layer + j; MeshLib::Node* m_nod = vec_nodes[n]; if (k == 0) (*m_nod)[0] = x; @@ -237,9 +237,9 @@ void FEFLOWInterface::readNodeCoordinates(std::ifstream &in, const FEM_CLASS &fe } } -std::vector<size_t> FEFLOWInterface::getIndexList(const std::string &str_ranges) +std::vector<std::size_t> FEFLOWInterface::getIndexList(const std::string &str_ranges) { - std::vector<size_t> vec_node_IDs; + std::vector<std::size_t> vec_node_IDs; // insert space before and after minus for splitting std::string str_ranges2(BaseLib::replaceString("-", " # ", str_ranges)); @@ -252,14 +252,14 @@ std::vector<size_t> FEFLOWInterface::getIndexList(const std::string &str_ranges) if (str[0]=='#') { is_range = true; } else if (is_range) { - const size_t start = vec_node_IDs.back(); - const size_t end = BaseLib::str2number<size_t>(str); - for (size_t i=start+1; i<end+1; i++) + const std::size_t start = vec_node_IDs.back(); + const std::size_t end = BaseLib::str2number<std::size_t>(str); + for (std::size_t i=start+1; i<end+1; i++) vec_node_IDs.push_back(i); is_range = false; } else { BaseLib::trim(str); - vec_node_IDs.push_back(BaseLib::str2number<size_t>(str)); + vec_node_IDs.push_back(BaseLib::str2number<std::size_t>(str)); } } @@ -268,12 +268,12 @@ std::vector<size_t> FEFLOWInterface::getIndexList(const std::string &str_ranges) void FEFLOWInterface::readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes) { - const size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1); + const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1); double z = .0; std::string str_nodeList; std::string line_string; std::stringstream line_stream; - size_t l = 0; + std::size_t l = 0; unsigned mode = 0; // 0: exit, 1: slice no, 2: elevation value, 3: continued line of mode 2 int pos_prev_line = 0; while (true) @@ -300,7 +300,7 @@ void FEFLOWInterface::readElevation(std::ifstream &in, const FEM_CLASS &fem_clas auto vec_nodeIDs = getIndexList(str_nodeList); for (auto n0 : vec_nodeIDs) { - const size_t n = n0 - 1 + l * no_nodes_per_layer; + const std::size_t n = n0 - 1 + l * no_nodes_per_layer; (*vec_nodes[n])[2] = z; } str_nodeList.clear(); @@ -311,7 +311,7 @@ void FEFLOWInterface::readElevation(std::ifstream &in, const FEM_CLASS &fem_clas } else if (mode == 1) { // slice number l++; - assert(l+1==BaseLib::str2number<size_t>(columns.front())); + assert(l+1==BaseLib::str2number<std::size_t>(columns.front())); } else if (mode == 2) { // parse current line line_stream.str(line_string); @@ -338,7 +338,7 @@ MeshLib::Element* FEFLOWInterface::readElement(const FEM_DIM &fem_dim, std::stringstream ss(line); unsigned idx[8]; - for (size_t i = 0; i < fem_dim.n_nodes_of_element; ++i) + for (std::size_t i = 0; i < fem_dim.n_nodes_of_element; ++i) ss >> idx[i]; MeshLib::Node** ele_nodes = new MeshLib::Node*[fem_dim.n_nodes_of_element]; @@ -392,7 +392,7 @@ void FEFLOWInterface::readPoints(QDomElement &nodesEle, const std::string &tag, BaseLib::trim(line_str, ' '); if (line_str.empty()) continue; std::istringstream line_ss(line_str); - size_t pt_id = 0; + std::size_t pt_id = 0; std::array<double,3> pt_xyz; line_ss >> pt_id; for (int i = 0; i < dim; i++) @@ -537,13 +537,13 @@ void FEFLOWInterface::readSuperMesh(std::ifstream &in, const FEM_CLASS &fem_clas if (xmlEle.isNull()) continue; const QString str = xmlEle.attribute("count"); - const size_t n_points = str.toLong(); + const std::size_t n_points = str.toLong(); QString str_ptId_list = xmlEle.text().simplified(); { GeoLib::Polyline* line = new GeoLib::Polyline(*points); lines->push_back(line); std::istringstream ss(str_ptId_list.toStdString()); - for (size_t i = 0; i < n_points; i++) + for (std::size_t i = 0; i < n_points; i++) { int pt_id = 0; ss >> pt_id; @@ -565,12 +565,12 @@ void FEFLOWInterface::setMaterialID(const FEM_CLASS &fem_class, const FEM_DIM &f vec_elements[eid-1]->setValue(matid); // Element IDs given by FEFLOW starts from one! } } else if (lines && !lines->empty()) { - for (size_t i = 0; i < vec_elements.size(); i++) + for (std::size_t i = 0; i < vec_elements.size(); i++) { MeshLib::Element* e = vec_elements[i]; const MeshLib::Node gpt = e->getCenterOfGravity(); - size_t matId = 0; - for (size_t j = 0; j < lines->size(); j++) + std::size_t matId = 0; + for (std::size_t j = 0; j < lines->size(); j++) { GeoLib::Polyline* poly = (*lines)[j]; if (!poly->isClosed()) @@ -586,13 +586,13 @@ void FEFLOWInterface::setMaterialID(const FEM_CLASS &fem_class, const FEM_DIM &f e->setValue(matId); } } else if (fem_class.n_layers3d>0) { - const size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1); + const std::size_t no_nodes_per_layer = fem_dim.n_nodes / (fem_class.n_layers3d + 1); for (auto* e : vec_elements) { unsigned e_min_nodeID = std::numeric_limits<unsigned>::max(); - for (size_t i=0; i<e->getNBaseNodes(); i++) + for (std::size_t i=0; i<e->getNBaseNodes(); i++) e_min_nodeID = std::min(e_min_nodeID, e->getNodeIndex(i)); - size_t layer_id = e_min_nodeID / no_nodes_per_layer; + std::size_t layer_id = e_min_nodeID / no_nodes_per_layer; e->setValue(layer_id); } } diff --git a/FileIO/FEFLOWInterface.h b/FileIO/FEFLOWInterface.h index f80e101b22f..55101d24bfc 100644 --- a/FileIO/FEFLOWInterface.h +++ b/FileIO/FEFLOWInterface.h @@ -88,10 +88,10 @@ private: // DIMENSION struct FEM_DIM { - size_t n_nodes; - size_t n_elements; - size_t obs; - size_t np_cor; + std::size_t n_nodes; + std::size_t n_elements; + std::size_t obs; + std::size_t np_cor; unsigned n_nodes_of_element; unsigned n_steps; unsigned icrank; @@ -136,7 +136,7 @@ private: void readElevation(std::ifstream &in, const FEM_CLASS &fem_class, const FEM_DIM &fem_dim, std::vector<MeshLib::Node*> &vec_nodes); //// parse node lists - std::vector<size_t> getIndexList(const std::string &str_ranges); + std::vector<std::size_t> getIndexList(const std::string &str_ranges); /// parse ELEMENTALSETS void readELEMENTALSETS(std::ifstream &in, std::vector<std::vector<std::size_t>> &vec_elementsets); diff --git a/FileIO/GmshIO/GMSHPoint.cpp b/FileIO/GmshIO/GMSHPoint.cpp index 9ba30933319..672f42a7069 100644 --- a/FileIO/GmshIO/GMSHPoint.cpp +++ b/FileIO/GmshIO/GMSHPoint.cpp @@ -21,7 +21,7 @@ namespace FileIO { namespace GMSH { -GMSHPoint::GMSHPoint(GeoLib::Point const& pnt, size_t id, double mesh_density) : +GMSHPoint::GMSHPoint(GeoLib::Point const& pnt, std::size_t id, double mesh_density) : GeoLib::Point(pnt, id), _mesh_density(mesh_density) {} diff --git a/FileIO/GmshIO/GMSHPolygonTree.cpp b/FileIO/GmshIO/GMSHPolygonTree.cpp index 72e254a1fe0..bf9105b2a46 100644 --- a/FileIO/GmshIO/GMSHPolygonTree.cpp +++ b/FileIO/GmshIO/GMSHPolygonTree.cpp @@ -71,12 +71,12 @@ void GMSHPolygonTree::insertPolyline (GeoLib::PolylineWithSegmentMarker * ply) // calculate possible intersection points // pay attention: loop bound is not fix! - size_t n_segments (ply->getNumberOfPoints()-1); + std::size_t n_segments (ply->getNumberOfPoints()-1); GeoLib::Point tmp_pnt; GeoLib::PointVec & pnt_vec(*(_geo_objs.getPointVecObj(_geo_name))); - for (size_t k(0); k<n_segments; k++) { + for (std::size_t k(0); k<n_segments; k++) { if (! ply->isSegmentMarked(k)) { - size_t seg_num(0); + std::size_t seg_num(0); GeoLib::Point *intersection_pnt(new GeoLib::Point); while (_node_polygon->getNextIntersectionPointPolygonLine(*(ply->getPoint(k)), *(ply->getPoint(k+1)), intersection_pnt, seg_num)) { // insert the intersection point to point vector of GEOObjects instance @@ -101,10 +101,10 @@ void GMSHPolygonTree::insertPolyline (GeoLib::PolylineWithSegmentMarker * ply) } } - size_t tmp_seg_num(seg_num+1); + std::size_t tmp_seg_num(seg_num+1); if (! _node_polygon->getNextIntersectionPointPolygonLine(*(ply->getPoint(k)), *(ply->getPoint(k+1)), &tmp_pnt, tmp_seg_num)) { // check a point of the segment except the end points - for (size_t i(0); i<3; i++) { + for (std::size_t i(0); i<3; i++) { tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2; } if (_node_polygon->isPntInPolygon(tmp_pnt)) { @@ -118,7 +118,7 @@ void GMSHPolygonTree::insertPolyline (GeoLib::PolylineWithSegmentMarker * ply) } // check a point of the segment except the end points - for (size_t i(0); i<3; i++) { + for (std::size_t i(0); i<3; i++) { tmp_pnt[i] = ((*(ply->getPoint(k)))[i] + (*(ply->getPoint(k+1)))[i]) / 2; } if (_node_polygon->isPntInPolygon(tmp_pnt)) { @@ -136,16 +136,16 @@ void GMSHPolygonTree::initMeshDensityStrategy() if (dynamic_cast<GMSHAdaptiveMeshDensity*> (_mesh_density_strategy)) { // collect points std::vector<GeoLib::Point const*> pnts; - const size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); - for (size_t k(0); k<n_pnts_polygon; k++) { + const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); + for (std::size_t k(0); k<n_pnts_polygon; k++) { pnts.push_back(_node_polygon->getPoint(k)); } getPointsFromSubPolygons(pnts); - const size_t n_plys (_plys.size()); - for (size_t k(0); k<n_plys; k++) { - const size_t n_pnts_in_kth_ply(_plys[k]->getNumberOfPoints()); - for (size_t j(0); j<n_pnts_in_kth_ply; j++) { + const std::size_t n_plys (_plys.size()); + for (std::size_t k(0); k<n_plys; k++) { + const std::size_t n_pnts_in_kth_ply(_plys[k]->getNumberOfPoints()); + for (std::size_t j(0); j<n_pnts_in_kth_ply; j++) { pnts.push_back(_plys[k]->getPoint(j)); } } @@ -162,19 +162,19 @@ void GMSHPolygonTree::initMeshDensityStrategy() void GMSHPolygonTree::createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & gmsh_pnts) const { - const size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); - for (size_t k(0); k<n_pnts_polygon; k++) { - const size_t id (_node_polygon->getPointID(k)); + const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); + for (std::size_t k(0); k<n_pnts_polygon; k++) { + const std::size_t id (_node_polygon->getPointID(k)); GeoLib::Point const*const pnt(_node_polygon->getPoint(k)); gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt)); } - const size_t n_plys(_plys.size()); - for (size_t k(0); k<n_plys; k++) { - const size_t n_pnts_in_ply(_plys[k]->getNumberOfPoints()); - for (size_t j(0); j<n_pnts_in_ply; j++) { + const std::size_t n_plys(_plys.size()); + for (std::size_t k(0); k<n_plys; k++) { + const std::size_t n_pnts_in_ply(_plys[k]->getNumberOfPoints()); + for (std::size_t j(0); j<n_pnts_in_ply; j++) { if (_node_polygon->isPntInPolygon(*(_plys[k]->getPoint(j)))) { - const size_t id (_plys[k]->getPointID(j)); + const std::size_t id (_plys[k]->getPointID(j)); GeoLib::Point const*const pnt(_plys[k]->getPoint(j)); gmsh_pnts[id] = new GMSHPoint(*pnt, id, _mesh_density_strategy->getMeshDensityAtPoint(pnt)); } @@ -187,17 +187,17 @@ void GMSHPolygonTree::createGMSHPoints(std::vector<FileIO::GMSH::GMSHPoint*> & g } } -void GMSHPolygonTree::writeLineLoop(size_t &line_offset, size_t &sfc_offset, std::ostream& out) const +void GMSHPolygonTree::writeLineLoop(std::size_t &line_offset, std::size_t &sfc_offset, std::ostream& out) const { - const size_t n_pnts (_node_polygon->getNumberOfPoints()); - size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id; - for (size_t k(1); k<n_pnts; k++) { + const std::size_t n_pnts (_node_polygon->getNumberOfPoints()); + std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id; + for (std::size_t k(1); k<n_pnts; k++) { second_pnt_id = _node_polygon->getPointID(k); out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n"; first_pnt_id = second_pnt_id; } out << "Line Loop(" << line_offset + n_pnts-1 << ") = {"; - for (size_t k(0); k<n_pnts - 2; k++) { + for (std::size_t k(0); k<n_pnts - 2; k++) { out << line_offset+k << ","; } out << line_offset+n_pnts-2 << "};\n"; @@ -206,13 +206,13 @@ void GMSHPolygonTree::writeLineLoop(size_t &line_offset, size_t &sfc_offset, std sfc_offset++; } -void GMSHPolygonTree::writeLineConstraints(size_t &line_offset, size_t sfc_number, std::ostream& out) const +void GMSHPolygonTree::writeLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const { - const size_t n_plys (_plys.size()); - for (size_t j(0); j<n_plys; j++) { - const size_t n_pnts(_plys[j]->getNumberOfPoints()); - size_t first_pnt_id(_plys[j]->getPointID(0)), second_pnt_id; - for (size_t k(1); k<n_pnts; k++) { + const std::size_t n_plys (_plys.size()); + for (std::size_t j(0); j<n_plys; j++) { + const std::size_t n_pnts(_plys[j]->getNumberOfPoints()); + std::size_t first_pnt_id(_plys[j]->getPointID(0)), second_pnt_id; + for (std::size_t k(1); k<n_pnts; k++) { second_pnt_id = _plys[j]->getPointID(k); if (_plys[j]->isSegmentMarked(k-1) && _node_polygon->isPntInPolygon(*(_plys[j]->getPoint(k)))) { out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n"; @@ -224,16 +224,16 @@ void GMSHPolygonTree::writeLineConstraints(size_t &line_offset, size_t sfc_numbe } } -void GMSHPolygonTree::writeSubPolygonsAsLineConstraints(size_t &line_offset, size_t sfc_number, std::ostream& out) const +void GMSHPolygonTree::writeSubPolygonsAsLineConstraints(std::size_t &line_offset, std::size_t sfc_number, std::ostream& out) const { for (std::list<SimplePolygonTree*>::const_iterator it (_childs.begin()); it != _childs.end(); ++it) { dynamic_cast<GMSHPolygonTree*>((*it))->writeSubPolygonsAsLineConstraints(line_offset, sfc_number, out); } if (_parent != NULL) { - const size_t n_pnts(_node_polygon->getNumberOfPoints()); - size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id; - for (size_t k(1); k<n_pnts; k++) { + const std::size_t n_pnts(_node_polygon->getNumberOfPoints()); + std::size_t first_pnt_id(_node_polygon->getPointID(0)), second_pnt_id; + for (std::size_t k(1); k<n_pnts; k++) { second_pnt_id = _node_polygon->getPointID(k); out << "Line(" << line_offset + k-1 << ") = {" << first_pnt_id << "," << second_pnt_id << "};\n"; first_pnt_id = second_pnt_id; @@ -244,10 +244,10 @@ void GMSHPolygonTree::writeSubPolygonsAsLineConstraints(size_t &line_offset, siz } -void GMSHPolygonTree::writeStations(size_t & pnt_id_offset, size_t sfc_number, std::ostream& out) const +void GMSHPolygonTree::writeStations(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const { - const size_t n_stations(_stations.size()); - for (size_t k(0); k<n_stations; k++) { + const std::size_t n_stations(_stations.size()); + for (std::size_t k(0); k<n_stations; k++) { out << "Point(" << pnt_id_offset + k << ") = {" << (*(_stations[k]))[0] << "," << (*(_stations[k]))[1] << ", 0.0, "; out << _mesh_density_strategy->getMeshDensityAtPoint(_stations[k]) << "};\n"; out << "Point { " << pnt_id_offset + k << " } In Surface { " << sfc_number << " };\n"; @@ -255,13 +255,13 @@ void GMSHPolygonTree::writeStations(size_t & pnt_id_offset, size_t sfc_number, s pnt_id_offset += n_stations; } -void GMSHPolygonTree::writeAdditionalPointData(size_t & pnt_id_offset, size_t sfc_number, std::ostream& out) const +void GMSHPolygonTree::writeAdditionalPointData(std::size_t & pnt_id_offset, std::size_t sfc_number, std::ostream& out) const { if (dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)) { std::vector<GeoLib::Point*> steiner_pnts; dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getSteinerPoints(steiner_pnts, 0); - const size_t n(steiner_pnts.size()); - for (size_t k(0); k<n; k++) { + const std::size_t n(steiner_pnts.size()); + for (std::size_t k(0); k<n; k++) { if (_node_polygon->isPntInPolygon(*(steiner_pnts[k]))) { out << "Point(" << pnt_id_offset + k << ") = {" << (*(steiner_pnts[k]))[0] << "," << (*(steiner_pnts[k]))[1] << ", 0.0, "; out << _mesh_density_strategy->getMeshDensityAtPoint(steiner_pnts[k]) << "};\n"; @@ -279,9 +279,9 @@ void GMSHPolygonTree::writeAdditionalPointData(size_t & pnt_id_offset, size_t sf dynamic_cast<GMSHAdaptiveMeshDensity*>(_mesh_density_strategy)->getQuadTreeGeometry(*pnts, *plys); std::string quad_tree_geo("QuadTree"); _geo_objs.addPointVec(pnts, quad_tree_geo); - std::vector<size_t> const& id_map ((_geo_objs.getPointVecObj(quad_tree_geo))->getIDMap()); - for (size_t k(0); k<plys->size(); k++) { - for (size_t j(0); j<(*plys)[k]->getNumberOfPoints(); j++) { + std::vector<std::size_t> const& id_map ((_geo_objs.getPointVecObj(quad_tree_geo))->getIDMap()); + for (std::size_t k(0); k<plys->size(); k++) { + for (std::size_t j(0); j<(*plys)[k]->getNumberOfPoints(); j++) { ((*plys)[k])->setPointID(j, id_map[((*plys)[k])->getPointID(j)]); } } @@ -293,8 +293,8 @@ void GMSHPolygonTree::writeAdditionalPointData(size_t & pnt_id_offset, size_t sf void GMSHPolygonTree::getPointsFromSubPolygons(std::vector<GeoLib::Point const*>& pnts) { - const size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); - for (size_t k(0); k<n_pnts_polygon; k++) { + const std::size_t n_pnts_polygon (_node_polygon->getNumberOfPoints()); + for (std::size_t k(0); k<n_pnts_polygon; k++) { pnts.push_back(_node_polygon->getPoint(k)); } @@ -305,8 +305,8 @@ void GMSHPolygonTree::getPointsFromSubPolygons(std::vector<GeoLib::Point const*> void GMSHPolygonTree::getStationsInsideSubPolygons(std::vector<GeoLib::Point const*>& stations) { - const size_t n_stations(_stations.size()); - for (size_t k(0); k<n_stations; k++) { + const std::size_t n_stations(_stations.size()); + for (std::size_t k(0); k<n_stations; k++) { stations.push_back(_stations[k]); } diff --git a/FileIO/Legacy/MeshIO.cpp b/FileIO/Legacy/MeshIO.cpp index f40098436ad..0328ce6bae7 100644 --- a/FileIO/Legacy/MeshIO.cpp +++ b/FileIO/Legacy/MeshIO.cpp @@ -269,9 +269,9 @@ bool MeshIO::write() << " NO_PCS\n" << "$NODES\n" << " "; - const size_t n_nodes(_mesh->getNNodes()); + const std::size_t n_nodes(_mesh->getNNodes()); _out << n_nodes << "\n"; - for (size_t i(0); i < n_nodes; ++i) { + for (std::size_t i(0); i < n_nodes; ++i) { _out << i << " " << *(_mesh->getNode(i)) << "\n"; } @@ -296,10 +296,10 @@ void MeshIO::writeElements(std::vector<MeshLib::Element*> const& ele_vec, boost::optional<MeshLib::PropertyVector<int> const&> material_ids, std::ostream &out) const { - const size_t ele_vector_size (ele_vec.size()); + const std::size_t ele_vector_size (ele_vec.size()); out << ele_vector_size << "\n"; - for (size_t i(0); i < ele_vector_size; ++i) { + for (std::size_t i(0); i < ele_vector_size; ++i) { out << i << " "; if (! material_ids) out << "0 "; @@ -307,7 +307,7 @@ void MeshIO::writeElements(std::vector<MeshLib::Element*> const& ele_vec, out << (*material_ids)[i] << " "; out << this->ElemType2StringOutput(ele_vec[i]->getGeomType()) << " "; unsigned nElemNodes (ele_vec[i]->getNBaseNodes()); - for(size_t j = 0; j < nElemNodes; ++j) + for(std::size_t j = 0; j < nElemNodes; ++j) out << ele_vec[i]->getNode(j)->getID() << " "; out << "\n"; } diff --git a/FileIO/PetrelInterface.cpp b/FileIO/PetrelInterface.cpp index 263086f2353..7787e5f3aa6 100644 --- a/FileIO/PetrelInterface.cpp +++ b/FileIO/PetrelInterface.cpp @@ -98,7 +98,7 @@ void PetrelInterface::readPetrelSurface(std::istream &in) } // read points - size_t idx(pnt_vec->size()); + std::size_t idx(pnt_vec->size()); while (in) { pnt_vec->push_back(new GeoLib::Point); diff --git a/FileIO/RapidXmlIO/RapidStnInterface.cpp b/FileIO/RapidXmlIO/RapidStnInterface.cpp index fcc9c28e643..79786b48028 100644 --- a/FileIO/RapidXmlIO/RapidStnInterface.cpp +++ b/FileIO/RapidXmlIO/RapidStnInterface.cpp @@ -37,7 +37,7 @@ std::vector<GeoLib::Point*> *RapidStnInterface::readStationFile(const std::strin // buffer file in.seekg(0, std::ios::end); - size_t length = in.tellg(); + std::size_t length = in.tellg(); in.seekg(0, std::ios::beg); char* buffer = new char[length+1]; in.read(buffer, length); @@ -90,7 +90,7 @@ int RapidStnInterface::rapidReadFile(const std::string &fileName) // buffer file in.seekg(0, std::ios::end); - size_t length = in.tellg(); + std::size_t length = in.tellg(); in.seekg(0, std::ios::beg); char* buffer = new char[length+1]; in.read(buffer, length); diff --git a/FileIO/TetGenInterface.cpp b/FileIO/TetGenInterface.cpp index 6feaa5a8bd4..8ca6d5f9f65 100644 --- a/FileIO/TetGenInterface.cpp +++ b/FileIO/TetGenInterface.cpp @@ -112,9 +112,9 @@ std::size_t TetGenInterface::getNFacets(std::ifstream &input) const std::list<std::string> fields = BaseLib::splitString(line, ' '); std::list<std::string>::const_iterator it = fields.begin(); - const std::size_t nFacets (BaseLib::str2number<size_t> (*it)); + const std::size_t nFacets (BaseLib::str2number<std::size_t> (*it)); if (fields.size() > 1) - _boundary_markers = (BaseLib::str2number<size_t> (*(++it)) == 0) ? false : true; + _boundary_markers = (BaseLib::str2number<std::size_t> (*(++it)) == 0) ? false : true; return nFacets; } return 0; @@ -239,7 +239,7 @@ bool TetGenInterface::readNodesFromStream (std::ifstream &ins, { std::string line; getline (ins, line); - size_t n_nodes, dim, n_attributes; + std::size_t n_nodes, dim, n_attributes; bool boundary_markers; while (!ins.fail()) @@ -275,8 +275,8 @@ bool TetGenInterface::parseNodesFileHeader(std::string &line, return false; } auto it = pnt_header.begin(); - n_nodes = BaseLib::str2number<size_t> (*it); - dim = (pnt_header.size()==1) ? 3 : BaseLib::str2number<size_t> (*(++it)); + n_nodes = BaseLib::str2number<std::size_t> (*it); + dim = (pnt_header.size()==1) ? 3 : BaseLib::str2number<std::size_t> (*(++it)); if (pnt_header.size()<4) { @@ -285,7 +285,7 @@ bool TetGenInterface::parseNodesFileHeader(std::string &line, return true; } - n_attributes = BaseLib::str2number<size_t> (*(++it)); + n_attributes = BaseLib::str2number<std::size_t> (*(++it)); boundary_markers = ((++it)->compare("1") == 0) ? true : false; return true; @@ -321,7 +321,7 @@ bool TetGenInterface::parseNodes(std::ifstream &ins, } if (pos_beg != std::string::npos && pos_end != std::string::npos) { - id = BaseLib::str2number<size_t> (line.substr(pos_beg, pos_end - pos_beg)); + id = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg)); if (k == 0 && id == 0) _zero_based_idx = true; } else { @@ -393,7 +393,7 @@ bool TetGenInterface::parseElementsFileHeader(std::string &line, pos_beg = line.find_first_not_of (" "); pos_end = line.find_first_of(" ", pos_beg); if (pos_beg != std::string::npos && pos_end != std::string::npos) - n_tets = BaseLib::str2number<size_t> (line.substr(pos_beg, pos_end - pos_beg)); + n_tets = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg)); else { ERR("TetGenInterface::parseElementsFileHeader(): Could not read number of tetrahedra specified in header."); return false; @@ -401,7 +401,7 @@ bool TetGenInterface::parseElementsFileHeader(std::string &line, // nodes per tet - either 4 or 10 pos_beg = line.find_first_not_of (" \t", pos_end); pos_end = line.find_first_of(" \t", pos_beg); - n_nodes_per_tet = BaseLib::str2number<size_t> (line.substr(pos_beg, pos_end - pos_beg)); + n_nodes_per_tet = BaseLib::str2number<std::size_t> (line.substr(pos_beg, pos_end - pos_beg)); // region attribute at tetrahedra? pos_beg = line.find_first_not_of (" \t", pos_end); pos_end = line.find_first_of(" \t\n", pos_beg); @@ -423,7 +423,7 @@ bool TetGenInterface::parseElements(std::ifstream& ins, bool region_attribute) const { std::string line; - std::size_t* ids (static_cast<size_t*>(alloca (sizeof (size_t) * n_nodes_per_tet))); + std::size_t* ids (static_cast<std::size_t*>(alloca (sizeof (std::size_t) * n_nodes_per_tet))); elements.reserve(n_tets); const unsigned offset = (_zero_based_idx) ? 0 : 1; diff --git a/FileIO/XmlIO/Qt/XmlStnInterface.cpp b/FileIO/XmlIO/Qt/XmlStnInterface.cpp index 346dab6dab2..4e67afe15d5 100644 --- a/FileIO/XmlIO/Qt/XmlStnInterface.cpp +++ b/FileIO/XmlIO/Qt/XmlStnInterface.cpp @@ -228,8 +228,8 @@ bool XmlStnInterface::write() bool useStationValue(false); double sValue = static_cast<GeoLib::Station*>((*stations)[0])->getStationValue(); - size_t nStations(stations->size()); - for (size_t i = 1; i < nStations; i++) + std::size_t nStations(stations->size()); + for (std::size_t i = 1; i < nStations; i++) if ((static_cast<GeoLib::Station*>((*stations)[i])->getStationValue() - sValue) < std::numeric_limits<double>::epsilon()) { @@ -237,7 +237,7 @@ bool XmlStnInterface::write() break; } - for (size_t i = 0; i < nStations; i++) + for (std::size_t i = 0; i < nStations; i++) { QString stationType = (isBorehole) ? "borehole" : "station"; QDomElement stationTag = doc.createElement(stationType); @@ -292,14 +292,14 @@ void XmlStnInterface::writeBoreholeData(QDomDocument &doc, std::vector<GeoLib::Point*> profile = borehole->getProfile(); std::vector<std::string> soilNames = borehole->getSoilNames(); - size_t nHorizons(profile.size()); + std::size_t nHorizons(profile.size()); if (nHorizons > 1) { QDomElement stratTag = doc.createElement("strat"); boreholeTag.appendChild(stratTag); - for (size_t j = 1; j < nHorizons; j++) /// the first entry in the profile vector is just the position of the borehole + for (std::size_t j = 1; j < nHorizons; j++) /// the first entry in the profile vector is just the position of the borehole { QDomElement horizonTag = doc.createElement("horizon"); horizonTag.setAttribute( "id", QString::number(j) ); @@ -327,7 +327,7 @@ int XmlStnInterface::rapidReadFile(const std::string &fileName) // buffer file in.seekg(0, std::ios::end); - size_t length = in.tellg(); + std::size_t length = in.tellg(); in.seekg(0, std::ios::beg); char* buffer = new char[length + 1]; in.read(buffer, length); diff --git a/GeoLib/Surface.cpp b/GeoLib/Surface.cpp index 61b19471114..b731921ab35 100644 --- a/GeoLib/Surface.cpp +++ b/GeoLib/Surface.cpp @@ -54,7 +54,7 @@ void Surface::addTriangle(std::size_t pnt_a, std::size_t pnt_b, std::size_t pnt_ _sfc_triangles.push_back(new Triangle(_sfc_pnts, pnt_a, pnt_b, pnt_c)); if (!_bounding_volume) { - std::vector<size_t> ids(3); + std::vector<std::size_t> ids(3); ids[0] = pnt_a; ids[1] = pnt_b; ids[2] = pnt_c; diff --git a/MathLib/LinAlg/PETSc/PETScVector.h b/MathLib/LinAlg/PETSc/PETScVector.h index ec93c6c9cff..b940d0d861b 100644 --- a/MathLib/LinAlg/PETSc/PETScVector.h +++ b/MathLib/LinAlg/PETSc/PETScVector.h @@ -118,7 +118,7 @@ class PETScVector /*! Add values to several entries \param e_idxs Indicies of entries to be added - Note: size_t cannot be the type of e_idxs template argument + Note: std::size_t cannot be the type of e_idxs template argument \param sub_vec Entries to be added */ template<class T_SUBVEC> void add(const std::vector<PetscInt> &e_idxs, @@ -130,7 +130,7 @@ class PETScVector /*! Add values to several entries \param e_idxs Indicies of entries to be added. - Note: size_t cannot be the type of e_idxs template argument + Note: std::size_t cannot be the type of e_idxs template argument \param sub_vec Entries to be added */ template<class T_SUBVEC> void set(const std::vector<PetscInt> &e_idxs, @@ -142,7 +142,7 @@ class PETScVector /*! Get several entries \param e_idxs Indicies of entries to be gotten. - Note: size_t cannot be the type of e_idxs template argument + Note: std::size_t cannot be the type of e_idxs template argument \param sub_vec Values of entries */ template<class T_SUBVEC> void get(const std::vector<PetscInt> &e_idxs, diff --git a/MeshGeoToolsLib/GeoMapper.cpp b/MeshGeoToolsLib/GeoMapper.cpp index 03162c325a0..7c390a38166 100644 --- a/MeshGeoToolsLib/GeoMapper.cpp +++ b/MeshGeoToolsLib/GeoMapper.cpp @@ -298,7 +298,7 @@ void GeoMapper::advancedMapOnMesh(const MeshLib::Mesh* mesh, const std::string & } this->_geo_objects.addPointVec(new_points, const_cast<std::string&>(new_geo_name)); - std::vector<size_t> pnt_id_map = this->_geo_objects.getPointVecObj(new_geo_name)->getIDMap(); + std::vector<std::size_t> pnt_id_map = this->_geo_objects.getPointVecObj(new_geo_name)->getIDMap(); for (std::size_t i=0; i<new_lines->size(); ++i) (*new_lines)[i]->updatePointIDs(pnt_id_map); this->_geo_objects.addPolylineVec(new_lines, new_geo_name); @@ -357,11 +357,11 @@ double GeoMapper::getMaxSegmentLength(const std::vector<GeoLib::Polyline*> &line { double max_segment_length (0); const std::size_t nPlys ( lines.size() ); - for (size_t i=0; i<nPlys; ++i) + for (std::size_t i=0; i<nPlys; ++i) { const GeoLib::Polyline* line = lines[i]; const std::size_t nPlyPoints = line->getNumberOfPoints(); - for (size_t j=1; j<nPlyPoints; ++j) + for (std::size_t j=1; j<nPlyPoints; ++j) { const double dist (line->getLength(j)-line->getLength(j-1)); if (dist>max_segment_length) diff --git a/MeshLib/Mesh.cpp b/MeshLib/Mesh.cpp index 7bb32943cb7..d67bfccf6d3 100644 --- a/MeshLib/Mesh.cpp +++ b/MeshLib/Mesh.cpp @@ -61,15 +61,15 @@ Mesh::Mesh(const Mesh &mesh) _properties(mesh._properties) { const std::vector<Node*> nodes (mesh.getNodes()); - const size_t nNodes (nodes.size()); + const std::size_t nNodes (nodes.size()); for (unsigned i=0; i<nNodes; ++i) _nodes[i] = new Node(*nodes[i]); const std::vector<Element*> elements (mesh.getElements()); - const size_t nElements (elements.size()); + const std::size_t nElements (elements.size()); for (unsigned i=0; i<nElements; ++i) { - const size_t nElemNodes = elements[i]->getNBaseNodes(); + const std::size_t nElemNodes = elements[i]->getNBaseNodes(); _elements[i] = elements[i]->clone(); for (unsigned j=0; j<nElemNodes; ++j) _elements[i]->_nodes[j] = _nodes[elements[i]->getNode(j)->getID()]; @@ -84,12 +84,12 @@ Mesh::Mesh(const Mesh &mesh) Mesh::~Mesh() { - const size_t nElements (_elements.size()); - for (size_t i=0; i<nElements; ++i) + const std::size_t nElements (_elements.size()); + for (std::size_t i=0; i<nElements; ++i) delete _elements[i]; - const size_t nNodes (_nodes.size()); - for (size_t i=0; i<nNodes; ++i) + const std::size_t nNodes (_nodes.size()); + for (std::size_t i=0; i<nNodes; ++i) delete _nodes[i]; } @@ -110,21 +110,21 @@ void Mesh::addElement(Element* elem) void Mesh::resetNodeIDs() { - const size_t nNodes (this->_nodes.size()); + const std::size_t nNodes (this->_nodes.size()); for (unsigned i=0; i<nNodes; ++i) _nodes[i]->setID(i); } void Mesh::resetElementIDs() { - const size_t nElements (this->_elements.size()); + const std::size_t nElements (this->_elements.size()); for (unsigned i=0; i<nElements; ++i) _elements[i]->setID(i); } void Mesh::setDimension() { - const size_t nElements (_elements.size()); + const std::size_t nElements (_elements.size()); for (unsigned i=0; i<nElements; ++i) if (_elements[i]->getDimension() > _mesh_dimension) _mesh_dimension = _elements[i]->getDimension(); @@ -190,7 +190,7 @@ void Mesh::setElementNeighbors() // create vector with all elements connected to current element (includes lots of doubles!) Element *const element = *it; - const size_t nNodes (element->getNBaseNodes()); + const std::size_t nNodes (element->getNBaseNodes()); for (unsigned n(0); n<nNodes; ++n) { std::vector<Element*> const& conn_elems ((element->getNode(n)->getElements())); @@ -213,13 +213,13 @@ void Mesh::setElementNeighbors() void Mesh::setNodesConnectedByEdges() { - const size_t nNodes (this->_nodes.size()); + const std::size_t nNodes (this->_nodes.size()); for (unsigned i=0; i<nNodes; ++i) { MeshLib::Node* node (_nodes[i]); std::vector<MeshLib::Node*> conn_set; const std::vector<MeshLib::Element*> &conn_elems (node->getElements()); - const size_t nConnElems (conn_elems.size()); + const std::size_t nConnElems (conn_elems.size()); for (unsigned j=0; j<nConnElems; ++j) { const unsigned idx (conn_elems[j]->getNodeIDinElement(node)); @@ -227,7 +227,7 @@ void Mesh::setNodesConnectedByEdges() for (unsigned k(0); k<nElemNodes; ++k) { bool is_in_vector (false); - const size_t nConnNodes (conn_set.size()); + const std::size_t nConnNodes (conn_set.size()); for (unsigned l(0); l<nConnNodes; ++l) if (conn_elems[j]->getNode(k) == conn_set[l]) is_in_vector = true; diff --git a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp index 2bbd4ba30da..b0778b23891 100644 --- a/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp +++ b/MeshLib/MeshEditing/Mesh2MeshPropertyInterpolation.cpp @@ -74,8 +74,8 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes GeoLib::Grid<MeshLib::Node> src_grid(src_nodes.begin(), src_nodes.end(), 64); std::vector<MeshLib::Element*> const& dest_elements(dest_mesh->getElements()); - const size_t n_dest_elements(dest_elements.size()); - for (size_t k(0); k<n_dest_elements; k++) { + const std::size_t n_dest_elements(dest_elements.size()); + for (std::size_t k(0); k<n_dest_elements; k++) { // compute axis aligned bounding box around the current element const GeoLib::AABB<MeshLib::Node> elem_aabb(dest_elements[k]->getNodes(), dest_elements[k]->getNodes()+dest_elements[k]->getNBaseNodes()); @@ -83,13 +83,13 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes std::vector<std::vector<MeshLib::Node*> const*> nodes; src_grid.getPntVecsOfGridCellsIntersectingCuboid(elem_aabb.getMinPoint(), elem_aabb.getMaxPoint(), nodes); - size_t cnt(0); + std::size_t cnt(0); dest_properties[k] = 0.0; - for (size_t i(0); i<nodes.size(); ++i) { + for (std::size_t i(0); i<nodes.size(); ++i) { std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]); - const size_t n_nodes_in_vec(i_th_vec->size()); - for (size_t j(0); j<n_nodes_in_vec; j++) { + const std::size_t n_nodes_in_vec(i_th_vec->size()); + for (std::size_t j(0); j<n_nodes_in_vec; j++) { MeshLib::Node const*const j_th_node((*i_th_vec)[j]); if (elem_aabb.containsPoint(*j_th_node)) { if (dest_elements[k]->isPntInElement(*j_th_node, 30)) { @@ -119,11 +119,11 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes std::string source_fname(base_name + "-SourceNodes.gli"); std::ofstream out_src(source_fname.c_str()); out_src << "#POINTS" << "\n"; - size_t nodes_cnt(0); - for (size_t i(0); i<nodes.size(); ++i) { + std::size_t nodes_cnt(0); + for (std::size_t i(0); i<nodes.size(); ++i) { std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]); - const size_t n_nodes_in_vec(i_th_vec->size()); - for (size_t j(0); j<n_nodes_in_vec; j++) { + const std::size_t n_nodes_in_vec(i_th_vec->size()); + for (std::size_t j(0); j<n_nodes_in_vec; j++) { MeshLib::Node const*const j_th_node((*i_th_vec)[j]); out_src << nodes_cnt << " " << *(dynamic_cast<GeoLib::Point const*>(j_th_node)) << "\n"; nodes_cnt++; @@ -139,12 +139,12 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes void Mesh2MeshPropertyInterpolation::interpolateElementPropertiesToNodeProperties(std::vector<double> &interpolated_node_properties) const { std::vector<MeshLib::Node*> const& src_nodes(_src_mesh->getNodes()); - const size_t n_src_nodes(src_nodes.size()); + const std::size_t n_src_nodes(src_nodes.size()); - for (size_t k(0); k<n_src_nodes; k++) { - const size_t n_con_elems (src_nodes[k]->getNElements()); + for (std::size_t k(0); k<n_src_nodes; k++) { + const std::size_t n_con_elems (src_nodes[k]->getNElements()); interpolated_node_properties[k] = (*_src_properties)[(src_nodes[k]->getElement(0))->getValue()]; - for (size_t j(1); j<n_con_elems; j++) { + for (std::size_t j(1); j<n_con_elems; j++) { interpolated_node_properties[k] += (*_src_properties)[(src_nodes[k]->getElement(j))->getValue()]; } interpolated_node_properties[k] /= n_con_elems; diff --git a/MeshLib/MeshGenerators/ConvertRasterToMesh.cpp b/MeshLib/MeshGenerators/ConvertRasterToMesh.cpp index e9e9894b536..15dba953f23 100644 --- a/MeshLib/MeshGenerators/ConvertRasterToMesh.cpp +++ b/MeshLib/MeshGenerators/ConvertRasterToMesh.cpp @@ -29,9 +29,9 @@ ConvertRasterToMesh::~ConvertRasterToMesh() MeshLib::Mesh* ConvertRasterToMesh::execute() const { - const size_t height(_raster.getNRows()+1); - const size_t width(_raster.getNCols()+1); - const size_t size(height*width); + const std::size_t height(_raster.getNRows()+1); + const std::size_t width(_raster.getNCols()+1); + const std::size_t size(height*width); double* pix_vals(new double[size]); bool* vis_nodes(new bool[size]); @@ -39,15 +39,15 @@ MeshLib::Mesh* ConvertRasterToMesh::execute() const double substitution(getExistingValue(_raster.begin(), _raster.end())); // fill first row with non visual nodes - for (size_t j = 0; j < _raster.getNCols(); j++) { + for (std::size_t j = 0; j < _raster.getNCols(); j++) { pix_vals[j] = 0; vis_nodes[j] = false; } GeoLib::Raster::const_iterator raster_it(_raster.begin()); - for (size_t i = 0; i < _raster.getNRows(); ++i) { - for (size_t j = 0; j < _raster.getNCols(); ++j) { - const size_t index = (i+1) * width + j; + for (std::size_t i = 0; i < _raster.getNRows(); ++i) { + for (std::size_t j = 0; j < _raster.getNCols(); ++j) { + const std::size_t index = (i+1) * width + j; if (*raster_it == _raster.getNoDataValue()) { pix_vals[index] = substitution; vis_nodes[index] = false; @@ -72,23 +72,23 @@ MeshLib::Mesh* ConvertRasterToMesh::execute() const MeshLib::Mesh* ConvertRasterToMesh::constructMesh(const double* pix_vals, const bool* vis_nodes) const { - const size_t height = _raster.getNRows()+1; - const size_t width = _raster.getNCols()+1; - size_t node_idx_count(0); + const std::size_t height = _raster.getNRows()+1; + const std::size_t width = _raster.getNCols()+1; + std::size_t node_idx_count(0); const double distance(_raster.getRasterPixelSize()); const double x_offset(_raster.getOrigin()[0]); // - distance / 2.0); const double y_offset(_raster.getOrigin()[1]); // - distance / 2.0); - const size_t size(height*width); + const std::size_t size(height*width); int* node_idx_map(new int[size]); for (std::size_t k(0); k<size; ++k) node_idx_map[k] = -1; std::vector<MeshLib::Node*> nodes; std::vector<MeshLib::Element*> elements; - for (size_t i = 0; i < height; i++) { - for (size_t j = 0; j < width; j++) { - const size_t index = i * width + j; + for (std::size_t i = 0; i < height; i++) { + for (std::size_t j = 0; j < width; j++) { + const std::size_t index = i * width + j; // bool set_node(true); // bool set_node(false); @@ -113,8 +113,8 @@ MeshLib::Mesh* ConvertRasterToMesh::constructMesh(const double* pix_vals, const } // set mesh elements - for (size_t i = 0; i < _raster.getNRows(); i++) { - for (size_t j = 0; j < _raster.getNCols(); j++) { + for (std::size_t i = 0; i < _raster.getNRows(); i++) { + for (std::size_t j = 0; j < _raster.getNCols(); j++) { const int index = i * width + j; if ((node_idx_map[index] != -1) && (node_idx_map[index + 1] != -1) && (node_idx_map[index + width] != -1) diff --git a/MeshLib/MeshGenerators/MeshLayerMapper.cpp b/MeshLib/MeshGenerators/MeshLayerMapper.cpp index abb51389e21..3c3c5a5debd 100644 --- a/MeshLib/MeshGenerators/MeshLayerMapper.cpp +++ b/MeshLib/MeshGenerators/MeshLayerMapper.cpp @@ -242,7 +242,7 @@ bool MeshLayerMapper::layerMapping(MeshLib::Mesh &new_mesh, GeoLib::Raster const const std::pair<double, double> xDim(x0, x0 + raster.getNCols() * delta); // extension in x-dimension const std::pair<double, double> yDim(y0, y0 + raster.getNRows() * delta); // extension in y-dimension - const size_t nNodes (new_mesh.getNNodes()); + const std::size_t nNodes (new_mesh.getNNodes()); const std::vector<MeshLib::Node*> &nodes = new_mesh.getNodes(); for (unsigned i = 0; i < nNodes; ++i) { diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.cpp b/MeshLib/MeshGenerators/VtkMeshConverter.cpp index d3d884c1060..6abaa526f37 100644 --- a/MeshLib/MeshGenerators/VtkMeshConverter.cpp +++ b/MeshLib/MeshGenerators/VtkMeshConverter.cpp @@ -69,26 +69,26 @@ MeshLib::Mesh* VtkMeshConverter::convertImgToMesh(vtkImageData* img, return nullptr; } - const size_t imgHeight = dims[0]; - const size_t imgWidth = dims[1]; - const size_t incHeight = imgHeight+1; - const size_t incWidth = imgWidth+1; + const std::size_t imgHeight = dims[0]; + const std::size_t imgWidth = dims[1]; + const std::size_t incHeight = imgHeight+1; + const std::size_t incWidth = imgWidth+1; double* pixVal (new double[incHeight * incWidth]); bool* visNodes(new bool[incWidth * incHeight]); int* node_idx_map(new int[incWidth * incHeight]); - for (size_t j = 0; j < incHeight; j++) + for (std::size_t j = 0; j < incHeight; j++) { pixVal[j]=0; visNodes[j]=false; node_idx_map[j]=-1; } - for (size_t i = 0; i < imgWidth; i++) + for (std::size_t i = 0; i < imgWidth; i++) { - for (size_t j = 0; j < imgHeight; j++) + for (std::size_t j = 0; j < imgHeight; j++) { - const size_t img_idx = i * imgHeight + j; - const size_t index = (i+1) * incHeight + j; + const std::size_t img_idx = i * imgHeight + j; + const std::size_t index = (i+1) * incHeight + j; double* colour = pixelData->GetTuple(img_idx); if (nTuple < 3) // Grey (+ Alpha) pixVal[index] = colour[0]; @@ -119,32 +119,32 @@ MeshLib::Mesh* VtkMeshConverter::convertImgToMesh(vtkImageData* img, MeshLib::Mesh* VtkMeshConverter::convertImgToMesh(const double* img, const double origin[3], - const size_t imgHeight, - const size_t imgWidth, + const std::size_t imgHeight, + const std::size_t imgWidth, const double &scalingFactor, MeshElemType elem_type, UseIntensityAs intensity_type) { - const size_t incHeight = imgHeight+1; - const size_t incWidth = imgWidth+1; + const std::size_t incHeight = imgHeight+1; + const std::size_t incWidth = imgWidth+1; double* pixVal (new double[incHeight * incWidth]); bool* visNodes(new bool[incWidth * incHeight]); int* node_idx_map(new int[incWidth * incHeight]); double noDataValue = getExistingValue(img, imgWidth*imgHeight); - for (size_t j = 0; j < imgHeight; j++) + for (std::size_t j = 0; j < imgHeight; j++) { pixVal[j]=0; visNodes[j]=false; node_idx_map[j]=-1; } - for (size_t i = 0; i < imgWidth; i++) + for (std::size_t i = 0; i < imgWidth; i++) { - for (size_t j = 0; j < imgHeight; j++) + for (std::size_t j = 0; j < imgHeight; j++) { - const size_t img_idx = i * imgHeight + j; - const size_t index = (i+1) * incHeight + j; + const std::size_t img_idx = i * imgHeight + j; + const std::size_t index = (i+1) * incHeight + j; if (img[img_idx] == -9999) { visNodes[index] = false; @@ -176,25 +176,25 @@ MeshLib::Mesh* VtkMeshConverter::constructMesh(const double* pixVal, int* node_idx_map, const bool* visNodes, const double origin[3], - const size_t &imgHeight, - const size_t &imgWidth, + const std::size_t &imgHeight, + const std::size_t &imgWidth, const double &scalingFactor, MeshElemType elem_type, UseIntensityAs intensity_type) { - const size_t incHeight = imgHeight+1; - const size_t incWidth = imgWidth+1; - size_t node_idx_count(0); + const std::size_t incHeight = imgHeight+1; + const std::size_t incWidth = imgWidth+1; + std::size_t node_idx_count(0); const double x_offset(origin[0] - scalingFactor/2.0); const double y_offset(origin[1] - scalingFactor/2.0); std::vector<MeshLib::Node*> nodes; std::vector<MeshLib::Element*> elements; - for (size_t i = 0; i < incWidth; i++) - for (size_t j = 0; j < incHeight; j++) + for (std::size_t i = 0; i < incWidth; i++) + for (std::size_t j = 0; j < incHeight; j++) { - const size_t index = i * incHeight + j; + const std::size_t index = i * incHeight + j; bool set_node (false); if (j==0 && i==imgWidth) set_node = visNodes[index]; @@ -217,8 +217,8 @@ MeshLib::Mesh* VtkMeshConverter::constructMesh(const double* pixVal, properties.createNewPropertyVector<double>("Colour", MeshLib::MeshItemType::Cell, 1); // set mesh elements - for (size_t i = 0; i < imgWidth; i++) - for (size_t j = 0; j < imgHeight; j++) + for (std::size_t i = 0; i < imgWidth; i++) + for (std::size_t j = 0; j < imgHeight; j++) { int const index = i * incHeight + j; if ((node_idx_map[index]!=-1) && (node_idx_map[index+1]!=-1) && (node_idx_map[index+incHeight]!=-1) && (node_idx_map[index+incHeight+1]!=-1) && (visNodes[index+incHeight])) @@ -276,21 +276,21 @@ MeshLib::Mesh* VtkMeshConverter::convertUnstructuredGrid(vtkUnstructuredGrid* gr return nullptr; // set mesh nodes - const size_t nNodes = grid->GetPoints()->GetNumberOfPoints(); + const std::size_t nNodes = grid->GetPoints()->GetNumberOfPoints(); std::vector<MeshLib::Node*> nodes(nNodes); double* coords = nullptr; - for (size_t i = 0; i < nNodes; i++) + for (std::size_t i = 0; i < nNodes; i++) { coords = grid->GetPoints()->GetPoint(i); nodes[i] = new MeshLib::Node(coords[0], coords[1], coords[2]); } // set mesh elements - const size_t nElems = grid->GetNumberOfCells(); + const std::size_t nElems = grid->GetNumberOfCells(); std::vector<MeshLib::Element*> elements(nElems); vtkDataArray* scalars = grid->GetCellData()->GetScalars("MaterialIDs"); auto node_ids = vtkSmartPointer<vtkIdList>::New(); - for (size_t i = 0; i < nElems; i++) + for (std::size_t i = 0; i < nElems; i++) { MeshLib::Element* elem; grid->GetCellPoints(i, node_ids); @@ -457,9 +457,9 @@ void VtkMeshConverter::convertArray(vtkDataArray &array, MeshLib::Properties &pr return; } -double VtkMeshConverter::getExistingValue(const double* img, size_t length) +double VtkMeshConverter::getExistingValue(const double* img, std::size_t length) { - for (size_t i=0; i<length; i++) + for (std::size_t i=0; i<length; i++) { if (img[i] != -9999) return img[i]; diff --git a/MeshLib/MeshQuality/AngleSkewMetric.cpp b/MeshLib/MeshQuality/AngleSkewMetric.cpp index 47621587d83..91222cfdad3 100644 --- a/MeshLib/MeshQuality/AngleSkewMetric.cpp +++ b/MeshLib/MeshQuality/AngleSkewMetric.cpp @@ -35,9 +35,9 @@ AngleSkewMetric::~AngleSkewMetric() void AngleSkewMetric::calculateQuality () { const std::vector<MeshLib::Element*>& elements(_mesh.getElements()); - const size_t nElements (_mesh.getNElements()); + const std::size_t nElements (_mesh.getNElements()); - for (size_t k(0); k < nElements; k++) + for (std::size_t k(0); k < nElements; k++) { Element const& elem (*elements[k]); switch (elem.getGeomType()) diff --git a/MeshLib/MeshQuality/EdgeRatioMetric.cpp b/MeshLib/MeshQuality/EdgeRatioMetric.cpp index 278dfaf83af..582dbd74988 100644 --- a/MeshLib/MeshQuality/EdgeRatioMetric.cpp +++ b/MeshLib/MeshQuality/EdgeRatioMetric.cpp @@ -28,8 +28,8 @@ void EdgeRatioMetric::calculateQuality() { // get all elements of mesh const std::vector<MeshLib::Element*>& elements(_mesh.getElements()); - const size_t nElements (_mesh.getNElements()); - for (size_t k(0); k < nElements; k++) + const std::size_t nElements (_mesh.getNElements()); + for (std::size_t k(0); k < nElements; k++) { Element const& elem (*elements[k]); switch (elem.getGeomType()) @@ -51,21 +51,21 @@ void EdgeRatioMetric::calculateQuality() } case MeshElemType::PRISM: { std::vector<const MathLib::Point3d*> pnts; - for (size_t j(0); j < 6; j++) + for (std::size_t j(0); j < 6; j++) pnts.push_back(elem.getNode(j)); _element_quality_metric[k] = checkPrism(pnts); break; } case MeshElemType::PYRAMID: { std::vector<const MathLib::Point3d*> pnts; - for (size_t j(0); j < 5; j++) + for (std::size_t j(0); j < 5; j++) pnts.push_back(elem.getNode(j)); _element_quality_metric[k] = checkPyramid(pnts); break; } case MeshElemType::HEXAHEDRON: { std::vector<const MathLib::Point3d*> pnts; - for (size_t j(0); j < 8; j++) + for (std::size_t j(0); j < 8; j++) pnts.push_back(elem.getNode(j)); _element_quality_metric[k] = checkHexahedron(pnts); break; @@ -122,8 +122,8 @@ double EdgeRatioMetric::checkQuad (MathLib::Point3d const& a, MathLib::sqrDist (a,d)}; // sort lengths - since this is a very small array we use bubble sort - for (size_t i(0); i < 4; i++) - for (size_t j(i + 1); j < 4; j++) + for (std::size_t i(0); i < 4; i++) + for (std::size_t j(i + 1); j < 4; j++) if (sqr_lengths[i] >= sqr_lengths[j]) std::swap (sqr_lengths[i], sqr_lengths[j]); @@ -140,8 +140,8 @@ double EdgeRatioMetric::checkTetrahedron (MathLib::Point3d const& a, MathLib::sqrDist (b,d), MathLib::sqrDist (c,d)}; // sort lengths - since this is a very small array we use bubble sort - for (size_t i(0); i < 6; i++) - for (size_t j(i + 1); j < 6; j++) + for (std::size_t i(0); i < 6; i++) + for (std::size_t j(i + 1); j < 6; j++) if (sqr_lengths[i] >= sqr_lengths[j]) std::swap (sqr_lengths[i], sqr_lengths[j]); @@ -161,8 +161,8 @@ double EdgeRatioMetric::checkPrism (std::vector<const MathLib::Point3d*> const& MathLib::sqrDist (*pnts[2],*pnts[5])}; // sort lengths - since this is a very small array we use bubble sort - for (size_t i(0); i < 9; i++) - for (size_t j(i + 1); j < 9; j++) + for (std::size_t i(0); i < 9; i++) + for (std::size_t j(i + 1); j < 9; j++) if (sqr_lengths[i] >= sqr_lengths[j]) std::swap (sqr_lengths[i], sqr_lengths[j]); @@ -181,8 +181,8 @@ double EdgeRatioMetric::checkPyramid (std::vector<const MathLib::Point3d*> const MathLib::sqrDist (*pnts[3],*pnts[4])}; // sort lengths - since this is a very small array we use bubble sort - for (size_t i(0); i < 8; i++) - for (size_t j(i + 1); j < 8; j++) + for (std::size_t i(0); i < 8; i++) + for (std::size_t j(i + 1); j < 8; j++) if (sqr_lengths[i] >= sqr_lengths[j]) std::swap (sqr_lengths[i], sqr_lengths[j]); @@ -205,8 +205,8 @@ double EdgeRatioMetric::checkHexahedron (std::vector<const MathLib::Point3d*> co MathLib::sqrDist (*pnts[3],*pnts[7])}; // sort lengths - since this is a very small array we use bubble sort - for (size_t i(0); i < 12; i++) - for (size_t j(i + 1); j < 12; j++) + for (std::size_t i(0); i < 12; i++) + for (std::size_t j(i + 1); j < 12; j++) if (sqr_lengths[i] >= sqr_lengths[j]) std::swap (sqr_lengths[i], sqr_lengths[j]); diff --git a/MeshLib/MeshQuality/ElementQualityInterface.h b/MeshLib/MeshQuality/ElementQualityInterface.h index c89be611771..0513000f940 100644 --- a/MeshLib/MeshQuality/ElementQualityInterface.h +++ b/MeshLib/MeshQuality/ElementQualityInterface.h @@ -64,7 +64,7 @@ public: BaseLib::Histogram<double> getHistogram(std::size_t n_bins = 0) const { if (_quality_tester) - return _quality_tester->getHistogram(static_cast<size_t>(n_bins)); + return _quality_tester->getHistogram(static_cast<std::size_t>(n_bins)); std::vector<double> empty_quality_vec(0); return empty_quality_vec; diff --git a/MeshLib/MeshQuality/ElementQualityMetric.cpp b/MeshLib/MeshQuality/ElementQualityMetric.cpp index 0c9faf0aefc..2c043cbae80 100644 --- a/MeshLib/MeshQuality/ElementQualityMetric.cpp +++ b/MeshLib/MeshQuality/ElementQualityMetric.cpp @@ -28,19 +28,19 @@ ElementQualityMetric::ElementQualityMetric(Mesh const& mesh) : _element_quality_metric.resize (_mesh.getNElements(), -1.0); } -BaseLib::Histogram<double> ElementQualityMetric::getHistogram (size_t n_bins) const +BaseLib::Histogram<double> ElementQualityMetric::getHistogram (std::size_t n_bins) const { if (n_bins == 0) - n_bins = static_cast<size_t>(1 + 3.3 * log (static_cast<float>((_mesh.getNElements())))); + n_bins = static_cast<std::size_t>(1 + 3.3 * log (static_cast<float>((_mesh.getNElements())))); return BaseLib::Histogram<double>(getElementQuality(), n_bins, true); } -void ElementQualityMetric::errorMsg (Element const& elem, size_t idx) const +void ElementQualityMetric::errorMsg (Element const& elem, std::size_t idx) const { ERR ("Error in MeshQualityChecker::check() - Calculated value of element is below double precision minimum."); ERR ("Points of %s-Element %d: ", MeshElemType2String(elem.getGeomType()).c_str(), idx); - for (size_t i(0); i < elem.getNBaseNodes(); i++) + for (std::size_t i(0); i < elem.getNBaseNodes(); i++) { const double* coords = elem.getNode(i)->getCoords(); ERR ("\t Node %d: (%f, %f, %f)", i, coords[0], coords[1], coords[2]); diff --git a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp index 0f047e0a596..fc0e38ab844 100644 --- a/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp +++ b/MeshLib/MeshQuality/RadiusEdgeRatioMetric.cpp @@ -27,8 +27,8 @@ RadiusEdgeRatioMetric::RadiusEdgeRatioMetric(Mesh const& mesh) void RadiusEdgeRatioMetric::calculateQuality () { std::vector<MeshLib::Element*> const& elements(_mesh.getElements()); - size_t const nElements (_mesh.getNElements()); - for (size_t k(0); k < nElements; k++) + std::size_t const nElements (_mesh.getNElements()); + for (std::size_t k(0); k < nElements; k++) { Element const& elem (*elements[k]); std::size_t const n_nodes (elem.getNBaseNodes()); diff --git a/MeshLib/MeshSearch/NodeSearch.cpp b/MeshLib/MeshSearch/NodeSearch.cpp index cd5587d0531..0146b1beeb8 100644 --- a/MeshLib/MeshSearch/NodeSearch.cpp +++ b/MeshLib/MeshSearch/NodeSearch.cpp @@ -57,7 +57,7 @@ std::size_t NodeSearch::searchNodesConnectedToOnlyGivenElements( std::size_t NodeSearch::searchUnused() { - const size_t nNodes (_mesh.getNNodes()); + const std::size_t nNodes (_mesh.getNNodes()); const std::vector<MeshLib::Node*> &nodes (_mesh.getNodes()); std::vector<std::size_t> del_node_idx; diff --git a/MeshLib/Node.cpp b/MeshLib/Node.cpp index 5ed8cb02e9b..3c1dc259f87 100644 --- a/MeshLib/Node.cpp +++ b/MeshLib/Node.cpp @@ -48,7 +48,7 @@ void Node::updateCoordinates(double x, double y, double z) _x[1] = y; _x[2] = z; - const size_t nElements (this->_elements.size()); + const std::size_t nElements (this->_elements.size()); for (std::size_t i=0; i<nElements; i++) _elements[i]->computeVolume(); } diff --git a/SimpleTests/MatrixTests/MatMult.cpp b/SimpleTests/MatrixTests/MatMult.cpp index deb46e7c1ab..4302e9ac3dc 100644 --- a/SimpleTests/MatrixTests/MatMult.cpp +++ b/SimpleTests/MatrixTests/MatMult.cpp @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) BaseLib::CPUTime cpu_timer; run_timer.start(); cpu_timer.start(); - for (size_t k(0); k<n_mults; k++) { + for (std::size_t k(0); k<n_mults; k++) { mat.amux (1.0, x, y); } diff --git a/SimpleTests/MatrixTests/MatVecMultNDPerm.cpp b/SimpleTests/MatrixTests/MatVecMultNDPerm.cpp index f28dfb07643..1ef4b559b9c 100644 --- a/SimpleTests/MatrixTests/MatVecMultNDPerm.cpp +++ b/SimpleTests/MatrixTests/MatVecMultNDPerm.cpp @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) #endif #ifdef UNIX - const size_t length(256); + const std::size_t length(256); char *hostname(new char[length]); gethostname (hostname, length); INFO("hostname: %s", hostname); @@ -185,7 +185,7 @@ int main(int argc, char *argv[]) } run_timer.start(); cpu_timer.start(); - for (size_t k(0); k<n_mults; k++) { + for (std::size_t k(0); k<n_mults; k++) { mat.amux (1.0, x, y); } diff --git a/SimpleTests/MatrixTests/MatVecMultNDPermOpenMP.cpp b/SimpleTests/MatrixTests/MatVecMultNDPermOpenMP.cpp index 0409322855d..c055003b8e8 100644 --- a/SimpleTests/MatrixTests/MatVecMultNDPermOpenMP.cpp +++ b/SimpleTests/MatrixTests/MatVecMultNDPermOpenMP.cpp @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) #endif #ifdef UNIX - const size_t length(256); + const std::size_t length(256); char *hostname(new char[length]); gethostname (hostname, length); INFO("hostname: %s", hostname); @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) run_timer.start(); cpu_timer.start(); - for (size_t k(0); k<n_mults; k++) { + for (std::size_t k(0); k<n_mults; k++) { mat.amux (1.0, x, y); } diff --git a/SimpleTests/MatrixTests/MatVecMultPthreads.cpp b/SimpleTests/MatrixTests/MatVecMultPthreads.cpp index d4df2bd08c7..60a183aa349 100644 --- a/SimpleTests/MatrixTests/MatVecMultPthreads.cpp +++ b/SimpleTests/MatrixTests/MatVecMultPthreads.cpp @@ -147,7 +147,7 @@ INFO("%s was build with compiler %s", BaseLib::CPUTime cpu_timer; run_timer.start(); cpu_timer.start(); - for (size_t k(0); k<n_mults; k++) { + for (std::size_t k(0); k<n_mults; k++) { mat.amux (1.0, x, y); } diff --git a/SimpleTests/MeshTests/MeshRead.cpp b/SimpleTests/MeshTests/MeshRead.cpp index 5ae7947a6e9..48a80eeb1ee 100644 --- a/SimpleTests/MeshTests/MeshRead.cpp +++ b/SimpleTests/MeshTests/MeshRead.cpp @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) /* unsigned elem_id = 25000; const MeshLib::Element* e = mesh->getElement(elem_id); - const size_t nElems = mesh->getNElements(); + const std::size_t nElems = mesh->getNElements(); for (unsigned i=0; i< e->getNNeighbors(); i++) { for (unsigned j=0; j< nElems; j++) diff --git a/SimpleTests/MeshTests/MeshSearchTest.cpp b/SimpleTests/MeshTests/MeshSearchTest.cpp index 6514489d17d..ab8878cbbc5 100644 --- a/SimpleTests/MeshTests/MeshSearchTest.cpp +++ b/SimpleTests/MeshTests/MeshSearchTest.cpp @@ -29,16 +29,16 @@ void testMeshGridAlgorithm(MeshLib::Mesh const*const mesh, std::vector<GeoLib::Point*>& pnts_for_search, - std::vector<size_t> &idx_found_nodes, bool contiguous) + std::vector<std::size_t> &idx_found_nodes, bool contiguous) { // constructing Grid INFO ("[MeshGridAlgorithm] constructing mesh grid object ..."); if (contiguous) { std::vector<MeshLib::Node> mesh_nodes; - size_t n_nodes(mesh->getNodes().size()); + std::size_t n_nodes(mesh->getNodes().size()); mesh_nodes.reserve(n_nodes); - for (size_t k(0); k<n_nodes; k++) { + for (std::size_t k(0); k<n_nodes; k++) { mesh_nodes.push_back(MeshLib::Node(*(mesh->getNodes()[k]))); } #ifndef WIN32 @@ -55,10 +55,10 @@ void testMeshGridAlgorithm(MeshLib::Mesh const*const mesh, #ifndef WIN32 INFO ("[MeshGridAlgorithm] mem for mesh grid: %i MB", (mem_with_mesh - mem_without_mesh)/(1024*1024)); #endif - const size_t n_pnts_for_search(pnts_for_search.size()); + const std::size_t n_pnts_for_search(pnts_for_search.size()); INFO ("[MeshGridAlgorithm] searching %d points ...", pnts_for_search.size()); clock_t start = clock(); - for (size_t k(0); k<n_pnts_for_search; k++) { + for (std::size_t k(0); k<n_pnts_for_search; k++) { MeshLib::Node const* node(mesh_grid.getNearestPoint(*pnts_for_search[k])); idx_found_nodes.push_back(node->getID()); } @@ -79,10 +79,10 @@ void testMeshGridAlgorithm(MeshLib::Mesh const*const mesh, #ifndef WIN32 INFO ("[MeshGridAlgorithm] mem for mesh grid: %i MB", (mem_with_mesh - mem_without_mesh)/(1024*1024)); #endif - const size_t n_pnts_for_search(pnts_for_search.size()); + const std::size_t n_pnts_for_search(pnts_for_search.size()); INFO ("[MeshGridAlgorithm] searching %d points ...", pnts_for_search.size()); clock_t start = clock(); - for (size_t k(0); k<n_pnts_for_search; k++) { + for (std::size_t k(0); k<n_pnts_for_search; k++) { MeshLib::Node const* node(mesh_grid.getNearestPoint(pnts_for_search[k])); idx_found_nodes.push_back(node->getID()); } @@ -137,14 +137,14 @@ int main(int argc, char *argv[]) std::vector<MeshLib::Node*> const& nodes(mesh->getNodes()); std::vector<GeoLib::Point*> pnts_for_search; unsigned n(std::min(static_cast<unsigned>(nodes.size()), number_arg.getValue())); - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { pnts_for_search.push_back(new GeoLib::Point(nodes[k])); } - std::vector<size_t> idx_found_nodes; + std::vector<std::size_t> idx_found_nodes; testMeshGridAlgorithm(mesh, pnts_for_search, idx_found_nodes, contiguous_arg.getValue()); - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { delete pnts_for_search[k]; } diff --git a/SimpleTests/SolverTests/BiCGStabDiagPrecond.cpp b/SimpleTests/SolverTests/BiCGStabDiagPrecond.cpp index 621a3060a15..e50d1678680 100644 --- a/SimpleTests/SolverTests/BiCGStabDiagPrecond.cpp +++ b/SimpleTests/SolverTests/BiCGStabDiagPrecond.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) double *b(new double[n]); // *** init start vector x - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { x[k] = 1.0; } // *** read rhs @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) in.close(); } else { std::cout << "problem reading rhs - initializing b with 1.0" << std::endl; - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { b[k] = 1.0; } } diff --git a/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp b/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp index 35e08af7983..e5cb18090d7 100644 --- a/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp +++ b/SimpleTests/SolverTests/ConjugateGradientDiagonalPreconditioned.cpp @@ -37,7 +37,7 @@ int main(int argc, char *argv[]) double *b(new double[n]); // *** init start vector x - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { x[k] = 0.0; } // *** read rhs @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) in.close(); } else { std::cout << "problem reading rhs - initializing b with 1.0" << std::endl; - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { b[k] = 1.0; } } diff --git a/SimpleTests/SolverTests/ConjugateGradientUnpreconditioned.cpp b/SimpleTests/SolverTests/ConjugateGradientUnpreconditioned.cpp index 89fcee8f806..7970ddc1af1 100644 --- a/SimpleTests/SolverTests/ConjugateGradientUnpreconditioned.cpp +++ b/SimpleTests/SolverTests/ConjugateGradientUnpreconditioned.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) double *b(new double[n]); // *** init start vector x - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { x[k] = 1.0; } // *** read rhs @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) in.close(); } else { std::cout << "problem reading rhs - initializing b with 1.0" << std::endl; - for (size_t k(0); k<n; k++) { + for (std::size_t k(0); k<n; k++) { b[k] = 1.0; } } diff --git a/SimpleTests/SolverTests/GMResDiagPrecond.cpp b/SimpleTests/SolverTests/GMResDiagPrecond.cpp index c5c0142049e..6eee4785cc9 100644 --- a/SimpleTests/SolverTests/GMResDiagPrecond.cpp +++ b/SimpleTests/SolverTests/GMResDiagPrecond.cpp @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) double *b(new double[n]); // *** init start vector x - for (size_t k(0); k < n; k++) { + for (std::size_t k(0); k < n; k++) { x[k] = 1.0; } // *** read rhs @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) } else { std::cout << "problem reading rhs - initializing b with 1.0" << std::endl; - for (size_t k(0); k < n; k++) { + for (std::size_t k(0); k < n; k++) { b[k] = 1.0; } } diff --git a/Tests/BaseLib/excludeObjectCopy.cpp b/Tests/BaseLib/excludeObjectCopy.cpp index 98d4d7f7601..dccfd3db280 100644 --- a/Tests/BaseLib/excludeObjectCopy.cpp +++ b/Tests/BaseLib/excludeObjectCopy.cpp @@ -39,7 +39,7 @@ TEST(BaseLib, excludeObjectCopy) // do not copy element 0, 2, 4, 6, 8, 10, 12, 14, 16, 18 std::transform(ex_positions.begin(), ex_positions.end(), - ex_positions.begin(), std::bind1st(std::multiplies<size_t>(),2)); + ex_positions.begin(), std::bind1st(std::multiplies<std::size_t>(),2)); std::vector<std::size_t> c2(BaseLib::excludeObjectCopy(v,ex_positions)); ASSERT_EQ(size-ex_positions.size(), c2.size()); diff --git a/Tests/InSituLib/TestVtkMappedPropertyVector.cpp b/Tests/InSituLib/TestVtkMappedPropertyVector.cpp index 2c392d201de..6354204acd4 100644 --- a/Tests/InSituLib/TestVtkMappedPropertyVector.cpp +++ b/Tests/InSituLib/TestVtkMappedPropertyVector.cpp @@ -25,7 +25,7 @@ // Creates a PropertyVector<double> and maps it into a vtkDataArray-equivalent TEST(InSituLibMappedPropertyVector, Double) { - const size_t mesh_size = 5; + const std::size_t mesh_size = 5; const double length = 1.0; MeshLib::Mesh* mesh = MeshLib::MeshGenerator::generateRegularHexMesh(length, mesh_size); @@ -57,7 +57,7 @@ TEST(InSituLibMappedPropertyVector, Double) // Creates a PropertyVector<int> and maps it into a vtkDataArray-equivalent TEST(InSituLibMappedPropertyVector, Int) { - const size_t mesh_size = 5; + const std::size_t mesh_size = 5; const double length = 1.0; MeshLib::Mesh* mesh = MeshLib::MeshGenerator::generateRegularHexMesh(length, mesh_size); @@ -89,7 +89,7 @@ TEST(InSituLibMappedPropertyVector, Int) // Creates a PropertyVector<unsigned> and maps it into a vtkDataArray-equivalent TEST(InSituLibMappedPropertyVector, Unsigned) { - const size_t mesh_size = 5; + const std::size_t mesh_size = 5; const double length = 1.0; MeshLib::Mesh* mesh = MeshLib::MeshGenerator::generateRegularHexMesh(length, mesh_size); diff --git a/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp b/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp index d2cff895f65..08530ec4ad3 100644 --- a/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp +++ b/Tests/InSituLib/TestVtkMeshNodalCoordinatesTemplate.cpp @@ -22,7 +22,7 @@ TEST(InSituLibNodalCoordinates, Init) { - const size_t subdivisions = 99; + const std::size_t subdivisions = 99; const double length = 10.0; const double dx = length / subdivisions; @@ -33,7 +33,7 @@ TEST(InSituLibNodalCoordinates, Init) //nodeCoords->PrintSelf(std::cout, vtkIndent()); ASSERT_EQ(nodeCoords->GetNumberOfComponents(), 3); - const size_t numTuples = (subdivisions+1)*(subdivisions+1); + const std::size_t numTuples = (subdivisions+1)*(subdivisions+1); ASSERT_EQ(nodeCoords->GetNumberOfTuples(), numTuples); // First point diff --git a/Tests/MathLib/TestLinearSolver.cpp b/Tests/MathLib/TestLinearSolver.cpp index 95d9569ec0a..1bd38d805ec 100644 --- a/Tests/MathLib/TestLinearSolver.cpp +++ b/Tests/MathLib/TestLinearSolver.cpp @@ -71,7 +71,7 @@ void setMatrix9x9(T_Mat &mat) struct Example1 { MathLib::GlobalDenseMatrix<double> mat; - std::vector<size_t> vec_dirichlet_bc_id; + std::vector<std::size_t> vec_dirichlet_bc_id; std::vector<double> vec_dirichlet_bc_value; static const std::size_t dim_eqs = 9; double* exH; @@ -106,9 +106,9 @@ void checkLinearSolverInterface(T_MATRIX &A, boost::property_tree::ptree &ls_opt // set a coefficient matrix A.setZero(); - for (size_t i=0; i<ex1.dim_eqs; i++) + for (std::size_t i=0; i<ex1.dim_eqs; i++) { - for (size_t j=0; j<ex1.dim_eqs; j++) + for (std::size_t j=0; j<ex1.dim_eqs; j++) { double v = ex1.mat(i, j); if (v!=.0) diff --git a/Tests/MathLib/TestNonlinearPicard.cpp b/Tests/MathLib/TestNonlinearPicard.cpp index e8a2fd80c75..56face785cd 100644 --- a/Tests/MathLib/TestNonlinearPicard.cpp +++ b/Tests/MathLib/TestNonlinearPicard.cpp @@ -50,7 +50,7 @@ public: class Example2 { public: - Example2(size_t n) : A(n, n), b(n) {} + Example2(std::size_t n) : A(n, n), b(n) {} void operator()(VectorType &x, VectorType &x_new) { diff --git a/Tests/TestTools.h b/Tests/TestTools.h index decff5a9ad1..e5a4a427e58 100644 --- a/Tests/TestTools.h +++ b/Tests/TestTools.h @@ -18,11 +18,11 @@ #define TESTTOOLS_H_ #define ASSERT_ARRAY_NEAR(E,A,N,eps)\ - for (size_t i=0; i<(unsigned)(N); i++) \ + for (std::size_t i=0; i<(unsigned)(N); i++) \ ASSERT_NEAR((E)[i], (A)[i], (eps)); #define ASSERT_ARRAY_EQ(E,A,N)\ - for (size_t i=0; i<(unsigned)(N); i++) \ + for (std::size_t i=0; i<(unsigned)(N); i++) \ ASSERT_EQ((E)[i], (A)[i]); #endif // TESTTOOLS_H_ -- GitLab