search for: union_test

Displaying 4 results from an estimated 4 matches for "union_test".

2009 Apr 04
1
comparing columns in a dataframe
...code that I have started with. Ideally I would like to identify the actual row numbers where there is difference in the variables (either pairwise or between 3 variables). x <- read.csv("c://rec_compare.csv",header=T, as.is=TRUE) u <- union(x$rm1, x$redc1) write.csv(u,"c:/union_test.csv") i <- intersect(x$rm1, x$redc1) write.csv(i,"c:/intersect_test.csv") sd <- setdiff(x$rm1, x$redc1) write.csv(sd,"c:/setdiff_test.csv") Any suggestions are appreciated. regards Bob
2018 Mar 19
4
RFC: Devirtualization v2
...e virtually no one is using unions this way, this should not cause any problems.struct A { virtual void foo();};struct B : A { void foo() override;};union U { A a; B b; U() : b() {}};void do_call(A &a) { a.foo();}__attribute__((noinline)) void init_B(U &u) { new(&u.b) B;}void union_test(U &u) { do_call(u.b); new(&u.a) A; do_call(u.a); init_B(u); do_call(u.b);}int main() { U u; union_test(u);}Ptr to intIn this example, instead of comparing the pointers we compare the addresses stored in integers. Because ptrtoint conversion will also require call to strip.inva...
2018 Mar 28
0
[cfe-dev] RFC: Devirtualization v2
...> struct B : A { > void foo() override; > }; > > union U { > A a; > B b; > U() : b() {} > }; > > void do_call(A &a) { > a.foo(); > } > > __attribute__((noinline)) void init_B(U &u) { > new(&u.b) B; > } > > void union_test(U &u) { > do_call(u.b); > new(&u.a) A; > do_call(u.a); > > init_B(u); > do_call(u.b); > > } > > int main() { > U u; > union_test(u); > } > Ptr to int > In this example, instead of comparing the pointers we compare the addr...
2018 Mar 29
2
[cfe-dev] RFC: Devirtualization v2
...s using unions this way, this should not cause any problems.struct > A { virtual void foo();};struct B : A { void foo() override;};union U { > A a; B b; U() : b() {}};void do_call(A &a) { > a.foo();}__attribute__((noinline)) void init_B(U &u) { new(&u.b) > B;}void union_test(U &u) { do_call(u.b); new(&u.a) A; do_call(u.a); > init_B(u); do_call(u.b);}int main() { U u; union_test(u);}Ptr to > intIn this example, instead of comparing the pointers we compare the > addresses stored in integers. Because ptrtoint conversion will also require &gt...