Project
Loading...
Searching...
No Matches
SymMatrixSolver.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SYMMATRIXSOLVER_H
18#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SYMMATRIXSOLVER_H
19
20#include "GPUCommonDef.h"
21#include "GPUCommonRtypes.h"
22#include <vector>
23#include <cassert>
24#include <algorithm>
25
26namespace o2
27{
28namespace gpu
29{
30
39{
40 public:
41 SymMatrixSolver(int32_t N, int32_t M) : mN(N), mM(M), mShift(mN + mM)
42 {
43 assert(N > 0 && M > 0);
44 mA.resize(mN * mShift, 0.);
45 }
46
48 double& A(int32_t i, int32_t j)
49 {
50 auto ij = std::minmax(i, j);
51 assert(ij.first >= 0 && ij.second < mN);
52 return mA[ij.first * mShift + ij.second];
53 }
54
56 double& B(int32_t i, int32_t j)
57 {
58 assert(i >= 0 && i < mN && j >= 0 && j < mM);
59 return mA[i * mShift + mN + j];
60 }
61
63 void solve();
64
66 void print();
67
69 static int32_t test(bool prn = 0);
70
71 private:
72 private:
73 int32_t mN = 0;
74 int32_t mM = 0;
75 int32_t mShift = 0;
76 std::vector<double> mA;
77
78 ClassDefNV(SymMatrixSolver, 0);
79};
80
81} // namespace gpu
82} // namespace o2
83
84#endif
int32_t i
uint32_t j
Definition RawData.h:0
double & B(int32_t i, int32_t j)
access to B elements
double & A(int32_t i, int32_t j)
access to A elements
SymMatrixSolver(int32_t N, int32_t M)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
FIXME: do not use data model tables.