[{"id":32291,"web_url":"https://patchwork.libcamera.org/comment/32291/","msgid":"<87iksjf9f4.fsf@redhat.com>","date":"2024-11-19T16:57:51","subject":"Re: [PATCH v4 03/17] ipa: libipa: vector: Add scalar constructor","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Laurent Pinchart <laurent.pinchart@ideasonboard.com> writes:\n\n> The default constructor leaves the vector data uninitialized. Add a\n> constructor to fill the vector with copies of a scalar value, and fix\n> the documentation of the default constructor.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n\n> ---\n> Changes since v3:\n>\n> - Make the constructor explicit\n> ---\n>  src/ipa/libipa/vector.cpp | 8 +++++++-\n>  src/ipa/libipa/vector.h   | 5 +++++\n>  2 files changed, 12 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp\n> index 0f0511da151f..5851b9ae2ed3 100644\n> --- a/src/ipa/libipa/vector.cpp\n> +++ b/src/ipa/libipa/vector.cpp\n> @@ -29,7 +29,13 @@ namespace ipa {\n>  \n>  /**\n>   * \\fn Vector::Vector()\n> - * \\brief Construct a zero vector\n> + * \\brief Construct an uninitialized vector\n> + */\n> +\n> +/**\n> + * \\fn Vector::Vector(T scalar)\n> + * \\brief Construct a vector filled with a \\a scalar value\n> + * \\param[in] scalar The scalar value\n>   */\n>  \n>  /**\n> diff --git a/src/ipa/libipa/vector.h b/src/ipa/libipa/vector.h\n> index 3168835bc13d..5fb7ad7c95dd 100644\n> --- a/src/ipa/libipa/vector.h\n> +++ b/src/ipa/libipa/vector.h\n> @@ -35,6 +35,11 @@ class Vector\n>  public:\n>  \tconstexpr Vector() = default;\n>  \n> +\tconstexpr explicit Vector(T scalar)\n> +\t{\n> +\t\tdata_.fill(scalar);\n> +\t}\n> +\n>  \tconstexpr Vector(const std::array<T, Rows> &data)\n>  \t{\n>  \t\tfor (unsigned int i = 0; i < Rows; i++)","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 3390DC326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Nov 2024 16:58:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5402C65F2A;\n\tTue, 19 Nov 2024 17:58:03 +0100 (CET)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 180B2658A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 17:58:00 +0100 (CET)","from mail-ej1-f71.google.com (mail-ej1-f71.google.com\n\t[209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-150-INGJS5wCOD6uMfERhH9uQQ-1; Tue, 19 Nov 2024 11:57:56 -0500","by mail-ej1-f71.google.com with SMTP id\n\ta640c23a62f3a-a9a1be34c68so421134666b.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Nov 2024 08:57:55 -0800 (PST)","from nuthatch ([2a00:102a:400a:489a:34bf:5bf1:e776:7185])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-aa20df5696fsm664397466b.77.2024.11.19.08.57.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 19 Nov 2024 08:57:52 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"S2PP3Ts/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1732035478;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=r3bOFrNYo7KaxXXciP//SVknEM+TrnvibwHnqn2ezpo=;\n\tb=S2PP3Ts/L2LYI3alvSc46kvXAKLJVRuWQkGuIPTTMbP+j1Zn9E+N4gPw48Qxs2BvP+wmg3\n\tV2MxT5ALyw98l7BMPT0GTrPdnI7sqN4XEwXaS2rRneze0qTOdAmOMFUOzO2yf+RrbmWlxZ\n\t48haY5qdv8o0kIDA8xldnhMLIw+z46s=","X-MC-Unique":"INGJS5wCOD6uMfERhH9uQQ-1","X-Mimecast-MFC-AGG-ID":"INGJS5wCOD6uMfERhH9uQQ","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1732035473; x=1732640273;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=r3bOFrNYo7KaxXXciP//SVknEM+TrnvibwHnqn2ezpo=;\n\tb=MhNI2vCZr8Dd0mWlKSote17cE4aYeCq14eXmJY+su8qa0tcMbRnWekrGvCO1MrBLPF\n\tDy7xlizwp64rwzcakytOUzZhaQwXmTCweRs0rIeyWVJvGscNHMsOtCj5e97XI8+soxUf\n\tXmbvIiwhQh4sQE0UVZpf6ieOGVnsM0SsXyTkZyoYy7zLyy/du2/brJQqdKavLemEIWgq\n\tSX6lLE2p0VcAEc2gWsnAhgMjFck8ExLOzZAwxediiJE9eceB7Ezgkg4HZiRGlJJQdY4B\n\tCDyqdsjl02OmXOhqTWJz3qeI0/ji3UDg69ZVi/8cn6O7j92PQ+1q/XIAsWB8OUa6c+/+\n\tBh/g==","X-Gm-Message-State":"AOJu0YwevEP7JdfqJ+CNJJ7m5oe0lig1dSkBWVB6W6cXxgAZdaAFD+e6\n\t6o4ezkRuag7GetpuBJ0CU8HSwxsHcEocbbogB9H9H2Lf2jMmqlynvrcVTf4xo4zPMz8eZK9EAmW\n\th31YfcsmpPgWFp3d0HvMwMHf+TnHITi9pkg5vSlN/kvt7BFLm1Wjp7dxSont4o+o29PFHLRJdRo\n\t1nY4fPN7LEsEqttaGrleqcQ4FeihdPJxCM6DVmmSQ57pWHTThthKo7SRo=","X-Received":["by 2002:a17:907:3181:b0:a99:fb10:1285 with SMTP id\n\ta640c23a62f3a-aa483410db2mr1541682166b.20.1732035473347; \n\tTue, 19 Nov 2024 08:57:53 -0800 (PST)","by 2002:a17:907:3181:b0:a99:fb10:1285 with SMTP id\n\ta640c23a62f3a-aa483410db2mr1541679966b.20.1732035472892; \n\tTue, 19 Nov 2024 08:57:52 -0800 (PST)"],"X-Google-Smtp-Source":"AGHT+IExv0UcE0RxqOtnCbmzrTVynKrV4JE+sESvRVjPOaUQzMXhshb/4PD9WWu4mJPEaY5OzK1WYQ==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v4 03/17] ipa: libipa: vector: Add scalar constructor","In-Reply-To":"<20241119121928.30939-4-laurent.pinchart@ideasonboard.com>\n\t(Laurent Pinchart's message of \"Tue, 19 Nov 2024 14:19:14 +0200\")","References":"<20241119121928.30939-1-laurent.pinchart@ideasonboard.com>\n\t<20241119121928.30939-4-laurent.pinchart@ideasonboard.com>","Date":"Tue, 19 Nov 2024 17:57:51 +0100","Message-ID":"<87iksjf9f4.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"KUD6nCDXwcx5v6kjERwVqgyoRO5T0ik1EEsEoa7lecI_1732035474","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]