Show a patch.

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

{
    "id": 20345,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/20345/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20345/",
    "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": "<20240616174541.10708-5-laurent.pinchart@ideasonboard.com>",
    "date": "2024-06-16T17:45:41",
    "name": "[v10,4/4] ipa: libipa: vector: Add matrix-vector multiplication",
    "commit_ref": "01a33fedf6cdbb99c2b0316462a5578bb1b4b434",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8bc81fbc928323e3310f79fdfde2a88d780e80c1",
    "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/20345/mbox/",
    "series": [
        {
            "id": 4401,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4401/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4401",
            "date": "2024-06-16T17:45:37",
            "name": "ipa: rkisp1: Add crosstalk algorithm",
            "version": 10,
            "mbox": "https://patchwork.libcamera.org/series/4401/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20345/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20345/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 66DE9C32D0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 16 Jun 2024 17:46:15 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BDC8F65493;\n\tSun, 16 Jun 2024 19:46:14 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4157F65489\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 16 Jun 2024 19:46:09 +0200 (CEST)",
            "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 BF4652D5;\n\tSun, 16 Jun 2024 19:45:52 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LT53VQdh\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718559952;\n\tbh=NdUij6PJHSPgcDitQ/3pZgzqjn82tJfGLWD7hV0NMHM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=LT53VQdhlzQR5PdvAnH9KorP0g6u0dkaBLV+xP7cVFe3r+p0HkPgvI++VaHqu6xQO\n\tG7/6aEiofEmtT/BQ4aD/HvUrXn/+MS4T0riHIt2SMAs7lqzq0Ixs2xOTvgYmbH6qaX\n\tcg0eWw5EOhdCcAMGrZzQMA1buKsop71HjW+BDvYc=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>",
        "Subject": "[PATCH v10 4/4] ipa: libipa: vector: Add matrix-vector\n\tmultiplication",
        "Date": "Sun, 16 Jun 2024 20:45:41 +0300",
        "Message-ID": "<20240616174541.10708-5-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.2",
        "In-Reply-To": "<20240616174541.10708-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240616174541.10708-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": "From: Paul Elder <paul.elder@ideasonboard.com>\n\nAdd an operation for multiplying a matrix with a vector.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\nChanges since v3:\n\n- Drop unneeded __DOXYGEN__ guard\n\nChanges in v3:\n- make SFINAE more concise\n\nChanges in v2:\n- s/D/Rows/ in Vector class\n---\n src/ipa/libipa/vector.cpp | 11 +++++++++++\n src/ipa/libipa/vector.h   | 17 +++++++++++++++++\n 2 files changed, 28 insertions(+)",
    "diff": "diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp\nindex b071b261b9c4..bd00b01961d5 100644\n--- a/src/ipa/libipa/vector.cpp\n+++ b/src/ipa/libipa/vector.cpp\n@@ -123,6 +123,17 @@ namespace ipa {\n  * \\return The length of the vector\n  */\n \n+/**\n+ * \\fn Vector<T, Rows> operator*(const Matrix<T, Rows, Cols> &m, const Vector<T, Cols> &v)\n+ * \\brief Multiply a matrix by a vector\n+ * \\tparam T Numerical type of the contents of the matrix and vector\n+ * \\tparam Rows The number of rows in the matrix\n+ * \\tparam Cols The number of columns in the matrix (= rows in the vector)\n+ * \\param m The matrix\n+ * \\param v The vector\n+ * \\return Product of matrix \\a m and vector \\a v\n+ */\n+\n /**\n  * \\fn bool operator==(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)\n  * \\brief Compare vectors for equality\ndiff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h\nindex 2a2906202ce4..556e0967c869 100644\n--- a/src/ipa/libipa/vector.h\n+++ b/src/ipa/libipa/vector.h\n@@ -16,6 +16,8 @@\n \n #include \"libcamera/internal/yaml_parser.h\"\n \n+#include \"matrix.h\"\n+\n namespace libcamera {\n \n LOG_DECLARE_CATEGORY(Vector)\n@@ -140,6 +142,21 @@ private:\n \tstd::array<T, Rows> data_;\n };\n \n+template<typename T, unsigned int Rows, unsigned int Cols>\n+Vector<T, Rows> operator*(const Matrix<T, Rows, Cols> &m, const Vector<T, Cols> &v)\n+{\n+\tVector<T, Rows> result;\n+\n+\tfor (unsigned int i = 0; i < Rows; i++) {\n+\t\tT sum = 0;\n+\t\tfor (unsigned int j = 0; j < Cols; j++)\n+\t\t\tsum += m[i][j] * v[j];\n+\t\tresult[i] = sum;\n+\t}\n+\n+\treturn result;\n+}\n+\n template<typename T, unsigned int Rows>\n bool operator==(const Vector<T, Rows> &lhs, const Vector<T, Rows> &rhs)\n {\n",
    "prefixes": [
        "v10",
        "4/4"
    ]
}