
#include "compMatrix.h"


component void c_compSTR(ihc::stream_in<cfixed_t> &WStream, 
	ihc::stream_in<cfixed_t> &yStream, 
	ihc::stream_out<cfixed_t> &resStream){

	
	cfixed_t y[NA]; 
	cfixed_t W[NL][NA]; 
	cfixed_t res[NL];
					
	for(int i = 0; i<NL; i++){
		for(int j = 0; j<NA; j++){
			if(i == 0) y[j] = yStream.read();
			W[i][j] = WStream.read();
		}
	}

	for(int i = 0; i<NL;i++){
		res[i] = vectormul(W[i],y);
		resStream.write(res[i]);
	}
}


component void c_compMM_m(mm_host_t1 &W, 
	mm_host_t2 &y, 
	mm_host_t3 &res){

	for(int i = 0; i<NL;i++){
		res[i] = vectormul(&W[i],y);
	}
}
