aboutsummaryrefslogtreecommitdiff
path: root/src/elliptic
diff options
context:
space:
mode:
authorjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-08-18 10:01:03 +0000
committerjthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5>2003-08-18 10:01:03 +0000
commit88ce8f204d96b41c7abd8f302c6aa2e1bd4ea7a9 (patch)
tree98b563a13fa8cbff16e9d3b14893717ceaffd2f2 /src/elliptic
parentb15e053d659533a3df651bdcf486ae14f5107639 (diff)
move lots and lots of code into C++ namespace AHFinderDirect
so it can't conflict with stuff in other thorns git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@1184 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/elliptic')
-rw-r--r--src/elliptic/Jacobian.cc10
-rw-r--r--src/elliptic/Jacobian.hh7
-rw-r--r--src/elliptic/dense_Jacobian.cc20
-rw-r--r--src/elliptic/dense_Jacobian.hh11
-rw-r--r--src/elliptic/row_sparse_Jacobian.cc44
-rw-r--r--src/elliptic/row_sparse_Jacobian.hh13
6 files changed, 75 insertions, 30 deletions
diff --git a/src/elliptic/Jacobian.cc b/src/elliptic/Jacobian.cc
index 8037d74..facd5cb 100644
--- a/src/elliptic/Jacobian.cc
+++ b/src/elliptic/Jacobian.cc
@@ -38,6 +38,10 @@ using jtutil::error_exit;
#include "dense_Jacobian.hh"
#include "row_sparse_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -129,3 +133,9 @@ switch (Jac_method)
int(Jac_method)); /*NOTREACHED*/
}
}
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/Jacobian.hh b/src/elliptic/Jacobian.hh
index 15ead8e..0dcf14b 100644
--- a/src/elliptic/Jacobian.hh
+++ b/src/elliptic/Jacobian.hh
@@ -14,6 +14,10 @@
// "../patch/patch_system.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//
@@ -231,4 +235,5 @@ Jacobian* new_Jacobian(enum Jacobian_store_solve_method Jac_method,
//******************************************************************************
-#endif // AHFINDERDIRECT__JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__JACOBIAN_HH */
diff --git a/src/elliptic/dense_Jacobian.cc b/src/elliptic/dense_Jacobian.cc
index e5cec64..6deaab1 100644
--- a/src/elliptic/dense_Jacobian.cc
+++ b/src/elliptic/dense_Jacobian.cc
@@ -45,6 +45,10 @@ using jtutil::error_exit;
#include "Jacobian.hh"
#include "dense_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -136,7 +140,7 @@ if (print_msg_flag)
" dense Jacobian matrix (%d rows)",
N_rows_);
}
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
@@ -155,7 +159,7 @@ void dense_Jacobian::zero_matrix()
}
}
}
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
//******************************************************************************
@@ -177,7 +181,7 @@ if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
" LAPACK linear-equations solver");
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
@@ -191,7 +195,7 @@ delete[] rwork_;
delete[] iwork_;
delete[] pivot_;
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
@@ -276,4 +280,10 @@ fp rcond;
return rcond;
}
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/dense_Jacobian.hh b/src/elliptic/dense_Jacobian.hh
index b99cd84..6244629 100644
--- a/src/elliptic/dense_Jacobian.hh
+++ b/src/elliptic/dense_Jacobian.hh
@@ -18,6 +18,10 @@
// "Jacobian.hh"
//
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
#ifdef HAVE_DENSE_JACOBIAN
@@ -72,7 +76,7 @@ protected:
// Fortran storage order ==> subscripts are (JJ,II)
jtutil::array2d<fp> matrix_;
};
-#endif // HAVE_DENSE_JACOBIAN
+#endif /* HAVE_DENSE_JACOBIAN */
//******************************************************************************
@@ -110,8 +114,9 @@ private:
integer *iwork_; // size N_rows_
fp *rwork_; // size 4*N_rows_
};
-#endif // HAVE_DENSE_JACOBIAN__LAPACK
+#endif /* HAVE_DENSE_JACOBIAN__LAPACK */
//******************************************************************************
-#endif // AHFINDERDIRECT__DENSE_JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__DENSE_JACOBIAN_HH */
diff --git a/src/elliptic/row_sparse_Jacobian.cc b/src/elliptic/row_sparse_Jacobian.cc
index a53c3fb..bb20395 100644
--- a/src/elliptic/row_sparse_Jacobian.cc
+++ b/src/elliptic/row_sparse_Jacobian.cc
@@ -101,6 +101,10 @@ using jtutil::error_exit;
#include "Jacobian.hh"
#include "row_sparse_Jacobian.hh"
+// all the code in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
//******************************************************************************
//******************************************************************************
@@ -204,7 +208,7 @@ if (print_msg_flag)
zero_matrix();
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -218,7 +222,7 @@ delete[] A_;
delete[] JA_;
delete[] IA_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -232,7 +236,7 @@ fp row_sparse_Jacobian::element(int II, int JJ)
const int posn = find_element(II,JJ);
return (posn >= 0) ? A_[posn] : 0.0;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -250,7 +254,7 @@ N_nonzeros_ = 0;
current_N_rows_= 0;
IA_[0] = IO_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -265,7 +269,7 @@ if (posn >= 0)
then A_[posn] = value;
else insert_element(II,JJ, value);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -280,7 +284,7 @@ if (posn >= 0)
then A_[posn] += value;
else insert_element(II,JJ, value);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -306,7 +310,7 @@ const int stop = IA_[II+1] - IO_;
return -1; // not found
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -379,7 +383,7 @@ check_and_print_data_structure(true);
return posn;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -413,7 +417,7 @@ delete[] JA_;
JA_ = new_JA;
A_ = new_A;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -567,8 +571,8 @@ assert(N_nonzeros_ <= N_nonzeros_allocated_);
if (print_flag)
then printf("--- end Jacobian printout\n");
}
-#endif // DEBUG_ROW_SPARSE_JACOBIAN
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* DEBUG_ROW_SPARSE_JACOBIAN */
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
//******************************************************************************
@@ -590,7 +594,7 @@ if (print_msg_flag)
then CCTK_VInfo(CCTK_THORNSTRING,
" ILUCG linear-equations solver");
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -603,7 +607,7 @@ row_sparse_Jacobian__ILUCG::~row_sparse_Jacobian__ILUCG()
delete[] rtemp_;
delete[] itemp_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -718,7 +722,7 @@ if (print_msg_flag)
return -1.0; // no condition number estimate available
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
//******************************************************************************
@@ -746,7 +750,7 @@ if (print_msg_flag)
umfpack_defaults(Control_);
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
@@ -765,7 +769,7 @@ delete[] solve_workspace_integer_;
delete[] Info_;
delete[] Control_;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
@@ -907,4 +911,10 @@ if (Numeric_ != NULL)
return rcond;
}
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace AHFinderDirect
diff --git a/src/elliptic/row_sparse_Jacobian.hh b/src/elliptic/row_sparse_Jacobian.hh
index ebdda0e..2fc1640 100644
--- a/src/elliptic/row_sparse_Jacobian.hh
+++ b/src/elliptic/row_sparse_Jacobian.hh
@@ -52,6 +52,10 @@
#undef ROW_SPARSE_JACOBIAN__PRINT_AFTER_INSERT
#endif
+// everything in this file is inside this namespace
+namespace AHFinderDirect
+ {
+
//******************************************************************************
#ifdef HAVE_ROW_SPARSE_JACOBIAN
@@ -221,7 +225,7 @@ protected:
// 0 <= posn < II[current_N_rows]
fp* A_; // ditto
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN
+#endif /* HAVE_ROW_SPARSE_JACOBIAN */
//******************************************************************************
@@ -257,7 +261,7 @@ private:
integer* itemp_;
fp* rtemp_;
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN__ILUCG
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__ILUCG */
//******************************************************************************
@@ -313,8 +317,9 @@ private:
//
};
-#endif // HAVE_ROW_SPARSE_JACOBIAN__UMFPACK
+#endif /* HAVE_ROW_SPARSE_JACOBIAN__UMFPACK */
//******************************************************************************
-#endif // AHFINDERDIRECT__ROW_SPARSE_JACOBIAN_HH
+ } // namespace AHFinderDirect
+#endif /* AHFINDERDIRECT__ROW_SPARSE_JACOBIAN_HH */