#ifndef __SRC_LIB_REDUCEDGRADIENT_HPP__ #define __SRC_LIB_REDUCEDGRADIENT_HPP__ #include "basis.hpp" #include "runtime.hpp" #include "vector.hpp" class ReducedGradient { Vector rg; bool uptodate = false; Gradient& gradient; Basis& basis; void recompute() { rg.dim = basis.getinactive().size(); basis.Ztprod(gradient.getGradient(), rg); uptodate = true; } public: ReducedGradient(Runtime& rt, Basis& bas, Gradient& grad) : rg(rt.instance.num_var), gradient(grad), basis(bas) {} Vector& get() { if (!uptodate) { recompute(); } return rg; } void reduce(const Vector& buffer_d, const HighsInt maxabsd) { if (!uptodate) { return; } // Vector r(rg.dim-1); // for (HighsInt col=0; col