Signature | Description | Parameters |
---|---|---|
template<typename ... Ts> bool is_equal(const DataFrame &rhs) const; |
It compares self with rhs. If both have the same indices, same number of columns, same names for each column, and all columns are equal, then it returns true. Otherwise it returns false |
Ts: The list of types for all columns. A type should be specified only once. rhs: The other DataFrame |
dfx.multi_visit(std::make_pair("xint_col", &ivisitor2), std::make_pair("dbl_col", &dvisitor2), std::make_pair("dbl_col_2", &dvisitor22), std::make_pair("ul_col", &ulvisitor)); assert(ivisitor2.get_result() == 19); assert(fabs(dvisitor2.get_result() - 4.5696) < 0.0001); assert(fabs(dvisitor22.get_result() - 0.0264609) < 0.00001); assert(ulvisitor.get_result() == 123448); const MyDataFrame dfx_c = dfx; dfx_c.multi_visit(std::make_pair("xint_col", &ivisitor2), std::make_pair("dbl_col", &dvisitor2), std::make_pair("dbl_col_2", &dvisitor22), std::make_pair("ul_col", &ulvisitor)); assert(ivisitor2.get_result() == 19); assert(fabs(dvisitor2.get_result() - 4.5696) < 0.0001); assert(fabs(dvisitor22.get_result() - 0.0264609) < 0.00001); assert(ulvisitor.get_result() == 123448); MyDataFrame df_copy_con = dfx; assert((df_copy_con.is_equal<int, unsigned long, double, std::string>(dfx))); assert((! df_copy_con.is_equal<int, unsigned long, double, std::string>(dfxx))); df_copy_con.get_column<double>("dbl_col")[7] = 88.888888; assert(dfx.get_column<double>("dbl_col")[7] == 10.0); assert(fabs(df_copy_con.get_column<double>("dbl_col")[7] - 88.888888) < 0.00001); assert(! (df_copy_con.is_equal<int, unsigned long, double, std::string>(dfx)));