 Timestamp:
 Nov 8, 2019 12:47:46 PM (4 weeks ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/devcw2658/RuntimeLibrary/src/jmi/jmi_linear_algebra.c
r9915 r14000 22 22 #include <math.h> 23 23 #include <stdlib.h> 24 25 /* Computes y = x.*y (elementwise multiplication)*/ 26 void jmi_linear_algebra_dxemy(jmi_real_t* x, jmi_real_t* y, jmi_int_t N) { 27 jmi_int_t i; 28 29 for (i = 0; i < N; i++) { 30 y[i] = y[i]*x[i]; 31 } 32 } 24 33 25 34 /* Computes a = sqrt( sum( (wi*xi)^2) / N) */ … … 117 126 /* Find the index of the max absolute value */ 118 127 jmi_int_t jmi_linear_algebra_idamax(jmi_real_t *x, jmi_int_t N) { 119 int i = 0 ;120 int j=0; 128 int i = 0, j = 0; 129 121 130 jmi_real_t cmax = JMI_ABS(x[i]); 122 for(i=1; i<N; i++) { 123 if(JMI_ABS(x[i])>cmax) { 131 jmi_real_t tmp; 132 for(i=1; i < N; i++) { 133 tmp = JMI_ABS(x[i]); 134 if(tmp > cmax) { 135 cmax = tmp; 124 136 j=i; 125 137 }
Note: See TracChangeset
for help on using the changeset viewer.