Show a patch.

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

{
    "id": 20323,
    "url": "https://patchwork.libcamera.org/api/patches/20323/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20323/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20240614120211.184588-1-paul.elder@ideasonboard.com>",
    "date": "2024-06-14T12:02:11",
    "name": "[v3] ipa: libipa: vector: Add matrix-vector multiplication",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "f71cab6f974ba268ddff93dd96ad3cb7aa205eb4",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20323/mbox/",
    "series": [
        {
            "id": 4396,
            "url": "https://patchwork.libcamera.org/api/series/4396/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4396",
            "date": "2024-06-14T12:02:11",
            "name": "[v3] ipa: libipa: vector: Add matrix-vector multiplication",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4396/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20323/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20323/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 634A3C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Jun 2024 12:02:27 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9FE6165489;\n\tFri, 14 Jun 2024 14:02:26 +0200 (CEST)",
            "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 AC0CF61A2A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Jun 2024 14:02:24 +0200 (CEST)",
            "from neptunite.hamster-moth.ts.net\n\t(h175-177-049-156.catv02.itscom.jp [175.177.49.156])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DD5B2DCE;\n\tFri, 14 Jun 2024 14:02:08 +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=\"g25CNozd\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1718366529;\n\tbh=Oo3SY/kBHrwJ+K2H6Szk6oYGSHTyCzT6uJ1Xypilliw=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=g25CNozdhPxv+aj9ojeVJQBSIKLfiRrCuEvQYFK1Opjji9TGttanTsX58LfppSHlL\n\tjCQOwcmP9qbQCWl6XrYb8UObpxE4OQT2gyCX/JKUTGrEiVjY42mBISCHBI5S2ibMGT\n\tMbATpMa6FhouHEqUaZ6SyNKiR90CoMWCM8VUiolQ=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Paul Elder <paul.elder@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>",
        "Subject": "[PATCH v3] ipa: libipa: vector: Add matrix-vector multiplication",
        "Date": "Fri, 14 Jun 2024 21:02:11 +0900",
        "Message-Id": "<20240614120211.184588-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "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": "Add 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>\n\n---\nChanges in v3:\n- make SFINAE more concise\n\nChanges in v2:\n- s/D/Rows/ in Vector class\n\nDepends on v9 of \"ipa: libipa: Add Matrix class\"\n---\n src/ipa/libipa/vector.cpp | 11 +++++++++++\n src/ipa/libipa/vector.h   | 19 +++++++++++++++++++\n 2 files changed, 30 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..bc7acc9d0a27 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,23 @@ private:\n \tstd::array<T, Rows> data_;\n };\n \n+#ifndef __DOXYGEN__\n+template<typename T, unsigned int Rows, unsigned int Cols>\n+#endif /* __DOXYGEN__ */\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": [
        "v3"
    ]
}