| 1693 | } |
| 1694 | |
| 1695 | int 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 | |
| 1718 | int get_version_data_handler (char *version, int *num_chars, int max_chars) |
| 1719 | { |
no test coverage detected