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
17
18#ifndef ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SYMMATRIXSOLVER_H
19#define ALICEO2_GPUCOMMON_TPCFASTTRANSFORMATION_SYMMATRIXSOLVER_H
20
21#include "GPUCommonRtypes.h"
22#include <vector>
23#include <cassert>
24#include <algorithm>
25
26namespace o2::math_utils
27{
28
37{
38 public:
39 SymMatrixSolver(int N, int M) : mN(N), mM(M), mShift(mN + mM)
40 {
41 assert(N > 0 && M > 0);
42 mA.resize(mN * mShift, 0.);
43 }
44
46 double& A(int i, int j)
47 {
48 auto ij = std::minmax(i, j);
49 assert(ij.first >= 0 && ij.second < mN);
50 return mA[ij.first * mShift + ij.second];
51 }
52
54 double& B(int i, int j)
55 {
56 assert(i >= 0 && i < mN && j >= 0 && j < mM);
57 return mA[i * mShift + mN + j];
58 }
59
61 void solve();
62
64 void print();
65
67 static int test(bool prn = 0);
68
69 private:
70 private:
71 int mN = 0;
72 int mM = 0;
73 int mShift = 0;
74 std::vector<double> mA;
75
76 ClassDefNV(SymMatrixSolver, 0);
77};
78
79} // namespace o2::math_utils
80
81#endif
int32_t i
uint32_t j
Definition RawData.h:0
double & A(int i, int j)
access to A elements
double & B(int i, int j)
access to B elements
FIXME: do not use data model tables.