Commit 2d7de1d5 authored by Alvarez, Gonzalo's avatar Alvarez, Gonzalo
Browse files

observe ManyPointAction in separate file

parent c5b67a06
......@@ -184,6 +184,7 @@ hence non-trivial.
1300) SpinOrbitalModel
1302) 4 sites one symmetry
1304) 4 sites two symmetries
1306) Spinorbital: (Si.Sj)(Li.Lj)^2
#1301-1400 reserved for SpinOrbitalModel
1500) Figure 1 of METTS paper
InternalControlNumber: 40
......
#ifndef MANYPOINTACTION_H
#define MANYPOINTACTION_H
#include "PredicateAwesome.h"
namespace Dmrg {
class ManyPointAction {
public:
typedef PsimagLite::PredicateAwesome<> PredicateAwesomeType;
typedef PsimagLite::ExpressionCalculator<int> ExpressionCalculatorType;
typedef PsimagLite::PrepassData<int> PrepassDataType;
typedef PsimagLite::ExpressionPrepass<PrepassDataType> ExpressionPrepassType;
ManyPointAction(bool hasNonTrivialAction,
PsimagLite::String actionString)
: nonTrivial_(hasNonTrivialAction),
actionString_(actionString)
{}
bool operator()(SizeType s0, SizeType s1, SizeType s2, SizeType s3) const
{
if (!nonTrivial_) return true;
PredicateAwesomeType pred(actionString_, '~');
return pred.isTrue("%0", s0, "%1", s1, "%2", s2, "%3", s3);
}
private:
bool nonTrivial_;
PsimagLite::String actionString_;
};
}
#endif // MANYPOINTACTION_H
......@@ -109,7 +109,7 @@ public:
typedef typename ObserverType::BraketType BraketType;
typedef PsimagLite::Vector<SizeType>::Type VectorSizeType;
typedef std::pair<SizeType,SizeType> PairSizeType;
typedef typename ObserverType::ManyPointAction ManyPointActionType;
typedef typename ObserverType::ManyPointActionType ManyPointActionType;
template<typename IoInputter>
ObservableLibrary(IoInputter& io,
......
......@@ -92,6 +92,7 @@ DISCLOSED WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS.
#include "Utils.h"
#include "ExpressionCalculator.h"
#include "PredicateAwesome.h"
#include "ManyPointAction.h"
namespace Dmrg {
......@@ -121,35 +122,7 @@ public:
typedef VectorWithOffsetType_ VectorWithOffsetType;
typedef Parallel4PointDs<ModelType,FourPointCorrelationsType> Parallel4PointDsType;
typedef PsimagLite::Vector<PsimagLite::String>::Type VectorStringType;
typedef PsimagLite::PredicateAwesome<> PredicateAwesomeType;
class ManyPointAction {
public:
typedef PsimagLite::ExpressionCalculator<int> ExpressionCalculatorType;
typedef PsimagLite::PrepassData<int> PrepassDataType;
typedef PsimagLite::ExpressionPrepass<PrepassDataType> ExpressionPrepassType;
ManyPointAction(bool hasNonTrivialAction,
PsimagLite::String actionString)
: nonTrivial_(hasNonTrivialAction),
actionString_(actionString)
{}
bool operator()(SizeType s0, SizeType s1, SizeType s2, SizeType s3) const
{
if (!nonTrivial_) return true;
PredicateAwesomeType pred(actionString_, '~');
return pred.isTrue("%0", s0, "%1", s1, "%2", s2, "%3", s3);
}
private:
bool nonTrivial_;
PsimagLite::String actionString_;
};
typedef ManyPointAction ManyPointActionType;
Observer(IoInputType& io,
SizeType start,
......
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