================
@@ -71,20 +71,43 @@ inline bool fromJSON(const llvm::json::Value &E, Embedding
&Out,
// Embedding
//===----------------------------------------------------------------------===//
+Embedding Embedding::operator+(const Embedding &RHS) const {
+ assert(this->size() == RHS.size() && "Vectors must have the same dimension");
+ Embedding Result(*this);
+ std::transform(this->begin(), this->end(), RHS.begin(), Result.begin(),
+ std::plus<double>());
+ return Result;
+}
+
Embedding &Embedding::operator+=(const Embedding &RHS) {
assert(this->size() == RHS.size() && "Vectors must have the same dimension");
----------------
mtrofin wrote:
can you implement the <operator>= variants in terms of the <operator>?
https://github.com/llvm/llvm-project/pull/145118
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits