summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/alsc.h
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2023-03-27 13:20:25 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-03-31 13:29:18 +0100
commita82d08973f09f951e1de016ed8c1137663e7a58c (patch)
treeccc070f9731152fcf787949504ca04572fa71f17 /src/ipa/raspberrypi/controller/rpi/alsc.h
parentc557de126e551133a345ae7bd8d1b58188769ac9 (diff)
ipa: raspberrypi: alsc: Use a better type name for sparse arrays
The algorithm uses the data type std::vector<std::array<double, 4>> to represent the large sparse matrices that are XY (X, Y being the ALSC grid size) high but with only 4 non-zero elements on each row. Replace this slightly long type name by SparseArray<double>. No functional changes. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/alsc.h')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/alsc.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/alsc.h b/src/ipa/raspberrypi/controller/rpi/alsc.h
index 1ab61299..0b6d9478 100644
--- a/src/ipa/raspberrypi/controller/rpi/alsc.h
+++ b/src/ipa/raspberrypi/controller/rpi/alsc.h
@@ -68,6 +68,14 @@ private:
std::vector<T> data_;
};
+/*
+ * We'll use the term SparseArray for the large sparse matrices that are
+ * XY tall but have only 4 non-zero elements on each row.
+ */
+
+template<typename T>
+using SparseArray = std::vector<std::array<T, 4>>;
+
struct AlscCalibration {
double ct;
Array2D<double> table;
@@ -160,7 +168,7 @@ private:
/* Temporaries for the computations */
std::array<Array2D<double>, 5> tmpC_;
- std::array<std::vector<std::array<double, 4>>, 3> tmpM_;
+ std::array<SparseArray<double>, 3> tmpM_;
};
} /* namespace RPiController */