22#ifndef mia_core_ICAANALYSISBASE_HH
23#define mia_core_ICAANALYSISBASE_HH
27#include <boost/concept/requires.hpp>
28#include <boost/concept_check.hpp>
50 typedef std::unique_ptr<CIndepCompAnalysis>
Pointer;
64 template <
class Iterator>
65 BOOST_CONCEPT_REQUIRES(((::boost::ForwardIterator<Iterator>)),
67 set_row(
unsigned row, Iterator begin, Iterator end);
70 virtual
void initialize(
unsigned int series_length,
unsigned int slice_size) = 0;
77 virtual
bool run(
unsigned int nica,
std::vector<
std::vector<
float>> guess) = 0;
80 virtual
std::vector<
float> get_feature_row(
unsigned int row)const = 0;
83 virtual
std::vector<
float> get_mix_series(
unsigned int row)const = 0;
86 virtual
std::vector<
float> get_mix(
unsigned int idx)const = 0;
94 virtual
std::vector<
float> get_incomplete_mix(
unsigned int idx, const
IndexSet& skip)const = 0;
102 virtual
std::vector<
float> get_partial_mix(
unsigned int idx, const
IndexSet& use)const = 0;
116 virtual
void set_mixing_series(
unsigned int index, const
std::vector<
float>& series) = 0;
127 virtual
void normalize_ICs() = 0;
134 virtual
std::vector<
float> normalize_Mix() = 0;
138 virtual
unsigned int get_ncomponents() const = 0;
144 virtual
void set_max_iterations(
int n) = 0;
152 virtual
void set_deterministic_seed(
int seed) = 0;
154 virtual
void set_row_internal(
unsigned row, const
std::vector<
double>& buffer,
double mean) = 0;
175 virtual
CIndepCompAnalysis *do_create() const __attribute__((warn_unused_result)) = 0;
176 int m_deterministic_seed;
189template<> const
char *const
208template <
class Iterator>
209BOOST_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++);
223 for (
unsigned int i = 0; i < length; ++i)
226 set_row_internal(row, buffer, mean);
The base class for all plug-in created object.
the Base class for all plugn handlers that deal with factory plugins.
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
the singleton that a plug-in handler really is
static const T & instance()
The basic template of all plugin handlers.
static const char * data_descr
CIndepCompAnalysisFactory()
CIndepCompAnalysisFactory plugin_data
void set_deterministic_seed(int seed)
virtual ~CIndepCompAnalysisFactory()
CIndepCompAnalysis * create() const __attribute__((warn_unused_result))
CIndepCompAnalysisFactory plugin_type
static const char * type_descr
void set_row(unsigned row, Iterator begin, Iterator end)
virtual ~CIndepCompAnalysis()
std::set< unsigned int > IndexSet
defines a set of indices used for mixing
std::unique_ptr< CIndepCompAnalysis > Pointer
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
std::vector< std::vector< float > > CSlopeColumns
class to store the ICA weight matrix
PIndepCompAnalysisFactory produce_ica_factory(const std::string &descr)
CIndepCompAnalysis::Pointer PIndepCompAnalysis
std::shared_ptr< CIndepCompAnalysisFactory > PIndepCompAnalysisFactory