Show a patch.

GET /api/1.1/patches/21934/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21934,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21934/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21934/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20241117221712.29616-5-laurent.pinchart@ideasonboard.com>",
    "date": "2024-11-17T22:17:05",
    "name": "[RFC,04/11] ipa: libipa: vector: Rename the dot product operator*() to dot()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c8d176fbb2ddbd374d5f79672ef7410723f5a3d4",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21934/mbox/",
    "series": [
        {
            "id": 4795,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4795/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4795",
            "date": "2024-11-17T22:17:01",
            "name": "Improve linear algebra helpers in libipa",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4795/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21934/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21934/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 ACFBBC32DF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 17 Nov 2024 22:17:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0BA3658BB;\n\tSun, 17 Nov 2024 23:17:39 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A13F6658AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 17 Nov 2024 23:17:27 +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 4E3437FE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 17 Nov 2024 23:17:11 +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=\"wVIKWXM9\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1731881831;\n\tbh=zj0U/HE1hEYjvElrAo1U+PSICzRsAqaxIBvUOT/Ccpk=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=wVIKWXM9T8pL73jNm4DdHYowj/6HFMPcQP98wVy1HCRtvwNPhcmqX+BRMNPMmTbPj\n\tBlQhuR/6hdblHDNQHM5KVe4BhP+UW9A3XMJL7tRcm5rkmVuNmk7H+93ffmF4X7R7yg\n\t6y7qAAmKBCupERKHrjUWqe9I9JSFOh+eV461xMiU=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[RFC PATCH 04/11] ipa: libipa: vector: Rename the dot product\n\toperator*() to dot()",
        "Date": "Mon, 18 Nov 2024 00:17:05 +0200",
        "Message-ID": "<20241117221712.29616-5-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.2",
        "In-Reply-To": "<20241117221712.29616-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20241117221712.29616-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": "The Vector class defines a set of arithmetic operators between two\nvectors or a vector and a scalar. All the operators perform element-wise\noperations, except for the operator*() that computes the dot product.\nThis is inconsistent and confusing. Replace the operator with a dot()\nfunction.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/libipa/vector.cpp | 14 +++++++-------\n src/ipa/libipa/vector.h   | 16 ++++++++--------\n 2 files changed, 15 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp\nindex df089f8aed9f..b2794c200b05 100644\n--- a/src/ipa/libipa/vector.cpp\n+++ b/src/ipa/libipa/vector.cpp\n@@ -85,13 +85,6 @@ namespace ipa {\n  * \\return The sum of the two vectors\n  */\n \n-/**\n- * \\fn Vector::operator*(const Vector<T, Rows> &other) const\n- * \\brief Compute the dot product\n- * \\param[in] other The other vector\n- * \\return The dot product of the two vectors\n- */\n-\n /**\n  * \\fn Vector::operator*(T factor) const\n  * \\brief Multiply the vector by a scalar\n@@ -106,6 +99,13 @@ namespace ipa {\n  * \\return The vector divided by \\a factor\n  */\n \n+/**\n+ * \\fn Vector::dot(const Vector<T, Rows> &other) const\n+ * \\brief Compute the dot product\n+ * \\param[in] other The other vector\n+ * \\return The dot product of the two vectors\n+ */\n+\n /**\n  * \\fn T &Vector::x()\n  * \\brief Convenience function to access the first element of the vector\ndiff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h\nindex 50e16250acfd..9dabdc28a540 100644\n--- a/src/ipa/libipa/vector.h\n+++ b/src/ipa/libipa/vector.h\n@@ -90,14 +90,6 @@ public:\n \t\treturn ret;\n \t}\n \n-\tconstexpr T operator*(const Vector<T, Rows> &other) const\n-\t{\n-\t\tT ret = 0;\n-\t\tfor (unsigned int i = 0; i < Rows; i++)\n-\t\t\tret += data_[i] * other[i];\n-\t\treturn ret;\n-\t}\n-\n \tconstexpr Vector<T, Rows> operator*(T factor) const\n \t{\n \t\tVector<T, Rows> ret;\n@@ -114,6 +106,14 @@ public:\n \t\treturn ret;\n \t}\n \n+\tconstexpr T dot(const Vector<T, Rows> &other) const\n+\t{\n+\t\tT ret = 0;\n+\t\tfor (unsigned int i = 0; i < Rows; i++)\n+\t\t\tret += data_[i] * other[i];\n+\t\treturn ret;\n+\t}\n+\n #ifndef __DOXYGEN__\n \ttemplate<bool Dependent = false, typename = std::enable_if_t<Dependent || Rows >= 1>>\n #endif /* __DOXYGEN__ */\n",
    "prefixes": [
        "RFC",
        "04/11"
    ]
}