Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-16 09:21:06

0001 // Author: Martin Føll, University of Oslo (UiO) & CERN 1/2026
0002 
0003 /*************************************************************************
0004  * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 #ifndef ROOT_INTERNAL_ML_RFLAT2DMATRIXOPERATORS
0012 #define ROOT_INTERNAL_ML_RFLAT2DMATRIXOPERATORS
0013 
0014 #include <vector>
0015 
0016 // Forward decl
0017 namespace ROOT::Experimental::Internal::ML {
0018 struct RFlat2DMatrix;
0019 } // namespace ROOT::Experimental::Internal::ML
0020 
0021 namespace ROOT::Experimental::Internal::ML {
0022 /**
0023 \class ROOT::Experimental::Internal::ML::RFlat2DMatrixOperators
0024 
0025 \brief Collection of operations applied to one or multiple flat 2D matrices.
0026 */
0027 
0028 class RFlat2DMatrixOperators {
0029 private:
0030    bool fShuffle;
0031    std::size_t fSetSeed;
0032 
0033 public:
0034    RFlat2DMatrixOperators(bool shuffle = true, const std::size_t setSeed = 0) : fShuffle(shuffle), fSetSeed(setSeed) {}
0035 
0036    ~RFlat2DMatrixOperators();
0037 
0038    void ShuffleTensor(RFlat2DMatrix &ShuffledTensor, RFlat2DMatrix &Tensor);
0039 
0040    void
0041    SliceTensor(RFlat2DMatrix &SlicedTensor, RFlat2DMatrix &Tensor, const std::vector<std::vector<std::size_t>> &slice);
0042 
0043    void ConcatenateTensors(RFlat2DMatrix &ConcatTensor, const std::vector<RFlat2DMatrix> &Tensors);
0044 };
0045 
0046 } // namespace ROOT::Experimental::Internal::ML
0047 #endif // ROOT_INTERNAL_ML_RFLAT2DMATRIXOPERATORS