Page MenuHomePhorge

Bunch_Module.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

Bunch_Module.cpp

This document is not UTF8. It was detected as Shift JIS and converted to UTF8 for display.
#include "Bunch_Module.h"
#include <stdio.h>
void Bunch_Module :: initialize_bunch_module(unsigned int bunch_method) {
this->bunch_method = bunch_method;
}
Bunch_Module :: Bunch_Module(unsigned int bunch_method) {
setName(NO_NAME);
initialize_bunch_module(bunch_method);
}
Bunch_Module :: Bunch_Module(char* name, unsigned int bunch_method) {
setName(name);
initialize_bunch_module(bunch_method);
}
//TODO: retrun value bool -> confidecy value => pointer
unsigned int Bunch_Module :: bunch(unsigned int num_of_input, int* input, bool* input_is_valid, int* output) {
switch(bunch_method) {
case BUNCH_METHOD_NOT_SPECIFIED: return false; break;
case BUNCH_SIMPLY_ADD: return bunch_simply_add(num_of_input, input, input_is_valid, output); break;
default: return false; //dummy ... 舅dern zu bunch interface
}
}
unsigned int Bunch_Module :: bunch(unsigned int num_of_input, float* input, bool* input_is_valid, float* output) {
return false; //dummy
}
unsigned int Bunch_Module :: bunch_simply_add(unsigned int num_of_input, int* input, bool* input_is_valid, int* output) {
//bool data_confident = false;
unsigned int data_confidence_counter = 0;
int result = 0;
for(unsigned int in_ix=0; in_ix<num_of_input; in_ix++) {
if(input_is_valid[in_ix]) {
result = result + *(input+in_ix);
data_confidence_counter++;
//printf("%u - valid\n", in_ix);
}
}
*output = result;
return data_confidence_counter;
}
void Bunch_Module :: set_bunch_method(unsigned int bunch_method) {
this->bunch_method = bunch_method;
}
unsigned int Bunch_Module :: get_bunch_method() {
return bunch_method;
}

File Metadata

Mime Type
text/x-c
Expires
Sun, May 31, 12:06 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
329140
Default Alt Text
Bunch_Module.cpp (1 KB)

Event Timeline