search for: uniquevalu

Displaying 2 results from an estimated 2 matches for "uniquevalu".

Did you mean: uniquevalue
2012 Aug 28
5
return first index for each unique value in a vector
I would like to efficiently find the first index of each unique value in a very large vector. For example, if I have a vector A<-c(9,2,9,5) I would like to return not only the unique values (2,5,9) but also their first indices (2,4,1). I tried using a for loop with which(A==unique(A)[i])[1] to find the first index of each unique value but it is very slow. What I am trying to do is easily
2012 Jul 25
1
[LLVMdev] [RFC] YAML I/O
...an readable values for colors and flags, rather than just the integer value used internally. To handle that, you define conversion tables and hand them to YAMLIO. For instance: using llvm::yaml::IO; using llvm::yaml::Input; using llvm::yaml::Output; using llvm::yaml::YamlMap; using llvm::yaml::UniqueValue; using llvm::yaml::BitValue; static const UniqueValue<Colors> colorConversions[] = { {cRed, "red"}, {cBlue, "blue"}, {cGreen, "green"}, {cRed, NULL} // default value for optional keys }; static const BitValue<uint32_t> flagConversio...