Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions libs/tbdefs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@
#include <complex>
#include <time.h>

template<typename T>
std::ostream& operator<<(std::ostream& os, const std::valarray<T>& v)
{
os << "[";
if (v.size() > 0) {
os << v[0];
for (size_t i = 1; i < v.size(); ++i) {
os << ", " << v[i];
}
}
os << "]";
return os;
}

/**************************************
* MACROS & DEFINES *
**************************************/
Expand Down
2 changes: 1 addition & 1 deletion make.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ MAKEDEPEND=g++ -M $(CXXFLAGS)
# Lapack includes and linking

ILAPACK=
LLAPACK=-llapack
LLAPACK=-lopenblas

TBSRC=../libs/
LDFLAGS=-L$(TBSRC) -ltoolbox $(LLAPACK)
Expand Down
8 changes: 6 additions & 2 deletions tools/dimproj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ int main(int argc, char**argv)
else
{
csv2floats(fdhd,tfpars); fhdpars=tfpars;
std::cerr<<"high-dim pars"<<tfpars<<"\n";
std::cerr << "high-dim pars";
toolbox::operator<<(std::cerr, tfpars);
std::cerr <<"\n";
if (tfpars.size()==2)
{
opts.tfunH.set_mode(NLDRGamma,tfpars);
Expand All @@ -142,7 +144,9 @@ int main(int argc, char**argv)
else
{
csv2floats(fdld,tfpars); fldpars=tfpars;
std::cerr<<"lo-dim pars"<<tfpars<<"\n";
std::cerr<<"lo-dim pars";
toolbox::operator<<(std::cerr, tfpars);
std::cerr <<"\n";
if (tfpars.size()==2)
{
opts.tfunL.set_mode(NLDRGamma,tfpars);
Expand Down
16 changes: 11 additions & 5 deletions tools/dimred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ int main(int argc, char**argv)
else
{
csv2floats(fdhd,tfpars); fhdpars=tfpars;
std::cerr<<"high-dim pars"<<tfpars<<"\n";
if (tfpars.size()==2)
std::cerr << "high-dim pars";
toolbox::operator<<(std::cerr, tfpars);
std::cerr <<"\n";
if (tfpars.size()==2)
{
iteropts.tfunH.set_mode(NLDRGamma,tfpars);
}
Expand All @@ -160,8 +162,10 @@ int main(int argc, char**argv)
else
{
csv2floats(fdld,tfpars); fldpars=tfpars;
std::cerr<<"lo-dim pars"<<tfpars<<"\n";
if (tfpars.size()==2)
std::cerr<<"lo-dim pars";
toolbox::operator<<(std::cerr, tfpars);
std::cerr <<"\n";
if (tfpars.size()==2)
{
iteropts.tfunL.set_mode(NLDRGamma,tfpars);
}
Expand Down Expand Up @@ -200,7 +204,9 @@ int main(int argc, char**argv)

std::cerr<<"hey "<<itermode<<" "<<iteropts.minmode<<"\n";
std::valarray<double> sat(0.0,2); csv2floats(tempopts,sat);
std::cerr<<" simulated annealing ops: "<<sat<<"\n";
std::cerr << " simulated annealing ops: ";
toolbox::operator<<(std::cerr, sat);
std::cerr<<"\n";
iteropts.saopts.temp_init=sat[0]; iteropts.saopts.temp_final=sat[1];
iteropts.ptopts.temp_init=sat[0]; iteropts.ptopts.temp_final=sat[1];
iteropts.ptopts.temp_factor=ptfac; iteropts.ptopts.replica=npt;
Expand Down