Merge lp:~mvngu/igraph/game-junk into lp:~igraph/igraph/0.6-main-old
- game-junk
- Merge into 0.6-main-old
Proposed by
Minh Van Nguyen
Status: | Merged |
---|---|
Merged at revision: | 2496 |
Proposed branch: | lp:~mvngu/igraph/game-junk |
Merge into: | lp:~igraph/igraph/0.6-main-old |
Diff against target: |
441 lines (+68/-65) 1 file modified
src/matrix.pmt (+68/-65) |
To merge this branch: | bzr merge lp:~mvngu/igraph/game-junk |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tamás Nepusz | Approve | ||
Review via email: mp+62794@code.launchpad.net |
Commit message
Description of the change
A bunch of typo fixes in src/matrix.pmt.
To post a comment you must log in.
Revision history for this message
Tamás Nepusz (ntamas) : | # |
review:
Approve
lp:~mvngu/igraph/game-junk
updated
- 2496. By Tamás Nepusz
-
A bunch of typo fixes in src/matrix.pmt, thanks Minh.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/matrix.pmt' |
2 | --- src/matrix.pmt 2010-10-22 00:06:06 +0000 |
3 | +++ src/matrix.pmt 2011-05-29 14:11:18 +0000 |
4 | @@ -35,7 +35,7 @@ |
5 | * <para>This type is just an interface to \type igraph_vector_t.</para> |
6 | * |
7 | * <para>The \type igraph_matrix_t type usually stores n |
8 | - * elements in O(n) space, but not always, see the documentation of |
9 | + * elements in O(n) space, but not always. See the documentation of |
10 | * the vector type.</para> |
11 | */ |
12 | |
13 | @@ -50,9 +50,9 @@ |
14 | * \brief Initializes a matrix. |
15 | * |
16 | * </para><para> |
17 | - * Every matrix needs to be initialized before using it, this is done |
18 | + * Every matrix needs to be initialized before using it. This is done |
19 | * by calling this function. A matrix has to be destroyed if it is not |
20 | - * needed any more, see \ref igraph_matrix_destroy(). |
21 | + * needed any more; see \ref igraph_matrix_destroy(). |
22 | * \param m Pointer to a not yet initialized matrix object to be |
23 | * initialized. |
24 | * \param nrow The number of rows in the matrix. |
25 | @@ -102,7 +102,7 @@ |
26 | * </para><para> |
27 | * This function resizes a matrix by adding more elements to it. |
28 | * The matrix contains arbitrary data after resizing it. |
29 | - * Ie. after calling this function you cannot expect that element |
30 | + * That is, after calling this function you cannot expect that element |
31 | * (i,j) in the matrix remains the |
32 | * same as before. |
33 | * \param m Pointer to an already initialized matrix object. |
34 | @@ -176,10 +176,10 @@ |
35 | * </para><para> |
36 | * The matrix is copied columnwise, as this is the format most |
37 | * programs and languages use. |
38 | - * The C array should be of sufficient size, there are (of course) not |
39 | - * range checks done. |
40 | + * The C array should be of sufficient size; there are (of course) no |
41 | + * range checks. |
42 | * \param m Pointer to an initialized matrix object. |
43 | - * \param to Pointer to a C array, the place to copy the data to. |
44 | + * \param to Pointer to a C array; the place to copy the data to. |
45 | * \return Error code. |
46 | * |
47 | * Time complexity: O(n), |
48 | @@ -194,7 +194,7 @@ |
49 | /** |
50 | * \ingroup matrix |
51 | * \function igraph_matrix_null |
52 | - * \brief Sets all element in a matrix to zero. |
53 | + * \brief Sets all elements in a matrix to zero. |
54 | * |
55 | * \param m Pointer to an initialized matrix object. |
56 | * |
57 | @@ -235,7 +235,7 @@ |
58 | * isn't enough memory for the operation. |
59 | * |
60 | * Time complexity: linear with the number of elements of the new, |
61 | - * resized, matrix. |
62 | + * resized matrix. |
63 | */ |
64 | |
65 | int FUNCTION(igraph_matrix,add_rows)(TYPE(igraph_matrix) *m, long int n) { |
66 | @@ -326,7 +326,7 @@ |
67 | * \brief Copies a matrix. |
68 | * |
69 | * </para><para> |
70 | - * Creates a matrix object by copying another one. |
71 | + * Creates a matrix object by copying from an existing matrix. |
72 | * \param to Pointer to an uninitialized matrix object. |
73 | * \param from The initialized matrix object to copy. |
74 | * \return Error code, \c IGRAPH_ENOMEM if there |
75 | @@ -381,7 +381,7 @@ |
76 | |
77 | /** |
78 | * \function igraph_matrix_select_rows |
79 | - * \brief Select some rows of a matrix |
80 | + * \brief Select some rows of a matrix. |
81 | * |
82 | * This function selects some rows of a matrix and returns them in a |
83 | * new matrix. The result matrix should be initialized before calling |
84 | @@ -389,7 +389,7 @@ |
85 | * \param m The input matrix. |
86 | * \param res The result matrix. It should be initialized and will be |
87 | * resized as needed. |
88 | - * \param rows Vector, it contains the row indices (starting with |
89 | + * \param rows Vector; it contains the row indices (starting with |
90 | * zero) to extract. Note that no range checking is performed. |
91 | * \return Error code. |
92 | * |
93 | @@ -415,7 +415,7 @@ |
94 | |
95 | /** |
96 | * \function igraph_matrix_select_rows_cols |
97 | - * \brief Select some rows and columns of a matrix |
98 | + * \brief Select some rows and columns of a matrix. |
99 | * |
100 | * This function selects some rows and columns of a matrix and returns |
101 | * them in a new matrix. The result matrix should be initialized before |
102 | @@ -423,9 +423,9 @@ |
103 | * \param m The input matrix. |
104 | * \param res The result matrix. It should be initialized and will be |
105 | * resized as needed. |
106 | - * \param rows Vector, it contains the row indices (starting with |
107 | + * \param rows Vector; it contains the row indices (starting with |
108 | * zero) to extract. Note that no range checking is performed. |
109 | - * \param cols Vector, it contains the column indices (starting with |
110 | + * \param cols Vector; it contains the column indices (starting with |
111 | * zero) to extract. Note that no range checking is performed. |
112 | * \return Error code. |
113 | * |
114 | @@ -454,13 +454,13 @@ |
115 | |
116 | /** |
117 | * \function igraph_matrix_get_col |
118 | - * \brief Select a column |
119 | + * \brief Select a column. |
120 | * |
121 | - * Extract a column of a matrix and return it in a vector. |
122 | + * Extract a column of a matrix and return it as a vector. |
123 | * \param m The input matrix. |
124 | * \param res The result will we stored in this vector. It should be |
125 | * initialized and will be resized as needed. |
126 | - * \param index The index of the solumn to select. |
127 | + * \param index The index of the column to select. |
128 | * \return Error code. |
129 | * |
130 | * Time complexity: O(n), the number of rows in the matrix. |
131 | @@ -481,7 +481,7 @@ |
132 | |
133 | /** |
134 | * \function igraph_matrix_sum |
135 | - * \brief Sum of elements |
136 | + * \brief Sum of elements. |
137 | * |
138 | * Returns the sum of the elements of a matrix. |
139 | * \param m The input matrix. |
140 | @@ -499,12 +499,13 @@ |
141 | * \brief Are two matrices equal? |
142 | * |
143 | * Decides whether two matrices are equal. Two matrices are equal if |
144 | - * they have the same size and contain exactly the same elements. |
145 | + * they have the same dimensions and contain exactly the same elements in |
146 | + * corresponding rows and columns. |
147 | * \param m1 The first matrix. |
148 | * \param m2 The second matrix. |
149 | * \return \c TRUE if they are equal, \c FALSE otherwise. |
150 | * |
151 | - * Time complexity: O(1) if the sizes are different, O(mn) otherwise. |
152 | + * Time complexity: O(1) if the dimensions are different, O(mn) otherwise. |
153 | */ |
154 | |
155 | igraph_bool_t FUNCTION(igraph_matrix,is_equal)(const TYPE(igraph_matrix) *m1, |
156 | @@ -520,9 +521,9 @@ |
157 | * \brief Maximum absolute difference between two matrices |
158 | * |
159 | * Calculate the maximum absolute difference of two matrices. Both matrices |
160 | - * must be non-empty. If their size differs then a warning is given and the |
161 | - * comparision is performed by vectors columnwise from both matrices, |
162 | - * columnwise, the remaining elements in the larger vector are ignored. |
163 | + * must be non-empty. If their dimensions differ then a warning is given and |
164 | + * the comparison is performed by vectors columnwise from both matrices. |
165 | + * Columnwise, the remaining elements in the larger vector are ignored. |
166 | * \param m1 The first matrix. |
167 | * \param m2 The second matrix. |
168 | * \return The element with the largest absolute value in \c m1 - \c m2. |
169 | @@ -546,7 +547,7 @@ |
170 | |
171 | /** |
172 | * \function igraph_matrix_transpose |
173 | - * \brief Transpose |
174 | + * \brief Transpose. |
175 | * |
176 | * Calculate the transpose of a matrix. Note that the function |
177 | * reallocates the memory used for the matrix. |
178 | @@ -580,7 +581,7 @@ |
179 | |
180 | /** |
181 | * \function igraph_matrix_e |
182 | - * Extract an element |
183 | + * Extract an element. |
184 | * |
185 | * Use this if you need a function for some reason and cannot use the |
186 | * \ref MATRIX macro. Note that no range checking is performed. |
187 | @@ -599,7 +600,7 @@ |
188 | |
189 | /** |
190 | * \function igraph_matrix_e_ptr |
191 | - * Pointer to an element |
192 | + * Pointer to an element. |
193 | * |
194 | * The function returns a pointer to an element. No range checking is |
195 | * performed. |
196 | @@ -620,7 +621,7 @@ |
197 | * \function igraph_matrix_set |
198 | * Set an element. |
199 | * |
200 | - * Set and element of a matrix. No range cheking is performed. |
201 | + * Set an element of a matrix. No range checking is performed. |
202 | * \param m The input matrix. |
203 | * \param row The row index. |
204 | * \param col The column index. |
205 | @@ -656,7 +657,7 @@ |
206 | * This function replicates \p from in the matrix \p to. |
207 | * Note that \p to must be already initialized. |
208 | * \param to The result matrix. |
209 | - * \param from The matrix to replicate, it is left unchanged. |
210 | + * \param from The matrix to replicate; it is left unchanged. |
211 | * \return Error code. |
212 | * |
213 | * Time complexity: O(mn), the number of elements. |
214 | @@ -672,12 +673,12 @@ |
215 | |
216 | /** |
217 | * \function igraph_matrix_rbind |
218 | - * Combine two matrices rowwise |
219 | + * Combine two matrices rowwise. |
220 | * |
221 | * This function places the rows of \p from below the rows of \c to |
222 | * and stores the result in \p to. The number of columns in the two |
223 | * matrices must match. |
224 | - * \param to The upper matrix, the result is also stored here. |
225 | + * \param to The upper matrix; the result is also stored here. |
226 | * \param from The lower matrix. It is left unchanged. |
227 | * \return Error code. |
228 | * |
229 | @@ -691,7 +692,7 @@ |
230 | long int torows=to->nrow, fromrows=from->nrow; |
231 | long int offset, c, r, index, offset2; |
232 | if (tocols != fromcols) { |
233 | - IGRAPH_ERROR("Cannot do rbind, number of colums do not match", IGRAPH_EINVAL); |
234 | + IGRAPH_ERROR("Cannot do rbind, number of columns do not match", IGRAPH_EINVAL); |
235 | } |
236 | |
237 | IGRAPH_CHECK(FUNCTION(igraph_vector,resize)(&to->data, |
238 | @@ -719,11 +720,11 @@ |
239 | |
240 | /** |
241 | * \function igraph_matrix_cbind |
242 | - * Combine matrices, columnwise. |
243 | + * Combine matrices columnwise. |
244 | * |
245 | * This function places the columns of \p from on the right of \p to, |
246 | * and stores the result in \p to. |
247 | - * \param to The left matrix, the result is stored here too. |
248 | + * \param to The left matrix; the result is stored here too. |
249 | * \param from The right matrix. It is left unchanged. |
250 | * \return Error code. |
251 | * |
252 | @@ -745,10 +746,10 @@ |
253 | |
254 | /** |
255 | * \function igraph_matrix_swap |
256 | - * Swap two matrices |
257 | + * Swap two matrices. |
258 | * |
259 | - * The contents of the two matrices will be swapped. They must be the |
260 | - * same size. |
261 | + * The contents of the two matrices will be swapped. They must have the |
262 | + * same dimensions. |
263 | * \param m1 The first matrix. |
264 | * \param m2 The second matrix. |
265 | * \return Error code. |
266 | @@ -765,11 +766,11 @@ |
267 | |
268 | /** |
269 | * \function igraph_matrix_get_row |
270 | - * Extract a row |
271 | + * Extract a row. |
272 | * |
273 | * Extract a row from a matrix and return it as a vector. |
274 | * \param m The input matrix. |
275 | - * \param res Pointer to an initialized vector, it will be resized if |
276 | + * \param res Pointer to an initialized vector; it will be resized if |
277 | * needed. |
278 | * \param index The index of the row to select. |
279 | * \return Error code. |
280 | @@ -797,9 +798,10 @@ |
281 | * \function igraph_matrix_set_row |
282 | * Set a row from a vector. |
283 | * |
284 | - * Sets the elements of a row, from the given vector. The length of |
285 | + * Sets the elements of a row with the given vector. This has the effect of |
286 | + * setting row \c index to have the elements in the vector \c v. The length of |
287 | * the vector and the number of columns in the matrix must match, |
288 | - * otherwise and error is triggered. |
289 | + * otherwise an error is triggered. |
290 | * \param m The input matrix. |
291 | * \param v The vector containing the new elements of the row. |
292 | * \param index Index of the row to set. |
293 | @@ -829,9 +831,10 @@ |
294 | * \function igraph_matrix_set_col |
295 | * Set a column from a vector. |
296 | * |
297 | - * Sets the elements of a column, from the given vector. The length of |
298 | + * Sets the elements of a column with the given vector. In effect, column |
299 | + * \c index will be set with elements from the vector \c v. The length of |
300 | * the vector and the number of rows in the matrix must match, |
301 | - * otherwise and error is triggered. |
302 | + * otherwise an error is triggered. |
303 | * \param m The input matrix. |
304 | * \param v The vector containing the new elements of the column. |
305 | * \param index Index of the column to set. |
306 | @@ -859,7 +862,7 @@ |
307 | |
308 | /** |
309 | * \function igraph_matrix_swap_rows |
310 | - * Swap two rows |
311 | + * Swap two rows. |
312 | * |
313 | * Swap two rows in the matrix. |
314 | * \param m The input matrix. |
315 | @@ -890,7 +893,7 @@ |
316 | |
317 | /** |
318 | * \function igraph_matrix_swap_cols |
319 | - * Swap two columns |
320 | + * Swap two columns. |
321 | * |
322 | * Swap two columns in the matrix. |
323 | * \param m The input matrix. |
324 | @@ -935,10 +938,10 @@ |
325 | * \function igraph_matrix_add |
326 | * Add two matrices. |
327 | * |
328 | - * Add \p m2 to \p m1, and store the result in \p m1. The size of the |
329 | + * Add \p m2 to \p m1, and store the result in \p m1. The dimensions of the |
330 | * matrices must match. |
331 | - * \param m1 The first matrix, the result will be stored here. |
332 | - * \param m2 The second matrix, it is left unchanged. |
333 | + * \param m1 The first matrix; the result will be stored here. |
334 | + * \param m2 The second matrix; it is left unchanged. |
335 | * \return Error code. |
336 | * |
337 | * Time complexity: O(mn), the number of elements. |
338 | @@ -957,9 +960,9 @@ |
339 | * Difference of two matrices. |
340 | * |
341 | * Subtract \p m2 from \p m1 and store the result in \p m1. |
342 | - * The size of the two matrices must match. |
343 | - * \param m1 The first matrix, the result is stored here. |
344 | - * \param m2 The second matrix, it is left unchanged. |
345 | + * The dimensions of the two matrices must match. |
346 | + * \param m1 The first matrix; the result is stored here. |
347 | + * \param m2 The second matrix; it is left unchanged. |
348 | * \return Error code. |
349 | * |
350 | * Time complexity: O(mn), the number of elements. |
351 | @@ -978,9 +981,9 @@ |
352 | * Elementwise multiplication. |
353 | * |
354 | * Multiply \p m1 by \p m2 elementwise and store the result in \p m1. |
355 | - * The size of the two matrices must match. |
356 | - * \param m1 The first matrix, the result is stored here. |
357 | - * \param m2 The second matrix, it is left unchanged. |
358 | + * The dimensions of the two matrices must match. |
359 | + * \param m1 The first matrix; the result is stored here. |
360 | + * \param m2 The second matrix; it is left unchanged. |
361 | * \return Error code. |
362 | * |
363 | * Time complexity: O(mn), the number of elements. |
364 | @@ -999,8 +1002,8 @@ |
365 | * Elementwise division. |
366 | * |
367 | * Divide \p m1 by \p m2 elementwise and store the result in \p m1. |
368 | - * The size of the two matrices must match. |
369 | - * \param m1 The divident. The result is store here. |
370 | + * The dimensions of the two matrices must match. |
371 | + * \param m1 The dividend. The result is store here. |
372 | * \param m2 The divisor. It is left unchanged. |
373 | * \return Error code. |
374 | * |
375 | @@ -1203,9 +1206,9 @@ |
376 | * \function igraph_matrix_prod |
377 | * Product of the elements. |
378 | * |
379 | - * Note this function can result an overflow easily, even for not too |
380 | + * Note this function can result in overflow easily, even for not too |
381 | * big matrices. |
382 | - * \param The input matrix. |
383 | + * \param m The input matrix. |
384 | * \return The product of the elements. |
385 | * |
386 | * Time complexity: O(mn), the number of elements. |
387 | @@ -1217,11 +1220,11 @@ |
388 | |
389 | /** |
390 | * \function igraph_matrix_rowsum |
391 | - * Rowwise sum |
392 | + * Rowwise sum. |
393 | * |
394 | * Calculate the sum of the elements in each row. |
395 | * \param m The input matrix. |
396 | - * \param res Pointer to an initialized vector, the result is stored |
397 | + * \param res Pointer to an initialized vector; the result is stored |
398 | * here. It will be resized if necessary. |
399 | * \return Error code. |
400 | * |
401 | @@ -1250,11 +1253,11 @@ |
402 | |
403 | /** |
404 | * \function igraph_matrix_colsum |
405 | - * Columnwise sum |
406 | + * Columnwise sum. |
407 | * |
408 | * Calculate the sum of the elements in each column. |
409 | * \param m The input matrix. |
410 | - * \param res Pointer to an initialized vector, the result is stored |
411 | + * \param res Pointer to an initialized vector; the result is stored |
412 | * here. It will be resized if necessary. |
413 | * \return Error code. |
414 | * |
415 | @@ -1335,7 +1338,7 @@ |
416 | |
417 | /** |
418 | * \function igraph_matrix_remove_row |
419 | - * Remove a row |
420 | + * Remove a row. |
421 | * |
422 | * A row is removed from the matrix. |
423 | * \param m The input matrix. |
424 | @@ -1367,7 +1370,7 @@ |
425 | |
426 | /** |
427 | * \function igraph_matrix_select_cols |
428 | - * \brief Select some columns of a matrix |
429 | + * \brief Select some columns of a matrix. |
430 | * |
431 | * This function selects some columns of a matrix and returns them in a |
432 | * new matrix. The result matrix should be initialized before calling |
433 | @@ -1375,7 +1378,7 @@ |
434 | * \param m The input matrix. |
435 | * \param res The result matrix. It should be initialized and will be |
436 | * resized as needed. |
437 | - * \param cols Vector, it contains the column indices (starting with |
438 | + * \param cols Vector; it contains the column indices (starting with |
439 | * zero) to extract. Note that no range checking is performed. |
440 | * \return Error code. |
441 | * |