30 template<
typename AReal>
38 template<
typename AReal>
40 : fSize(size), fOffset(0)
42 AReal ** pointer =
new AReal * [1];
43 * pointer =
new AReal[size];
48 template<
typename AReal>
58 template<
typename AReal>
65 template<
typename AReal>
81 for (
size_t i = 0; i < batchSize; i++) {
82 size_t sampleIndex = *sampleIterator;
83 for (
size_t j = 0; j <
n; j++) {
84 size_t bufferIndex = j * batchSize + i;
85 buffer[bufferIndex] =
static_cast<Real_t>(inputMatrix(sampleIndex, j));
101 for (
size_t i = 0; i < batchSize; i++) {
102 size_t sampleIndex = *sampleIterator;
103 for (
size_t j = 0; j <
n; j++) {
104 size_t bufferIndex = j * batchSize + i;
105 buffer[bufferIndex] =
static_cast<Real_t>(outputMatrix(sampleIndex, j));
118 for (
size_t i = 0; i < batchSize; i++) {
119 size_t sampleIndex = *sampleIterator;
120 buffer[i] =
static_cast<Real_t>(outputMatrix(sampleIndex, 0));
133 for (
size_t i = 0; i < batchSize; i++) {
134 size_t sampleIndex = *sampleIterator;
135 for (
size_t j = 0; j <
n; j++) {
136 size_t bufferIndex = j * batchSize + i;
137 buffer[bufferIndex] = inputMatrix(sampleIndex, j);
153 for (
size_t i = 0; i < batchSize; i++) {
154 size_t sampleIndex = *sampleIterator;
155 for (
size_t j = 0; j <
n; j++) {
156 size_t bufferIndex = j * batchSize + i;
157 buffer[bufferIndex] = outputMatrix(sampleIndex, j);
170 for (
size_t i = 0; i < batchSize; i++) {
171 size_t sampleIndex = *sampleIterator;
172 buffer[i] =
static_cast<Double_t>(outputMatrix(sampleIndex, 0));
182 Event *
event = std::get<0>(fData)[0];
183 size_t n =
event->GetNVariables();
184 for (
size_t i = 0; i < batchSize; i++) {
185 size_t sampleIndex = * sampleIterator++;
186 event = std::get<0>(fData)[sampleIndex];
187 for (
size_t j = 0; j <
n; j++) {
188 size_t bufferIndex = j * batchSize + i;
189 buffer[bufferIndex] =
event->GetValue(j);
202 size_t n = buffer.
GetSize() / batchSize;
206 for (
size_t i = 0; i < batchSize; i++) {
207 size_t sampleIndex = *sampleIterator++;
208 Event *
event = std::get<0>(fData)[sampleIndex];
209 for (
size_t j = 0; j <
n; j++) {
211 size_t bufferIndex = j * batchSize + i;
213 if (event->GetNTargets() == 0) {
216 buffer[bufferIndex] = (info.
IsSignal(event)) ? 1.0 : 0.0;
219 buffer[bufferIndex] = 0.0;
220 if (j == event->GetClass()) {
221 buffer[bufferIndex] = 1.0;
225 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetTarget(j));
236 for (
size_t i = 0; i < batchSize; i++) {
237 size_t sampleIndex = *sampleIterator++;
238 Event *
event = std::get<0>(fData)[sampleIndex];
239 buffer[i] =
event->GetWeight();
248 Event *
event = std::get<0>(fData)[0];
249 size_t n =
event->GetNVariables();
250 for (
size_t i = 0; i < batchSize; i++) {
251 size_t sampleIndex = * sampleIterator++;
252 event = std::get<0>(fData)[sampleIndex];
253 for (
size_t j = 0; j <
n; j++) {
254 size_t bufferIndex = j * batchSize + i;
255 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetValue(j));
268 size_t n = buffer.
GetSize() / batchSize;
272 for (
size_t i = 0; i < batchSize; i++) {
273 size_t sampleIndex = *sampleIterator++;
274 Event *
event = std::get<0>(fData)[sampleIndex];
275 for (
size_t j = 0; j <
n; j++) {
277 size_t bufferIndex = j * batchSize + i;
279 if (event->GetNTargets() == 0) {
282 buffer[bufferIndex] = (info.
IsSignal(event)) ? 1.0 : 0.0;
285 buffer[bufferIndex] = 0.0;
286 if (j == event->GetClass()) {
287 buffer[bufferIndex] = 1.0;
291 buffer[bufferIndex] =
static_cast<Real_t>(
event->GetTarget(j));
302 for (
size_t i = 0; i < batchSize; i++) {
303 size_t sampleIndex = *sampleIterator++;
304 Event *
event = std::get<0>(fData)[sampleIndex];
305 buffer[i] =
static_cast<Real_t>(
event->GetWeight());
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)
Class that contains all the data information.
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.
Bool_t IsSignal(const Event *ev) const
TCpuBuffer GetSubBuffer(size_t offset, size_t start)
Return subbuffer of siez start starting at element offset.
struct TMVA::DNN::TCpuBuffer::TDestructor fDestructor