{"id":22002,"url":"https://patchwork.libcamera.org/api/patches/22002/?format=json","web_url":"https://patchwork.libcamera.org/patch/22002/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20241119121928.30939-5-laurent.pinchart@ideasonboard.com>","date":"2024-11-19T12:19:15","name":"[v4,04/17] ipa: libipa: vector: Add copy constructor and assignment operator","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"e2ff9144a6b52f7f1efc923b7397cb87217d6fb4","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22002/mbox/","series":[{"id":4804,"url":"https://patchwork.libcamera.org/api/series/4804/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4804","date":"2024-11-19T12:19:11","name":"Improve linear algebra helpers in libipa","version":4,"mbox":"https://patchwork.libcamera.org/series/4804/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22002/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22002/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 51C7EC32F3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 12:19:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E013065F1E;\n\tTue, 19 Nov 2024 13:19:55 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9733B65F17\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 13:19:52 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 10E34D49\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 13:19:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FS5SazD5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732018775;\n\tbh=5Zv5KgDrmGIcqXYK6hyPDOV8YehMaKAZxQowAfWz/9c=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=FS5SazD51sXlLkttyV+dSxJQ0Yp/5GKKdrhzp9Qf35gldqkYslcXpS11l+ePcC2Gh\n\tngGUU6wXPg4QzUdr851qhqtra+32e1CXpJj4iOhysb5BLMQxwghdzb71LsLAAeA75v\n\tWrE8Alz4yubFMnBS088c8yhkw249cHtM/P6RLP2c=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v4 04/17] ipa: libipa: vector: Add copy constructor and\n\tassignment operator","Date":"Tue, 19 Nov 2024 14:19:15 +0200","Message-ID":"<20241119121928.30939-5-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.45.2","In-Reply-To":"<20241119121928.30939-1-laurent.pinchart@ideasonboard.com>","References":"<20241119121928.30939-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"It is useful to assign a value to an existing vector. Define a copy\nconstructor and a copy assignment operator.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n---\nChanges since v3:\n\n- Default both functions\n\nChanges since v2:\n\n- Make copy constructor constexpr\n- Drop #include <algorithm>\n---\n src/ipa/libipa/vector.cpp | 13 +++++++++++++\n src/ipa/libipa/vector.h   |  4 ++++\n 2 files changed, 17 insertions(+)","diff":"diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp\nindex 5851b9ae2ed3..a9779fa2b8e2 100644\n--- a/src/ipa/libipa/vector.cpp\n+++ b/src/ipa/libipa/vector.cpp\n@@ -46,6 +46,19 @@ namespace ipa {\n  * The size of \\a data must be equal to the dimension size Rows of the vector.\n  */\n \n+/**\n+ * \\fn Vector::Vector(const Vector &other)\n+ * \\brief Construct a Vector by copying \\a other\n+ * \\param[in] other The other Vector value\n+ */\n+\n+/**\n+ * \\fn Vector &Vector::operator=(const Vector &other)\n+ * \\brief Replace the content of the Vector with a copy of the content of \\a other\n+ * \\param[in] other The other Vector value\n+ * \\return This Vector value\n+ */\n+\n /**\n  * \\fn T Vector::operator[](size_t i) const\n  * \\brief Index to an element in the vector\ndiff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h\nindex 5fb7ad7c95dd..1022550e6170 100644\n--- a/src/ipa/libipa/vector.h\n+++ b/src/ipa/libipa/vector.h\n@@ -46,6 +46,10 @@ public:\n \t\t\tdata_[i] = data[i];\n \t}\n \n+\tconstexpr Vector(const Vector &other) = default;\n+\n+\tVector &operator=(const Vector &other) = default;\n+\n \tconst T &operator[](size_t i) const\n \t{\n \t\tASSERT(i < data_.size());\n","prefixes":["v4","04/17"]}