Voice Lab
vector_multiply
void vector_multiply(double *vector1, double value, int vector_width, double **vector2)
{
int i;
if(vector_width > MAX_VECTOR_WIDTH) {
fprintf(stderr, "vector_width greater than MAX_VECTOR_WIDTH\n");
fprintf(stderr, "Please increase MAX_VECTOR_WIDTH in vector_lib.h and recompile.\n");
exit(-1);
}
for(i = 0; i < vector_width; i++){
(*vector2)[i] = vector1[i] * value;
number_muls++;
}
return;
}
No comments:
Post a Comment