/* ----------------------------------------------------------------------- *//** * * @file WeightedSample_proto.hpp * *//* ----------------------------------------------------------------------- */ #ifndef MADLIB_MODULES_SAMPLE_WEIGHTED_SAMPLE_PROTO_HPP #define MADLIB_MODULES_SAMPLE_WEIGHTED_SAMPLE_PROTO_HPP namespace madlib { namespace modules { namespace sample { // Use Eigen using namespace dbal; using namespace dbal::eigen_integration; template struct WeightedSampleHeader { }; template struct WeightedSampleHeader { typename DynamicStructType::type width; }; template class WeightedSampleAccumulator : public DynamicStruct, Container> { public: typedef DynamicStruct Base; MADLIB_DYNAMIC_STRUCT_TYPEDEFS; typedef std::tuple tuple_type; WeightedSampleAccumulator(Init_type& inInitialization); void bind(ByteStream_type& inStream); WeightedSampleAccumulator& operator<<(const tuple_type& inTuple); template WeightedSampleAccumulator& operator<<( const WeightedSampleAccumulator& inOther); template WeightedSampleAccumulator& operator=( const WeightedSampleAccumulator& inOther); double_type weight_sum; WeightedSampleHeader header; typename DynamicStructType::type sample; }; } // namespace sample } // namespace modules } // namespace madlib #endif // defined(MADLIB_MODULES_SAMPLE_WEIGHTED_SAMPLE_PROTO_HPP)