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

MNT: remove obsolete debugging macros and statements

parent 7c9e4d9f
No related branches found
No related tags found
No related merge requests found
......@@ -553,8 +553,6 @@ namespace MISCMATHS {
if (eigenvals(i+1)>tolerance)
therank++;
// cout << "tolerance = " << tolerance << "\n" << "eigenvalues = " << eigenvals << "\n" << "rank = " << therank << endl;
return therank;
}
......@@ -2520,16 +2518,12 @@ namespace MISCMATHS {
/////////////////////
// setup
OUT("Setup");
int ntpts=Y.Nrows();
int nevs=X.Ncols();
if(ntpts!=X.Nrows())
throw Exception("COCK");
OUT(nevs);
OUT(ntpts);
throw Exception("Number of time points does not match number of rows in design matrix!");
ColumnVector gam_m(nevs);
gam_m=1e10;
......@@ -2552,7 +2546,6 @@ namespace MISCMATHS {
}
else
{
OUT("no ols");
B.ReSize(nevs);
B=0;
lambdaB=1;
......@@ -2563,9 +2556,6 @@ namespace MISCMATHS {
gam_y=10;
}
// OUT(B(1));
// OUT(lambdaB(1));
float trace_ilambdaZZ=1;
SymmetricMatrix ZZ;
......@@ -2579,12 +2569,10 @@ namespace MISCMATHS {
/////////////////////
// iterate
OUT("Iterate");
int i = 1;;
for(; i<=niters; i++)
{
cout<<i<<",";
////////////////////
// update phim
for(int l=1; l <= nevs; l++)
......@@ -2597,8 +2585,6 @@ namespace MISCMATHS {
gam_m(l) = b_m*c_m;
}
// OUT(gam_m(1));
////////////////////
// update B
ColumnVector beta(nevs);
......@@ -2634,7 +2620,6 @@ namespace MISCMATHS {
tmp2 << tmp3*ZZ;
trace_ilambdaZZ=tmp2.Trace();
// OUT(trace_ilambdaZZ);
/////////////////////
......@@ -2649,12 +2634,7 @@ namespace MISCMATHS {
float b_y = 1.0/(0.5*(sum + trace_ilambdaZZ)+1/b_y0);
gam_y = b_y*c_y;
// OUT(gam_y);
}
cout << endl;
}
vector<float> ColumnVector2vector(const ColumnVector& col)
......
......@@ -37,9 +37,6 @@ namespace MISCMATHS {
#define M_PI 3.14159265358979323846
#endif
#define OUT(t) std::cout<<#t "="<<t<<std::endl;
#define LOGOUT(t) Utilities::LogSingleton::getInstance().str()<<#t "="<<t<<std::endl;
// IO/string stuff
template <class T> std::string num2str(T n, int width=-1);
......
......@@ -354,16 +354,12 @@ namespace MISCMATHS {
Tracer_Plus trace("sparsefns::solvefortracex");
int every = Max(1,A.Ncols()/nsamps);
// int every = 1;
// OUT(every);
float tr = 0.0;
// assumes symmetric A and b
for(int r = every; r<=A.Ncols(); r+=every)
{
// cout << float(r)/A.Ncols() << "\r";
// cout.flush();
ColumnVector br = b.RowAsColumn(r);
ColumnVector xr = x.RowAsColumn(r);
......@@ -381,8 +377,6 @@ namespace MISCMATHS {
tr += xr(r);
}
cout << endl;
tr *= every;
return tr;
......@@ -395,8 +389,6 @@ namespace MISCMATHS {
// assumes symmetric A and b
for(int r = 1; r<=A.Ncols(); r++)
{
cout << float(r)/A.Ncols() << "\r";
cout.flush();
ColumnVector br = b.RowAsColumn(r);
ColumnVector xr = x.RowAsColumn(r);
......@@ -411,7 +403,6 @@ namespace MISCMATHS {
}
}
}
cout << endl;
}
void solveforx(const SparseMatrix& A, const ColumnVector& b, ColumnVector& x, float tol, int kmax)
......@@ -454,29 +445,14 @@ namespace MISCMATHS {
multiply(A,p,w);
float alpha = 0.0;
//if(k>1)
alpha = rho(k-1)/(p.t()*w).AsScalar();
//else
//alpha = 1;
x += alpha*p;
r -= alpha*w;
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)
......
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