Ignore:
Timestamp:
Nov 8, 2019 12:47:46 PM (4 weeks ago)
Author:
Christian Andersson
Message:

Minor cleanup. Related to ticket:5868

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-2658/RuntimeLibrary/src/jmi/jmi_linear_algebra.c

    r9915 r14000  
    2222#include <math.h>
    2323#include <stdlib.h>
     24
     25/* Computes y = x.*y (element-wise multiplication)*/
     26void 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}
    2433
    2534/* Computes a = sqrt( sum( (wi*xi)^2) / N) */
     
    117126/* Find the index of the max absolute value */
    118127jmi_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
    121130    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;
    124136            j=i;
    125137        }
Note: See TracChangeset for help on using the changeset viewer.