MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / perform_ica

Function perform_ica

src/data_handler/data_handler.cpp:1695–1716  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1693}
1694
1695int perform_ica (double *data, int rows, int cols, int num_components, double *w_mat, double *k_mat,
1696 double *a_mat, double *s_mat)
1697{
1698 if ((data == NULL) || (rows < 2) || (cols < 2) || (num_components < 2) || (w_mat == NULL) ||
1699 (k_mat == NULL) || (a_mat == NULL) || (s_mat == NULL))
1700 {
1701 data_logger->error ("invalid inputs for perform_ica.");
1702 return (int)BrainFlowExitCodes::INVALID_ARGUMENTS_ERROR;
1703 }
1704
1705 Eigen::MatrixXd input_matrix =
1706 Eigen::Map<Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>> (
1707 data, rows, cols);
1708
1709 FastICA ica (num_components);
1710 int res = ica.compute (input_matrix);
1711 if (res == (int)BrainFlowExitCodes::STATUS_OK)
1712 {
1713 res = ica.get_matrixes (w_mat, k_mat, a_mat, s_mat);
1714 }
1715 return res;
1716}
1717
1718int get_version_data_handler (char *version, int *num_chars, int max_chars)
1719{

Callers 3

perform_icaMethod · 0.50
perform_icaMethod · 0.50
mainFunction · 0.50

Calls 2

computeMethod · 0.80
get_matrixesMethod · 0.80

Tested by

no test coverage detected