#ifndef MADLIB_CLUSTERED_ERRORS_ #define MADLIB_CLUSTERED_ERRORS_ namespace madlib { namespace modules { namespace regress { using namespace dbal; using namespace madlib::dbal::eigen_integration; template class ClusteredState: public DynamicStruct, Container> { public: typedef DynamicStruct Base; MADLIB_DYNAMIC_STRUCT_TYPEDEFS; ClusteredState(Init_type& inInitialization); void bind(ByteStream_type& inStream); template ClusteredState& operator=( const ClusteredState& inOther); uint64_type numRows; uint16_type widthOfX; uint16_type numCategories; uint16_type refCategory; ColumnVector_type coef; Matrix_type bread; Matrix_type meat_half; }; // ------------------------------------------------------------------------ template inline ClusteredState::ClusteredState (Init_type& inInitialization) : Base(inInitialization) { this->initialize(); } // ------------------------------------------------------------------------ template inline void ClusteredState::bind(ByteStream_type& inStream) { inStream >> numRows >> widthOfX >> numCategories >> refCategory; uint16_t actualWidthOfX = widthOfX.isNull() ? static_cast(0) : static_cast(widthOfX); inStream >> coef.rebind(actualWidthOfX) >> meat_half.rebind(1, actualWidthOfX) >> bread.rebind(actualWidthOfX, actualWidthOfX); } // ------------------------------------------------------------------------ template template inline ClusteredState& ClusteredState::operator= ( const ClusteredState& inOther) { this->copy(inOther); return *this; } } } } #endif