#ifndef MADLIB_DENSE_LINEAR_SYSTEMS_STATES_ #define MADLIB_DENSE_LINEAR_SYSTEMS_STATES_ namespace madlib { namespace modules { namespace linear_systems { using namespace dbal; using namespace madlib::dbal::eigen_integration; template class ResidualState: public DynamicStruct, Container>{ public: typedef DynamicStruct Base; MADLIB_DYNAMIC_STRUCT_TYPEDEFS; ResidualState(Init_type& inInitialization); void bind(ByteStream_type& inStream); template ResidualState& operator=( const ResidualState& inOther); uint64_type numRows; uint16_type widthOfA; double_type residual_norm; double_type b_norm; ColumnVector_type solution; }; // ------------------------------------------------------------------------ template inline ResidualState::ResidualState (Init_type& inInitialization) : Base(inInitialization){ this->initialize(); } // ------------------------------------------------------------------------ template inline void ResidualState::bind(ByteStream_type& inStream){ inStream >> numRows >> widthOfA >> residual_norm >> b_norm; uint16_t actualWidthOfA = widthOfA.isNull() ? 0 : static_cast(widthOfA); inStream >> solution.rebind(actualWidthOfA); } // ------------------------------------------------------------------------ template template inline ResidualState& ResidualState::operator= ( const ResidualState& inOther){ this->copy(inOther); return *this; } } // } // } // #endif