Skip to content
Snippets Groups Projects
Commit 26d6e047 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

MNT: remove obsolete debugging macros and statements

parent 290eb875
No related branches found
No related tags found
1 merge request!17ENH: Allow `Splinterpolator` instances to be created from an existing set of spline coefficients, and extend extrapolation options
...@@ -553,8 +553,6 @@ namespace MISCMATHS { ...@@ -553,8 +553,6 @@ namespace MISCMATHS {
if (eigenvals(i+1)>tolerance) if (eigenvals(i+1)>tolerance)
therank++; therank++;
// cout << "tolerance = " << tolerance << "\n" << "eigenvalues = " << eigenvals << "\n" << "rank = " << therank << endl;
return therank; return therank;
} }
...@@ -2520,16 +2518,12 @@ namespace MISCMATHS { ...@@ -2520,16 +2518,12 @@ namespace MISCMATHS {
///////////////////// /////////////////////
// setup // setup
OUT("Setup");
int ntpts=Y.Nrows(); int ntpts=Y.Nrows();
int nevs=X.Ncols(); int nevs=X.Ncols();
if(ntpts!=X.Nrows()) if(ntpts!=X.Nrows())
throw Exception("COCK"); throw Exception("Number of time points does not match number of rows in design matrix!");
OUT(nevs);
OUT(ntpts);
ColumnVector gam_m(nevs); ColumnVector gam_m(nevs);
gam_m=1e10; gam_m=1e10;
...@@ -2552,7 +2546,6 @@ namespace MISCMATHS { ...@@ -2552,7 +2546,6 @@ namespace MISCMATHS {
} }
else else
{ {
OUT("no ols");
B.ReSize(nevs); B.ReSize(nevs);
B=0; B=0;
lambdaB=1; lambdaB=1;
...@@ -2563,9 +2556,6 @@ namespace MISCMATHS { ...@@ -2563,9 +2556,6 @@ namespace MISCMATHS {
gam_y=10; gam_y=10;
} }
// OUT(B(1));
// OUT(lambdaB(1));
float trace_ilambdaZZ=1; float trace_ilambdaZZ=1;
SymmetricMatrix ZZ; SymmetricMatrix ZZ;
...@@ -2579,12 +2569,10 @@ namespace MISCMATHS { ...@@ -2579,12 +2569,10 @@ namespace MISCMATHS {
///////////////////// /////////////////////
// iterate // iterate
OUT("Iterate");
int i = 1;; int i = 1;;
for(; i<=niters; i++) for(; i<=niters; i++)
{ {
cout<<i<<",";
//////////////////// ////////////////////
// update phim // update phim
for(int l=1; l <= nevs; l++) for(int l=1; l <= nevs; l++)
...@@ -2597,8 +2585,6 @@ namespace MISCMATHS { ...@@ -2597,8 +2585,6 @@ namespace MISCMATHS {
gam_m(l) = b_m*c_m; gam_m(l) = b_m*c_m;
} }
// OUT(gam_m(1));
//////////////////// ////////////////////
// update B // update B
ColumnVector beta(nevs); ColumnVector beta(nevs);
...@@ -2634,7 +2620,6 @@ namespace MISCMATHS { ...@@ -2634,7 +2620,6 @@ namespace MISCMATHS {
tmp2 << tmp3*ZZ; tmp2 << tmp3*ZZ;
trace_ilambdaZZ=tmp2.Trace(); trace_ilambdaZZ=tmp2.Trace();
// OUT(trace_ilambdaZZ);
///////////////////// /////////////////////
...@@ -2649,12 +2634,7 @@ namespace MISCMATHS { ...@@ -2649,12 +2634,7 @@ namespace MISCMATHS {
float b_y = 1.0/(0.5*(sum + trace_ilambdaZZ)+1/b_y0); float b_y = 1.0/(0.5*(sum + trace_ilambdaZZ)+1/b_y0);
gam_y = b_y*c_y; gam_y = b_y*c_y;
// OUT(gam_y);
} }
cout << endl;
} }
vector<float> ColumnVector2vector(const ColumnVector& col) vector<float> ColumnVector2vector(const ColumnVector& col)
......
...@@ -37,9 +37,6 @@ namespace MISCMATHS { ...@@ -37,9 +37,6 @@ namespace MISCMATHS {
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
#define OUT(t) std::cout<<#t "="<<t<<std::endl;
#define LOGOUT(t) Utilities::LogSingleton::getInstance().str()<<#t "="<<t<<std::endl;
// IO/string stuff // IO/string stuff
template <class T> std::string num2str(T n, int width=-1); template <class T> std::string num2str(T n, int width=-1);
......
...@@ -354,16 +354,12 @@ namespace MISCMATHS { ...@@ -354,16 +354,12 @@ namespace MISCMATHS {
Tracer_Plus trace("sparsefns::solvefortracex"); Tracer_Plus trace("sparsefns::solvefortracex");
int every = Max(1,A.Ncols()/nsamps); int every = Max(1,A.Ncols()/nsamps);
// int every = 1;
// OUT(every);
float tr = 0.0; float tr = 0.0;
// assumes symmetric A and b // assumes symmetric A and b
for(int r = every; r<=A.Ncols(); r+=every) for(int r = every; r<=A.Ncols(); r+=every)
{ {
// cout << float(r)/A.Ncols() << "\r";
// cout.flush();
ColumnVector br = b.RowAsColumn(r); ColumnVector br = b.RowAsColumn(r);
ColumnVector xr = x.RowAsColumn(r); ColumnVector xr = x.RowAsColumn(r);
...@@ -381,8 +377,6 @@ namespace MISCMATHS { ...@@ -381,8 +377,6 @@ namespace MISCMATHS {
tr += xr(r); tr += xr(r);
} }
cout << endl;
tr *= every; tr *= every;
return tr; return tr;
...@@ -395,8 +389,6 @@ namespace MISCMATHS { ...@@ -395,8 +389,6 @@ namespace MISCMATHS {
// assumes symmetric A and b // assumes symmetric A and b
for(int r = 1; r<=A.Ncols(); r++) for(int r = 1; r<=A.Ncols(); r++)
{ {
cout << float(r)/A.Ncols() << "\r";
cout.flush();
ColumnVector br = b.RowAsColumn(r); ColumnVector br = b.RowAsColumn(r);
ColumnVector xr = x.RowAsColumn(r); ColumnVector xr = x.RowAsColumn(r);
...@@ -411,7 +403,6 @@ namespace MISCMATHS { ...@@ -411,7 +403,6 @@ namespace MISCMATHS {
} }
} }
} }
cout << endl;
} }
void solveforx(const SparseMatrix& A, const ColumnVector& b, ColumnVector& x, float tol, int kmax) void solveforx(const SparseMatrix& A, const ColumnVector& b, ColumnVector& x, float tol, int kmax)
...@@ -454,29 +445,14 @@ namespace MISCMATHS { ...@@ -454,29 +445,14 @@ namespace MISCMATHS {
multiply(A,p,w); multiply(A,p,w);
float alpha = 0.0; float alpha = 0.0;
//if(k>1)
alpha = rho(k-1)/(p.t()*w).AsScalar(); alpha = rho(k-1)/(p.t()*w).AsScalar();
//else
//alpha = 1;
x += alpha*p; x += alpha*p;
r -= alpha*w; r -= alpha*w;
rho(k) = Sqr(norm2(r)); rho(k) = Sqr(norm2(r));
} }
if(k>kmax/2.0)
{
OUT(std::sqrt(rho(k-1)));
OUT(norm2(b));
OUT(k);
cout.flush();
}
} }
// write_ascii_matrix("rho",rho);
} }
void solveforx(const SparseMatrix& U, const SparseMatrix& L, const ColumnVector& b, ColumnVector& x) void solveforx(const SparseMatrix& U, const SparseMatrix& L, const ColumnVector& b, ColumnVector& x)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment