22 template<
typename AReal>
23 TCpuMatrix<AReal>::TCpuMatrix(
size_t nRows,
size_t nCols)
24 : fBuffer(nRows * nCols), fNCols(nCols), fNRows(nRows)
27 for (
size_t j = 0; j < fNCols; j++) {
28 for (
size_t i = 0; i < fNRows; i++) {
35 template<
typename AReal>
36 TCpuMatrix<AReal>::TCpuMatrix(
const TMatrixT<AReal> & B)
37 : fBuffer(B.GetNoElements()), fNCols(B.GetNcols()), fNRows(B.GetNrows())
40 for (
size_t j = 0; j < fNCols; j++) {
41 for (
size_t i = 0; i < fNRows; i++) {
42 (*this)(i,j) = B(i,j);
48 template<
typename AReal>
49 TCpuMatrix<AReal>::TCpuMatrix(
const TCpuBuffer<AReal> & buffer,
52 : fBuffer(buffer), fNCols(n), fNRows(m)
58 template<
typename AReal>
59 TCpuMatrix<AReal>::operator TMatrixT<AReal>()
const
61 TMatrixT<AReal> B(fNRows, fNCols);
63 for (
size_t j = 0; j < fNCols; j++) {
64 for (
size_t i = 0; i < fNRows; i++) {
65 B(i,j) = (*this)(i, j);
73 template<
typename AReal>
74 void TCpuMatrix<AReal>::Initialize()
76 if (fNRows > fOnes.size()) {
77 fOnes.reserve(fNRows);
78 size_t ifirst = fOnes.size();
79 for (
size_t i = ifirst; i < fNRows; i++) {
86 template<
typename AReal>
87 void TCpuMatrix<AReal>::InitializeOneVector(
size_t n)
89 if (n > fOnes.size()) {
91 size_t ifirst = fOnes.size();
92 for (
size_t i = ifirst; i < n; i++) {
99 template class TCpuMatrix<Float_t>;
100 template class TCpuMatrix<Double_t>;