From da4ece345a34c8fe84a5e780d88d469a0ee40cbf Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 2 Jan 2012 15:58:16 +0100 Subject: [PATCH] changed namespace BASELIB to BaseLib --- Base/printList.h | 4 +-- Base/quicksort.h | 36 +++++++++---------- Base/swap.h | 4 +-- Base/uniqueListInsert.h | 4 +-- Base/wait.h | 4 +-- GeoLib/Polygon.cpp | 6 ++-- GeoLib/Polyline.cpp | 4 +-- MathLib/EarClippingTriangulation.cpp | 12 +++---- MathLib/LinAlg/Solvers/GaussAlgorithm.cpp | 4 +-- MathLib/LinAlg/Sparse/CRSMatrix.h | 12 +++---- .../NestedDissectionPermutation/AdjMat.cpp | 8 ++--- .../NestedDissectionPermutation/Cluster.cpp | 14 ++++---- .../NestedDissectionPermutation/Separator.cpp | 4 +-- 13 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Base/printList.h b/Base/printList.h index bb0e7dd1c80..7a4a4bb16f9 100644 --- a/Base/printList.h +++ b/Base/printList.h @@ -13,7 +13,7 @@ #include <string> #include <iostream> -namespace BASELIB { +namespace BaseLib { void printList (std::list<size_t> const& mylist, std::string const& title) { @@ -25,6 +25,6 @@ void printList (std::list<size_t> const& mylist, std::string const& title) std::cout << std::endl; } -} // end namespace BASELIB +} // end namespace BaseLib #endif /* PRINTLIST_H_ */ diff --git a/Base/quicksort.h b/Base/quicksort.h index 78f69f55856..72a46f34f8d 100644 --- a/Base/quicksort.h +++ b/Base/quicksort.h @@ -36,10 +36,10 @@ unsigned partition_(T* array, unsigned beg, unsigned end) while ((j>beg) && !(array[j] < m)) j--; if (i >= j) break; - BASELIB::swap(array[i], array[j]); + BaseLib::swap(array[i], array[j]); } - BASELIB::swap(array[beg], array[j]); + BaseLib::swap(array[beg], array[j]); return j; } @@ -62,12 +62,12 @@ size_t partition_(T* array, size_t beg, size_t end, size_t *perm) if (i >= j) break; - BASELIB::swap(array[i], array[j]); - BASELIB::swap(perm[i], perm[j]); + BaseLib::swap(array[i], array[j]); + BaseLib::swap(perm[i], perm[j]); } - BASELIB::swap(array[beg], array[j]); - BASELIB::swap(perm[beg], perm[j]); + BaseLib::swap(array[beg], array[j]); + BaseLib::swap(perm[beg], perm[j]); return j; } @@ -109,12 +109,12 @@ private: if (i >= j) break; - BASELIB::swap(array[i], array[j]); - BASELIB::swap(perm[i], perm[j]); + BaseLib::swap(array[i], array[j]); + BaseLib::swap(perm[i], perm[j]); } - BASELIB::swap(array[beg], array[j]); - BASELIB::swap(perm[beg], perm[j]); + BaseLib::swap(array[beg], array[j]); + BaseLib::swap(perm[beg], perm[j]); return j; } @@ -157,12 +157,12 @@ private: if (i >= j) break; - BASELIB::swap(array[i], array[j]); - BASELIB::swap(perm[i], perm[j]); + BaseLib::swap(array[i], array[j]); + BaseLib::swap(perm[i], perm[j]); } - BASELIB::swap(array[beg], array[j]); - BASELIB::swap(perm[beg], perm[j]); + BaseLib::swap(array[beg], array[j]); + BaseLib::swap(perm[beg], perm[j]); return j; } @@ -189,12 +189,12 @@ private: if (i >= j) break; - BASELIB::swap(perm[i], perm[j]); - BASELIB::swap(array[i], array[j]); + BaseLib::swap(perm[i], perm[j]); + BaseLib::swap(array[i], array[j]); } - BASELIB::swap(perm[beg], perm[j]); - BASELIB::swap(array[beg], array[j]); + BaseLib::swap(perm[beg], perm[j]); + BaseLib::swap(array[beg], array[j]); return j; } diff --git a/Base/swap.h b/Base/swap.h index 9915e9135c3..265054b1130 100644 --- a/Base/swap.h +++ b/Base/swap.h @@ -1,7 +1,7 @@ #ifndef SWAP_H_ #define SWAP_H_ -namespace BASELIB { +namespace BaseLib { /** * swap the content of arg0 and arg1 @@ -13,6 +13,6 @@ template<class T> void swap(T& arg0, T& arg1) arg1 = temp; } -} // end namespace BASELIB +} // end namespace BaseLib #endif //SWAP_H_ diff --git a/Base/uniqueListInsert.h b/Base/uniqueListInsert.h index 779545a7ca4..38804f59dc7 100644 --- a/Base/uniqueListInsert.h +++ b/Base/uniqueListInsert.h @@ -10,7 +10,7 @@ #include <list> -namespace BASELIB { +namespace BaseLib { void uniqueListInsert (std::list<size_t>& list, size_t element) { @@ -23,6 +23,6 @@ void uniqueListInsert (std::list<size_t>& list, size_t element) list.push_back (element); } -} // end namespace BASELIB +} // end namespace BaseLib #endif /* UNIQUELISTINSERT_H_ */ diff --git a/Base/wait.h b/Base/wait.h index 2973158740e..c56de031139 100644 --- a/Base/wait.h +++ b/Base/wait.h @@ -9,7 +9,7 @@ #include <ctime> -namespace BASELIB { +namespace BaseLib { void wait(int seconds) { @@ -23,6 +23,6 @@ void wait(int seconds) while((cur_time - start_time) < seconds); } -} // end namespace BASELIB +} // end namespace BaseLib #endif //WAIT_H diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp index 90e79664ba1..12721118874 100644 --- a/GeoLib/Polygon.cpp +++ b/GeoLib/Polygon.cpp @@ -267,7 +267,7 @@ void Polygon::ensureCWOrientation () size_t tmp_n_pnts (n_pnts); tmp_n_pnts++; // include last point of polygon (which is identical to the first) for (size_t k(0); k<tmp_n_pnts/2; k++) { - BASELIB::swap (_ply_pnt_ids[k], _ply_pnt_ids[tmp_n_pnts-1-k]); + BaseLib::swap (_ply_pnt_ids[k], _ply_pnt_ids[tmp_n_pnts-1-k]); } } @@ -288,7 +288,7 @@ void Polygon::splitPolygonAtIntersection (std::list<Polygon*>::iterator polygon_ const_cast<std::vector<Point*>& >(_ply_pnts).push_back (intersection_pnt); // split Polygon - if (idx0 > idx1) BASELIB::swap (idx0, idx1); + if (idx0 > idx1) BaseLib::swap (idx0, idx1); GEOLIB::Polygon* polygon0 (new GEOLIB::Polygon((*polygon_it)->getPointsVec(), false)); for (size_t k(0); k<=idx0; k++) polygon0->addPoint ((*polygon_it)->getPointID (k)); @@ -343,7 +343,7 @@ void Polygon::splitPolygonAtPoint (std::list<GEOLIB::Polygon*>::iterator polygon delete [] perm; delete [] id_vec; - if (idx0 > idx1) BASELIB::swap (idx0, idx1); + if (idx0 > idx1) BaseLib::swap (idx0, idx1); // create two closed polylines GEOLIB::Polygon* polygon0 (new GEOLIB::Polygon((*polygon_it)->getPointsVec())); diff --git a/GeoLib/Polyline.cpp b/GeoLib/Polyline.cpp index 0176824553c..7d40cb35c68 100644 --- a/GeoLib/Polyline.cpp +++ b/GeoLib/Polyline.cpp @@ -244,13 +244,13 @@ bool containsEdge (const Polyline& ply, size_t id0, size_t id1) std::cerr << "no valid edge id0 == id1 == " << id0 << std::endl; return false; } - if (id0 > id1) BASELIB::swap (id0,id1); + if (id0 > id1) BaseLib::swap (id0,id1); const size_t n (ply.getNumberOfPoints() - 1); for (size_t k(0); k<n; k++) { size_t ply_pnt0 (ply.getPointID (k)); size_t ply_pnt1 (ply.getPointID (k+1)); if (ply_pnt0 > ply_pnt1) - BASELIB::swap (ply_pnt0, ply_pnt1); + BaseLib::swap (ply_pnt0, ply_pnt1); if (ply_pnt0 == id0 && ply_pnt1 == id1) return true; } diff --git a/MathLib/EarClippingTriangulation.cpp b/MathLib/EarClippingTriangulation.cpp index 45eb1fa5235..d8832cbd5fb 100644 --- a/MathLib/EarClippingTriangulation.cpp +++ b/MathLib/EarClippingTriangulation.cpp @@ -8,7 +8,7 @@ // STL #include <vector> -// BASELIB +// BaseLib #include "swap.h" #include "printList.h" #include "uniqueListInsert.h" @@ -119,7 +119,7 @@ void EarClippingTriangulation::ensureCWOrientation () if (_original_orient == MathLib::CCW) { // switch orientation for (size_t k(0); k<n_pnts/2; k++) { - BASELIB::swap (_pnts[k], _pnts[n_pnts-1-k]); + BaseLib::swap (_pnts[k], _pnts[n_pnts-1-k]); } } } @@ -222,11 +222,11 @@ void EarClippingTriangulation::clipEars() MathLib::Orientation orientation = getOrientation(_pnts[*prevprev], _pnts[*prev], _pnts[*next]); if (orientation == CW) { - BASELIB::uniqueListInsert(_convex_vertex_list, *prev); + BaseLib::uniqueListInsert(_convex_vertex_list, *prev); // prev is convex if (isEar(*prevprev, *prev, *next)) { // prev is an ear tip - BASELIB::uniqueListInsert(_ear_list, *prev); + BaseLib::uniqueListInsert(_ear_list, *prev); } else { // if necessary remove prev _ear_list.remove(*prev); @@ -261,11 +261,11 @@ void EarClippingTriangulation::clipEars() orientation = getOrientation(_pnts[*prev], _pnts[*next], _pnts[*nextnext]); if (orientation == CW) { - BASELIB::uniqueListInsert(_convex_vertex_list, *next); + BaseLib::uniqueListInsert(_convex_vertex_list, *next); // next is convex if (isEar(*prev, *next, *nextnext)) { // next is an ear tip - BASELIB::uniqueListInsert(_ear_list, *next); + BaseLib::uniqueListInsert(_ear_list, *next); } else { // if necessary remove *next _ear_list.remove(*next); diff --git a/MathLib/LinAlg/Solvers/GaussAlgorithm.cpp b/MathLib/LinAlg/Solvers/GaussAlgorithm.cpp index 98007abaf93..2f0031c3035 100644 --- a/MathLib/LinAlg/Solvers/GaussAlgorithm.cpp +++ b/MathLib/LinAlg/Solvers/GaussAlgorithm.cpp @@ -30,7 +30,7 @@ GaussAlgorithm::GaussAlgorithm (Matrix <double> &A) : // exchange rows if (_perm[k] != k) { - for (j=0; j<nc; j++) BASELIB::swap (_mat(_perm[k],j), _mat(k,j)); + for (j=0; j<nc; j++) BaseLib::swap (_mat(_perm[k],j), _mat(k,j)); } // eliminate @@ -59,7 +59,7 @@ void GaussAlgorithm::execute (double *b) const void GaussAlgorithm::permuteRHS (double* b) const { for (size_t i=0; i<_n; i++) { - if (_perm[i] != i) BASELIB::swap(b[i], b[_perm[i]]); + if (_perm[i] != i) BaseLib::swap(b[i], b[_perm[i]]); } } diff --git a/MathLib/LinAlg/Sparse/CRSMatrix.h b/MathLib/LinAlg/Sparse/CRSMatrix.h index a4fc2bb3a0a..4c99ce9421c 100644 --- a/MathLib/LinAlg/Sparse/CRSMatrix.h +++ b/MathLib/LinAlg/Sparse/CRSMatrix.h @@ -298,9 +298,9 @@ protected: } MatrixBase::_n_rows -= n_rows_cols; - BASELIB::swap (row_ptr_new, _row_ptr); - BASELIB::swap (col_idx_new, _col_idx); - BASELIB::swap (data_new, _data); + BaseLib::swap (row_ptr_new, _row_ptr); + BaseLib::swap (col_idx_new, _col_idx); + BaseLib::swap (data_new, _data); delete [] row_ptr_new_tmp; delete [] row_ptr_new; @@ -351,9 +351,9 @@ protected: } MatrixBase::_n_rows = n_cols; - BASELIB::swap(row_ptr_trans, _row_ptr); - BASELIB::swap(col_idx_trans, _col_idx); - BASELIB::swap(data_trans, _data); + BaseLib::swap(row_ptr_trans, _row_ptr); + BaseLib::swap(col_idx_trans, _col_idx); + BaseLib::swap(data_trans, _data); delete[] row_ptr_nnz; delete[] row_ptr_trans; diff --git a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp index 9280eb5bdf1..bccd00a113a 100644 --- a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp +++ b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/AdjMat.cpp @@ -137,8 +137,8 @@ void genAdjMat(unsigned n, unsigned* &iA, unsigned* &jA) if (i < jA[k]) jAn[con[i]++] = jA[k]; - BASELIB::swap(jA, jAn); - BASELIB::swap(iA, iAn); + BaseLib::swap(jA, jAn); + BaseLib::swap(iA, iAn); delete[] jAn; delete[] con; @@ -184,8 +184,8 @@ void genFullAdjMat(unsigned n, unsigned* &iA, unsigned* &jA) } } - BASELIB::swap(jA, jAn); - BASELIB::swap(iA, iAn); + BaseLib::swap(jA, jAn); + BaseLib::swap(iA, iAn); delete[] jAn; delete[] iAn; diff --git a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Cluster.cpp b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Cluster.cpp index dadbb3920e1..225452013d1 100644 --- a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Cluster.cpp +++ b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Cluster.cpp @@ -108,7 +108,7 @@ void Cluster::subdivide(unsigned bmin) delete _l_adj_mat; _l_adj_mat = NULL; } // end if next recursion step - } // end if ( connected && size () > bmin ) + } // end if (size > bmin) } @@ -122,9 +122,9 @@ void Cluster::updatePerm(unsigned* reordering, unsigned &isep0, while (beg < end && reordering[end] >= 1) --end; // local permutation - BASELIB::swap(l_op_perm[beg], l_op_perm[end]); - BASELIB::swap(l_po_perm[l_op_perm[beg]], l_po_perm[l_op_perm[end]]); - BASELIB::swap(reordering[beg], reordering[end]); + BaseLib::swap(l_op_perm[beg], l_op_perm[end]); + BaseLib::swap(l_po_perm[l_op_perm[beg]], l_po_perm[l_op_perm[end]]); + BaseLib::swap(reordering[beg], reordering[end]); } ++beg; } @@ -140,9 +140,9 @@ void Cluster::updatePerm(unsigned* reordering, unsigned &isep0, while (beg < end && reordering[end] == 2) --end; // local permutation - BASELIB::swap(l_op_perm[beg], l_op_perm[end]); - BASELIB::swap(l_po_perm[l_op_perm[beg]], l_po_perm[l_op_perm[end]]); - BASELIB::swap(reordering[beg], reordering[end]); + BaseLib::swap(l_op_perm[beg], l_op_perm[end]); + BaseLib::swap(l_po_perm[l_op_perm[beg]], l_po_perm[l_op_perm[end]]); + BaseLib::swap(reordering[beg], reordering[end]); } ++beg; } diff --git a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Separator.cpp b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Separator.cpp index 7d7d211ab0b..226329ef83e 100644 --- a/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Separator.cpp +++ b/MathLib/LinAlg/Sparse/NestedDissectionPermutation/Separator.cpp @@ -34,8 +34,8 @@ unsigned Separator::updatePerm(unsigned* reordering, unsigned* l_op_perm, unsign --end; while (beg < end && reordering[end] == 1) --end; // local permutation - BASELIB::swap(l_op_perm [beg], l_op_perm[end]); - BASELIB::swap(l_po_perm[l_op_perm [beg]], l_po_perm[l_op_perm[end]]); + BaseLib::swap(l_op_perm [beg], l_op_perm[end]); + BaseLib::swap(l_po_perm[l_op_perm [beg]], l_po_perm[l_op_perm[end]]); } ++beg; } -- GitLab