SCM

SCM Repository

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

Diff of /pkg/src/Mutils.h

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

revision 536, Thu Feb 10 08:15:12 2005 UTC revision 572, Fri Feb 25 14:11:54 2005 UTC
# Line 159  Line 159 
159  double *expand_csc_column(double *dest, int m, int j,  double *expand_csc_column(double *dest, int m, int j,
160                            const int Ap[], const int Ai[], const double Ax[]);                            const int Ap[], const int Ai[], const double Ax[]);
161    
162  #endif  /**
163     * Apply a permutation to an integer vector
164     *
165     * @param i vector of 0-based indices
166     * @param n length of vector i
167     * @param perm 0-based permutation vector of length max(i) + 1
168     */
169    static R_INLINE void
170    int_permute(int i[], int n, const int perm[])
171    {
172        int j;
173        for (j = 0; j < n; j++) i[j] = perm[i[j]];
174    }
175    
176    /**
177     * Force index pairs to be in the upper triangle of a matrix
178     *
179     * @param i vector of 0-based row indices
180     * @param j vector of 0-based column indices
181     * @param nnz length of index vectors
182     */
183    static R_INLINE void
184    make_upper_triangular(int i[], int j[], int nnz)
185    {
186        int k;
187        for (k = 0; k < nnz; k++) {
188            if (i[k] > j[k]) {
189                int tmp = i[k];
190                i[k] = j[k];
191                j[k] = tmp;
192            }
193        }
194    }
195    
196    #endif

Legend:
Removed from v.536  
changed lines
  Added in v.572

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