10#include <tracking/trackFindingCDC/numerics/PlainMatrix.h>
17 namespace TrackFindingCDC {
23 template <
class T,
int M>
27 for (
size_t s = 0, i = 0; s < result.size(); s += M + 1, ++i)
28 result[s] = diagEntries(i, 0);
33 template <
class T,
int K,
int L,
int M,
int N>
34 static PlainMatrix < T, K + M, L + N >
37 const int nRows =
K + M;
39 PlainMatrix < T, K + M, L + N > result{{}};
43 for (
int iACol = 0; iACol < nACols; ++iACol) {
44 std::copy(a.data() + iACol * nARows,
45 a.data() + (iACol + 1) * nARows,
46 result.data() + iACol * nRows);
51 const int skipA = nACols * nRows;
52 const int skipFront = nARows;
53 for (
int iBCol = 0; iBCol < nBCols; ++iBCol) {
54 std::copy(b.data() + iBCol * nBRows,
55 b.data() + (iBCol + 1) * nBRows,
56 result.data() + skipA + skipFront + iBCol * nRows);
62 template <
class T,
int K,
int M,
int N>
63 static PlainMatrix < T, K + M, N >
66 const int nRows =
K + M;
68 PlainMatrix < T, K + M, N > result;
72 const int skipFront = nARows;
73 for (
int iCol = 0; iCol < nCols; ++iCol) {
74 std::copy(a.data() + iCol * nARows,
75 a.data() + (iCol + 1) * nARows,
76 result.data() + iCol * nRows);
78 std::copy(b.data() + iCol * nBRows,
79 b.data() + (iCol + 1) * nBRows,
80 result.data() + skipFront + iCol * nRows);
86 template <
class T,
int M,
int L,
int N>
87 static PlainMatrix < T, M, L + N >
90 PlainMatrix < T, M, L + N > result;
91 std::copy(a.data(), a.data() + a.size(), result.data());
92 std::copy(b.data(), b.data() + b.size(), result.data() + a.size());
A matrix implementation to be used as an interface typ through out the track finder.
Abstract base class for different kinds of events.
Utility functions for the PlainMatrix.
static PlainMatrix< T, K+M, N > VStack(const PlainMatrix< T, K, N > &a, const PlainMatrix< T, M, N > &b)
Construct a matrix from two independent blocks stacked vertically.
static PlainMatrix< T, M, M > Diag(const PlainMatrix< T, M, 1 > &diagEntries)
Construct a diagonal matrix - currently private as it is unused.
static PlainMatrix< T, M, L+N > HStack(const PlainMatrix< T, M, L > &a, const PlainMatrix< T, M, N > &b)
Construct a matrix from two independent blocks stacked horizontally.
static PlainMatrix< T, K+M, L+N > BlockStack(const PlainMatrix< T, K, L > &a, const PlainMatrix< T, M, N > &b)
Construct a matrix from two independent blocks stacked along the diagonal.