29 template<
typename AReal>
37 template<
typename AReal>
39 : fSize(size), fOffset(0)
41 AReal ** pointer =
new AReal * [1];
42 * pointer =
new AReal[size];
47 template<
typename AReal>
57 template<
typename AReal>
64 template<
typename AReal>
80 for (
size_t i = 0; i < batchSize; i++) {
81 size_t sampleIndex = *sampleIterator;
82 for (
size_t j = 0; j <
n; j++) {
83 size_t bufferIndex = j * batchSize + i;
84 buffer[bufferIndex] =
static_cast<Real_t>(inputMatrix(sampleIndex, j));
100 for (
size_t i = 0; i < batchSize; i++) {
101 size_t sampleIndex = *sampleIterator;
102 for (
size_t j = 0; j <
n; j++) {
103 size_t bufferIndex = j * batchSize + i;
104 buffer[bufferIndex] =
static_cast<Real_t>(outputMatrix(sampleIndex, j));
120 for (
size_t i = 0; i < batchSize; i++) {
121 size_t sampleIndex = *sampleIterator;
122 for (
size_t j = 0; j <
n; j++) {
123 size_t bufferIndex = j * batchSize + i;
124 buffer[bufferIndex] = inputMatrix(sampleIndex, j);
140 for (
size_t i = 0; i < batchSize; i++) {
141 size_t sampleIndex = *sampleIterator;
142 for (
size_t j = 0; j <
n; j++) {
143 size_t bufferIndex = j * batchSize + i;
144 buffer[bufferIndex] = outputMatrix(sampleIndex, j);
157 Event *
event = fData.front();
158 size_t n =
event->GetNVariables();
162 for (
size_t i = 0; i < batchSize; i++) {
163 size_t sampleIndex = * sampleIterator++;
164 event = fData[sampleIndex];
165 for (
size_t j = 0; j <
n; j++) {
166 size_t bufferIndex = j * batchSize + i;
167 buffer[bufferIndex] =
event->GetValue(j);
179 Event *
event = fData.front();
180 size_t n = buffer.
GetSize() / batchSize;
184 for (
size_t i = 0; i < batchSize; i++) {
185 size_t sampleIndex = * sampleIterator++;
186 event = fData[sampleIndex];
187 for (
size_t j = 0; j <
n; j++) {
189 size_t bufferIndex = j * batchSize + i;
191 if (event->GetNTargets() == 0) {
194 buffer[bufferIndex] = (
event->GetClass() == 0) ? 1.0 : 0.0;
197 buffer[bufferIndex] = 0.0;
198 if (j == event->GetClass()) {
199 buffer[bufferIndex] = 1.0;
203 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetTarget(j));
216 Event *
event = fData.front();
217 size_t n =
event->GetNVariables();
221 for (
size_t i = 0; i < batchSize; i++) {
222 size_t sampleIndex = * sampleIterator++;
223 event = fData[sampleIndex];
224 for (
size_t j = 0; j <
n; j++) {
225 size_t bufferIndex = j * batchSize + i;
226 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetValue(j));
238 Event *
event = fData.front();
239 size_t n = buffer.
GetSize() / batchSize;
243 for (
size_t i = 0; i < batchSize; i++) {
244 size_t sampleIndex = * sampleIterator++;
245 event = fData[sampleIndex];
246 for (
size_t j = 0; j <
n; j++) {
248 size_t bufferIndex = j * batchSize + i;
250 if (event->GetNTargets() == 0) {
253 buffer[bufferIndex] = (
event->GetClass() == 0) ? 1.0 : 0.0;
256 buffer[bufferIndex] = 0.0;
257 if (j == event->GetClass()) {
258 buffer[bufferIndex] = 1.0;
262 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetTarget(j));
typename std::vector< size_t >::iterator IndexIterator_t
void swap(TDirectoryEntry &e1, TDirectoryEntry &e2) noexcept
void CopyTo(TCpuBuffer &)
Copy data to another buffer.
std::shared_ptr< AFloat * > fBuffer
void operator()(AFloat **pointer)
TCpuBuffer(size_t size)
Construct buffer to hold size numbers of type AFloat.
Abstract ClassifierFactory template that handles arbitrary types.
void CopyFrom(TCpuBuffer &)
Copy data from another buffer.
TCpuBuffer GetSubBuffer(size_t offset, size_t start)
Return subbuffer of siez start starting at element offset.
struct TMVA::DNN::TCpuBuffer::TDestructor fDestructor