22 #ifndef mia_core_ICAANALYSISBASE_HH 23 #define mia_core_ICAANALYSISBASE_HH 27 #include <boost/concept/requires.hpp> 28 #include <boost/concept_check.hpp> 51 typedef std::unique_ptr<CIndepCompAnalysis>
Pointer;
65 template <
class Iterator>
66 BOOST_CONCEPT_REQUIRES(((::boost::ForwardIterator<Iterator>)),
68 set_row(
unsigned row, Iterator begin, Iterator end);
71 virtual void initialize(
unsigned int series_length,
unsigned int slice_size) = 0;
78 virtual bool run(
unsigned int nica, std::vector<std::vector<float> > guess) = 0;
81 virtual std::vector<float> get_feature_row(
unsigned int row)
const = 0;
84 virtual std::vector<float> get_mix_series(
unsigned int row)
const = 0;
87 virtual std::vector<float> get_mix(
unsigned int idx)
const = 0;
95 virtual std::vector<float> get_incomplete_mix(
unsigned int idx,
const IndexSet& skip)
const = 0;
103 virtual std::vector<float> get_partial_mix(
unsigned int idx,
const IndexSet& use)
const = 0;
110 virtual std::vector<float> get_delta_feature(
const IndexSet& plus,
const IndexSet& minus)
const = 0;
117 virtual void set_mixing_series(
unsigned int index,
const std::vector<float>& series) = 0;
128 virtual void normalize_ICs() = 0;
135 virtual std::vector<float> normalize_Mix() = 0;
139 virtual unsigned int get_ncomponents()
const = 0;
145 virtual void set_max_iterations(
int n) = 0;
151 virtual void set_approach(
EApproach approach) = 0;
153 virtual void set_deterministic_seed(
int seed) = 0;
155 virtual void set_row_internal(
unsigned row,
const std::vector<double>& buffer,
double mean) = 0;
172 void set_deterministic_seed(
int seed);
175 virtual
CIndepCompAnalysis *do_create() const __attribute__((warn_unused_result)) = 0;
176 int m_deterministic_seed;
189 template<> const
char * const
208 template <
class Iterator>
209 BOOST_CONCEPT_REQUIRES(((::boost::ForwardIterator<Iterator>)),
213 const unsigned int length = std::distance(begin, end);
214 std::vector<double> buffer(length);
215 unsigned int idx = 0;
219 mean += (buffer[idx++] = *begin++);
221 for(
unsigned int i = 0; i < length; ++i)
223 set_row_internal(row, buffer, mean);
229 #endif // CICAANALYSISBASE_HH static const char * data_descr
the singleton that a plug-in handler really is
void set_row(unsigned row, Iterator begin, Iterator end)
CIndepCompAnalysisFactory plugin_type
std::shared_ptr< CIndepCompAnalysisFactory > PIndepCompAnalysisFactory
class EXPORT_CORE CMeans private
CIndepCompAnalysis::Pointer PIndepCompAnalysis
PIndepCompAnalysisFactory produce_ica_factory(const std::string &descr)
static const char * type_descr
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
The base class for all plug-in created object.
static const T & instance()
the Base class for all plugn handlers that deal with factory plugins.
std::vector< std::vector< float > > CSlopeColumns
class to store the ICA weight matrix
std::unique_ptr< CIndepCompAnalysis > Pointer
CIndepCompAnalysisFactory plugin_data
std::set< unsigned int > IndexSet
defines a set of indices used for mixing
The basic template of all plugin handlers.