// Copyright 2005, Ondra Kamenik #include "korder_stoch.hh" /* Same as |@<|MatrixA| constructor code@>|, but the submatrix |gss_ys| is passed directly. */ MatrixAA::MatrixAA(const FSSparseTensor &f, const IntSequence &ss, const TwoDMatrix &gss_ys, const PartitionY &ypart) : PLUMatrix(ypart.ny()) { zeros(); IntSequence c(1); c[0] = 1; FGSTensor f_y(f, ss, c, TensorDimens(ss, c)); add(1.0, f_y); c[0] = 0; FGSTensor f_yss(f, ss, c, TensorDimens(ss, c)); TwoDMatrix sub(*this, ypart.nstat, ypart.nys()); sub.multAndAdd(f_yss, gss_ys); calcPLU(); } // |KOrderStoch| folded constructor code KOrderStoch::KOrderStoch(const PartitionY &yp, int nu, const TensorContainer &fcont, const FGSContainer &hh, Journal &jr) : nvs{yp.nys(), nu, nu, 1}, ypart(yp), journal(jr), _ug(4), _fg(4), _ugs(4), _fgs(4), _uG(4), _fG(4), _uh(nullptr), _fh(&hh), _uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu), _fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu), _uGstack(&_ugs, ypart.nys(), nu), _fGstack(&_fgs, ypart.nys(), nu), f(fcont), matA(fcont.get(Symmetry{1}), _uZstack.getStackSizes(), hh.get(Symmetry{1, 0, 0, 0}), ypart) { } // |KOrderStoch| unfolded constructor code KOrderStoch::KOrderStoch(const PartitionY &yp, int nu, const TensorContainer &fcont, const UGSContainer &hh, Journal &jr) : nvs{yp.nys(), nu, nu, 1}, ypart(yp), journal(jr), _ug(4), _fg(4), _ugs(4), _fgs(4), _uG(4), _fG(4), _uh(&hh), _fh(nullptr), _uZstack(&_uG, ypart.nyss(), &_ug, ypart.ny(), ypart.nys(), nu), _fZstack(&_fG, ypart.nyss(), &_fg, ypart.ny(), ypart.nys(), nu), _uGstack(&_ugs, ypart.nys(), nu), _fGstack(&_fgs, ypart.nys(), nu), f(fcont), matA(fcont.get(Symmetry{1}), _uZstack.getStackSizes(), hh.get(Symmetry{1, 0, 0, 0}), ypart) { } // |KOrderStoch| convenience method specializations template<> ctraits::Tg& KOrderStoch::g() { return _ug; } template<> const ctraits::Tg& KOrderStoch::g() const { return _ug;} template<> ctraits::Tg& KOrderStoch::g() { return _fg; } template<> const ctraits::Tg& KOrderStoch::g() const { return _fg;} template<> ctraits::Tgs& KOrderStoch::gs() { return _ugs; } template<> const ctraits::Tgs& KOrderStoch::gs() const { return _ugs;} template<> ctraits::Tgs& KOrderStoch::gs() { return _fgs; } template<> const ctraits::Tgs& KOrderStoch::gs() const { return _fgs;} template<> const ctraits::Tgss& KOrderStoch::h() const { return *_uh;} template<> const ctraits::Tgss& KOrderStoch::h() const { return *_fh;} template<> ctraits::TG& KOrderStoch::G() { return _uG; } template<> const ctraits::TG& KOrderStoch::G() const { return _uG;} template<> ctraits::TG& KOrderStoch::G() { return _fG; } template<> const ctraits::TG& KOrderStoch::G() const { return _fG;} template<> ctraits::TZXstack& KOrderStoch::Zstack() { return _uZstack; } template<> const ctraits::TZXstack& KOrderStoch::Zstack() const { return _uZstack;} template<> ctraits::TZXstack& KOrderStoch::Zstack() { return _fZstack; } template<> const ctraits::TZXstack& KOrderStoch::Zstack() const { return _fZstack;} template<> ctraits::TGXstack& KOrderStoch::Gstack() { return _uGstack; } template<> const ctraits::TGXstack& KOrderStoch::Gstack() const { return _uGstack;} template<> ctraits::TGXstack& KOrderStoch::Gstack() { return _fGstack; } template<> const ctraits::TGXstack& KOrderStoch::Gstack() const { return _fGstack;}