Skip to content

Commit

Permalink
fixed slow implementation by vectorizing
Browse files Browse the repository at this point in the history
  • Loading branch information
orchidas committed Oct 23, 2021
1 parent 05e9eea commit 226cd3b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/CoupledMixingMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ void CoupledMixingMatrix::updateCouplingFilters(){
Eigen::VectorXf CoupledMixingMatrix::process(Eigen::VectorXf delayLineOutput){

Eigen::VectorXf delayLineInput(delayLineOutput.size());
delayLineInput.setZero();
//delayLineInput.setZero();
delayLineInput = (M_block.cwiseProduct(couplingScalars)) * delayLineOutput;

for(int i = 0; i < nDelayLines; i++){
//doing this in a loop is too slow and breaks things
/*for(int i = 0; i < nDelayLines; i++){
for(int j = 0; j < nDelayLines; j++){
if (!isFilter)
delayLineInput(i) += M_block(i,j)*couplingScalars(i,j)*delayLineOutput(i);
delayLineInput(i) += M_block(i,j)*couplingScalars(i,j)*delayLineOutput(j);
}
}
}*/

return delayLineInput;
}

0 comments on commit 226cd3b

Please sign in to comment.