17#ifndef TMVA_DNN_ARCHITECTURES_CPU_CPUMATRIX 
   18#define TMVA_DNN_ARCHITECTURES_CPU_CPUMATRIX 
   32#if defined(DEBUG_TMVA_TCPUMATRIX) 
   45#define TMVA_DNN_PrintTCpuMatrix(mat, text)                                                                \ 
   47      auto _dpointer = mat.GetRawDataPointer();                                                            \ 
   49         std::cout << #mat << " is null pointer" << std::endl;                                             \ 
   52      auto _nrows = mat.GetNrows();                                                                        \ 
   53      auto _ncols = mat.GetNcols();                                                                        \ 
   54      std::cout << "---------------------" << text << " " << #mat << "(" << _nrows << "," << _ncols << ")" \ 
   55                << "--------------------" << std::endl;                                                    \ 
   56      for (size_t _i = 0; _i < _nrows; _i++) {                                                             \ 
   57         for (size_t _j = 0; _j < _ncols; _j++) {                                                          \ 
   58            std::cout << mat(_i, _j);                                                                      \ 
   59            if (_j < _ncols - 1)                                                                           \ 
   62         std::cout << std::endl;                                                                           \ 
   66#define TMVA_DNN_PrintTCpuMatrix(mat, text) 
   85template <
typename AFloat>
 
   88   static std::vector<AFloat> 
fOnes; 
 
  147   template <
typename Function_t>
 
  152   template <
typename Function_t>
 
 
  185template <
typename AFloat>
 
  190template <
typename AFloat>
 
  210template <
typename AFloat>
 
  211template <
typename Function_t>
 
  214   AFloat *
data = GetRawDataPointer();
 
 
  239template <
typename AFloat>
 
  240template <
typename Function_t>
 
  243   AFloat *
dataB = GetRawDataPointer();
 
 
  268template <
typename AFloat>
 
  271   for (
size_t j = 0; 
j < fNCols; 
j++) {
 
  272      for (
size_t i = 0; i < fNRows; i++) {
 
 
#define TMVA_DNN_PrintTCpuMatrix(mat, text)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
static Config & Instance()
static function: returns TMVA instance
TCpuMatrix(TCpuMatrix &&)=default
static std::vector< AFloat > fOnes
Vector filled with ones used for BLAS calls.
TCpuMatrix & operator=(const TCpuMatrix &)=default
TCpuMatrix(const TCpuBuffer< AFloat > &buffer, size_t m, size_t n)
Construct a m-times-n matrix from the given buffer.
void MapFrom(Function_t &f, const TCpuMatrix &A)
Same as maps but takes the input values from the matrix A and writes the results in this matrix.
static size_t GetOnePointerSize()
void Zero()
Clear content of the matrix and initialize to zero elements.
AFloat * GetRawDataPointer()
Return raw pointer to the elements stored contiguously in column-major order.
AFloat & operator()(size_t i, size_t j)
static const AFloat * GetOnePointer()
TCpuMatrix(const TMatrixT< AFloat > &)
Construct a TCpuMatrix object by (deeply) copying from a TMatrixT<Double_t> matrix.
AFloat operator()(size_t i, size_t j) const
Return matrix element in row i and column j.
const TCpuBuffer< AFloat > & GetDeviceBuffer() const
const AFloat * GetRawDataPointer() const
const TCpuBuffer< AFloat > & GetBuffer() const
static size_t GetNWorkItems(size_t nelements)
TCpuBuffer< AFloat > & GetDeviceBuffer()
static void InitializeOneVector(size_t n)
TCpuMatrix & operator=(TCpuMatrix &&)=default
TCpuBuffer< AFloat > fBuffer
The buffer holding the matrix elements in column-major format.
TCpuBuffer< AFloat > & GetBuffer()
Returns pointer to a vector holding only ones with a guaranteed length of the number of columns of ev...
void Map(Function_t &f)
Map the given function over the matrix elements.
static Executor & GetThreadExecutor()
TCpuMatrix< AFloat > & operator=(const TMatrixT< AFloat > &)
copy from a TMAtrixT .
size_t GetNoElements() const
TCpuMatrix(const TCpuMatrix &)=default
create variable transformations