[PATCH v6 1/4] ipa: libipa: Add Vector class
Kieran Bingham
kieran.bingham at ideasonboard.com
Mon Jun 10 12:49:58 CEST 2024
Quoting David Plowman (2024-06-10 11:33:39)
> Hi Paul
>
> Thank you for this patch.
>
> On Mon, 10 Jun 2024 at 11:21, Kieran Bingham
> <kieran.bingham at ideasonboard.com> wrote:
> >
> > Quoting Paul Elder (2024-06-07 09:42:58)
> > > Add a vector class to libipa. The original purpose of this is to replace
> > > the floating-point Point class that Raspberry Pi used in their Pwl, as
> > > that implementation of Point seemed more akin to a Vector than a Point.
> > >
> > > This is added to libipa instead of to geometry.h to avoid public API
> > > issues, plus this is not expected to be needed by applications.
> > >
> > > Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> > >
> > > ---
> > > No change in v6
> > >
> > > New in v5
> > > ---
> > > src/ipa/libipa/vector.cpp | 162 ++++++++++++++++++++++++++++++
> > > src/ipa/libipa/vector.h | 206 ++++++++++++++++++++++++++++++++++++++
> > > 2 files changed, 368 insertions(+)
> > > create mode 100644 src/ipa/libipa/vector.cpp
> > > create mode 100644 src/ipa/libipa/vector.h
> > >
> > > diff --git a/src/ipa/libipa/vector.cpp b/src/ipa/libipa/vector.cpp
> > > new file mode 100644
> > > index 000000000..bdc3c447c
> > > --- /dev/null
> > > +++ b/src/ipa/libipa/vector.cpp
> > > @@ -0,0 +1,162 @@
> > > +/* SPDX-License-Identifier: BSD-2-Clause */
> > > +/*
> > > + * Copyright (C) 2019, Raspberry Pi Ltd
> > > + * Copyright (C) 2024, Paul Elder <paul.elder at ideasonboard.com>
> > > + *
> > > + * Vector and related operations
> > > + */
> > > +
> > > +#include "vector.h"
> > > +
> > > +#include <libcamera/base/log.h>
> > > +
> > > +/**
> > > + * \file vector.h
> > > + * \brief Vector class
> > > + */
> > > +
> > > +namespace libcamera {
> > > +
> > > +LOG_DEFINE_CATEGORY(Vector)
> > > +
> > > +namespace ipa {
> > > +
> > > +/**
> > > + * \class Vector
> > > + * \brief Vector class
> > > + * \tparam T Type of numerical values to be stored in the vector
> > > + * \tparam R Number of rows in the vector
> > > + */
> > > +
> > > +/**
> > > + * \fn Vector::Vector()
> > > + * \brief Construct an identity vector
>
> I just wanted to comment that this expression "identity vector" had me
> confused for a moment. I assume we just mean the "zero vector" which,
> it's true, is the identity element under the addition operation. But
> then we often multiply vectors by scalars, or matrices, so it does
> just make you pause for thought. Anyway, "zero vector" would have
> caused my brain cells slightly less cognitive dislocation!
Now that I'm reading the Matrix documentation class, I have a sneaky
suspicion that Matrix documentation was duplicated to Vector
documentation ;-)
As this is a default constructor - the values will be zero - so that's
certainly not an identify vector! A Zero vector sounds far more
reasonable.
--
Kieran
>
> Thanks
> David
More information about the libcamera-devel
mailing list