Commit a3da68d8 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

WftStacksOnDisk: work in progress

parent f645b81a
......@@ -91,6 +91,17 @@ public:
}
}
void read(PsimagLite::String prefix, PsimagLite::IoNgSerializer& io)
{
err("read\n");
}
void write(PsimagLite::String prefix, PsimagLite::IoNgSerializer& io) const
{
err("write\n");
}
template<typename StackType1,typename StackType2>
static void loadStack(StackType1& stackInMemory, StackType2& stackInDisk)
{
......
......@@ -136,6 +136,9 @@ public:
progress_("WaveFunctionTransf"),
filenameIn_(params.checkpoint.filename()),
filenameOut_(params.filename),
waveStructCombined_(params.options.isSet("wftstacksondisk"),
params.filename,
params.options.isSet("observe")),
wftImpl_(0),
rng_(3433117),
noLoad_(false),
......
......@@ -3,6 +3,7 @@
#include "Io/IoNg.h"
#include "WaveStructSvd.h"
#include "ProgramGlobals.h"
#include "../DiskOrMemoryStack.h"
namespace Dmrg {
......@@ -20,10 +21,15 @@ public:
typedef typename WaveStructSvdType::VectorQnType VectorQnType;
typedef typename BasisWithOperatorsType::BasisType BasisType;
typedef typename BasisType::BlockType VectorSizeType;
typedef typename PsimagLite::Stack<WaveStructSvdType>::Type WftStackType;
WaveStructCombined()
: lrs_("pSE", "pSprime", "pEprime"), needsPop_(false)
typedef DiskOrMemoryStack<WaveStructSvdType> WftStackType;
WaveStructCombined(bool onDisk,
const PsimagLite::String filename,
bool isObserveCode)
: lrs_("pSE", "pSprime", "pEprime"),
wsStack_(onDisk, filename, "system", isObserveCode),
weStack_(onDisk, filename, "environ", isObserveCode),
needsPop_(false)
{}
void read(PsimagLite::IoNg::In& io, PsimagLite::String prefix)
......@@ -36,10 +42,10 @@ public:
void write(PsimagLite::IoNg::Out& io, PsimagLite::String prefix) const
{
writePartial(io, prefix);
WftStackType wsStack = wsStack_;
io.write(wsStack, prefix + "/wsStack");
WftStackType weStack = weStack_;
io.write(weStack, prefix + "/weStack");
// WftStackType wsStack = wsStack_;
io.write(wsStack_, prefix + "/wsStack");
// WftStackType weStack = weStack_;
io.write(weStack_, prefix + "/weStack");
}
void write(PsimagLite::IoNg::Out& io, PsimagLite::String prefix)
......
......@@ -80,6 +80,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#define WAVE_STRUCT_SVD_H
#include "ProgramGlobals.h"
#include "Vector.h"
#include "Io/IoNg.h"
namespace Dmrg {
......@@ -101,9 +102,17 @@ struct WaveStructSvd {
typedef typename PsimagLite::Matrix<SparseElementType> MatrixType;
typedef typename PsimagLite::Vector<MatrixType>::Type VectorMatrixType;
typedef typename BasisWithOperatorsType::VectorQnType VectorQnType;
typedef typename PsimagLite::IoNg::In IoInType;
enum class SaveEnum {ALL};
WaveStructSvd() {}
WaveStructSvd(IoInType& io, PsimagLite::String label, bool)
{
read(label, io.serializer());
}
WaveStructSvd(const BlockDiagonalMatrixType& u,
const VectorMatrixType& vts,
const VectorVectorRealType& s,
......@@ -135,7 +144,10 @@ struct WaveStructSvd {
QnType::readVector(qns_, prefix + "/qns", io);
}
void write(PsimagLite::IoNg::Out& io, PsimagLite::String prefix) const
void write(PsimagLite::IoNg::Out& io,
PsimagLite::String prefix,
PsimagLite::IoNgSerializer::WriteMode writeMode,
SaveEnum) const
{
io.createGroup(prefix);
io.write(u_, prefix + "/u");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment