SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/src/Mutils.h
ViewVC logotype

Diff of /pkg/Matrix/src/Mutils.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 795, Mon Jul 4 14:56:57 2005 UTC revision 796, Mon Jul 4 14:57:28 2005 UTC
# Line 239  Line 239 
239    
240  SEXP Matrix_expand_pointers(SEXP pP);  SEXP Matrix_expand_pointers(SEXP pP);
241    
242    
243    /**
244     * Elementwise increment dest by src
245     *
246     * @param dest vector to be incremented
247     * @param src vector to be added to dest
248     * @param n length of vectors
249     *
250     * @return dest
251     */
252    static R_INLINE double*
253    vecIncrement(double dest[], const double src[], int n) {
254        int i;
255        for (i = 0; i < n; i++) dest[i] += src[i];
256        return dest;
257    }
258    
259    /**
260     * Elementwise sum of src1 and src2 into dest
261     *
262     * @param dest vector to be incremented
263     * @param src1 vector to be added
264     * @param src1 second vector to be added
265     * @param n length of vectors
266     *
267     * @return dest
268     */
269    static R_INLINE double*
270    vecSum(double dest[], const double src1[], const double src2[],
271           int n) {
272        int i;
273        for (i = 0; i < n; i++) dest[i] = src1[i] + src2[i];
274        return dest;
275    }
276    
277  #ifdef __cplusplus  #ifdef __cplusplus
278  }  }
279  #endif  #endif

Legend:
Removed from v.795  
changed lines
  Added in v.796

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge