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 | 35 | * <para>This type is just an interface to \type igraph_vector_t.</para> | 35 | * <para>This type is just an interface to \type igraph_vector_t.</para> |
6 | 36 | * | 36 | * |
7 | 37 | * <para>The \type igraph_matrix_t type usually stores n | 37 | * <para>The \type igraph_matrix_t type usually stores n |
9 | 38 | * elements in O(n) space, but not always, see the documentation of | 38 | * elements in O(n) space, but not always. See the documentation of |
10 | 39 | * the vector type.</para> | 39 | * the vector type.</para> |
11 | 40 | */ | 40 | */ |
12 | 41 | 41 | ||
13 | @@ -50,9 +50,9 @@ | |||
14 | 50 | * \brief Initializes a matrix. | 50 | * \brief Initializes a matrix. |
15 | 51 | * | 51 | * |
16 | 52 | * </para><para> | 52 | * </para><para> |
18 | 53 | * Every matrix needs to be initialized before using it, this is done | 53 | * Every matrix needs to be initialized before using it. This is done |
19 | 54 | * by calling this function. A matrix has to be destroyed if it is not | 54 | * by calling this function. A matrix has to be destroyed if it is not |
21 | 55 | * needed any more, see \ref igraph_matrix_destroy(). | 55 | * needed any more; see \ref igraph_matrix_destroy(). |
22 | 56 | * \param m Pointer to a not yet initialized matrix object to be | 56 | * \param m Pointer to a not yet initialized matrix object to be |
23 | 57 | * initialized. | 57 | * initialized. |
24 | 58 | * \param nrow The number of rows in the matrix. | 58 | * \param nrow The number of rows in the matrix. |
25 | @@ -102,7 +102,7 @@ | |||
26 | 102 | * </para><para> | 102 | * </para><para> |
27 | 103 | * This function resizes a matrix by adding more elements to it. | 103 | * This function resizes a matrix by adding more elements to it. |
28 | 104 | * The matrix contains arbitrary data after resizing it. | 104 | * The matrix contains arbitrary data after resizing it. |
30 | 105 | * Ie. after calling this function you cannot expect that element | 105 | * That is, after calling this function you cannot expect that element |
31 | 106 | * (i,j) in the matrix remains the | 106 | * (i,j) in the matrix remains the |
32 | 107 | * same as before. | 107 | * same as before. |
33 | 108 | * \param m Pointer to an already initialized matrix object. | 108 | * \param m Pointer to an already initialized matrix object. |
34 | @@ -176,10 +176,10 @@ | |||
35 | 176 | * </para><para> | 176 | * </para><para> |
36 | 177 | * The matrix is copied columnwise, as this is the format most | 177 | * The matrix is copied columnwise, as this is the format most |
37 | 178 | * programs and languages use. | 178 | * programs and languages use. |
40 | 179 | * The C array should be of sufficient size, there are (of course) not | 179 | * The C array should be of sufficient size; there are (of course) no |
41 | 180 | * range checks done. | 180 | * range checks. |
42 | 181 | * \param m Pointer to an initialized matrix object. | 181 | * \param m Pointer to an initialized matrix object. |
44 | 182 | * \param to Pointer to a C array, the place to copy the data to. | 182 | * \param to Pointer to a C array; the place to copy the data to. |
45 | 183 | * \return Error code. | 183 | * \return Error code. |
46 | 184 | * | 184 | * |
47 | 185 | * Time complexity: O(n), | 185 | * Time complexity: O(n), |
48 | @@ -194,7 +194,7 @@ | |||
49 | 194 | /** | 194 | /** |
50 | 195 | * \ingroup matrix | 195 | * \ingroup matrix |
51 | 196 | * \function igraph_matrix_null | 196 | * \function igraph_matrix_null |
53 | 197 | * \brief Sets all element in a matrix to zero. | 197 | * \brief Sets all elements in a matrix to zero. |
54 | 198 | * | 198 | * |
55 | 199 | * \param m Pointer to an initialized matrix object. | 199 | * \param m Pointer to an initialized matrix object. |
56 | 200 | * | 200 | * |
57 | @@ -235,7 +235,7 @@ | |||
58 | 235 | * isn't enough memory for the operation. | 235 | * isn't enough memory for the operation. |
59 | 236 | * | 236 | * |
60 | 237 | * Time complexity: linear with the number of elements of the new, | 237 | * Time complexity: linear with the number of elements of the new, |
62 | 238 | * resized, matrix. | 238 | * resized matrix. |
63 | 239 | */ | 239 | */ |
64 | 240 | 240 | ||
65 | 241 | int FUNCTION(igraph_matrix,add_rows)(TYPE(igraph_matrix) *m, long int n) { | 241 | int FUNCTION(igraph_matrix,add_rows)(TYPE(igraph_matrix) *m, long int n) { |
66 | @@ -326,7 +326,7 @@ | |||
67 | 326 | * \brief Copies a matrix. | 326 | * \brief Copies a matrix. |
68 | 327 | * | 327 | * |
69 | 328 | * </para><para> | 328 | * </para><para> |
71 | 329 | * Creates a matrix object by copying another one. | 329 | * Creates a matrix object by copying from an existing matrix. |
72 | 330 | * \param to Pointer to an uninitialized matrix object. | 330 | * \param to Pointer to an uninitialized matrix object. |
73 | 331 | * \param from The initialized matrix object to copy. | 331 | * \param from The initialized matrix object to copy. |
74 | 332 | * \return Error code, \c IGRAPH_ENOMEM if there | 332 | * \return Error code, \c IGRAPH_ENOMEM if there |
75 | @@ -381,7 +381,7 @@ | |||
76 | 381 | 381 | ||
77 | 382 | /** | 382 | /** |
78 | 383 | * \function igraph_matrix_select_rows | 383 | * \function igraph_matrix_select_rows |
80 | 384 | * \brief Select some rows of a matrix | 384 | * \brief Select some rows of a matrix. |
81 | 385 | * | 385 | * |
82 | 386 | * This function selects some rows of a matrix and returns them in a | 386 | * This function selects some rows of a matrix and returns them in a |
83 | 387 | * new matrix. The result matrix should be initialized before calling | 387 | * new matrix. The result matrix should be initialized before calling |
84 | @@ -389,7 +389,7 @@ | |||
85 | 389 | * \param m The input matrix. | 389 | * \param m The input matrix. |
86 | 390 | * \param res The result matrix. It should be initialized and will be | 390 | * \param res The result matrix. It should be initialized and will be |
87 | 391 | * resized as needed. | 391 | * resized as needed. |
89 | 392 | * \param rows Vector, it contains the row indices (starting with | 392 | * \param rows Vector; it contains the row indices (starting with |
90 | 393 | * zero) to extract. Note that no range checking is performed. | 393 | * zero) to extract. Note that no range checking is performed. |
91 | 394 | * \return Error code. | 394 | * \return Error code. |
92 | 395 | * | 395 | * |
93 | @@ -415,7 +415,7 @@ | |||
94 | 415 | 415 | ||
95 | 416 | /** | 416 | /** |
96 | 417 | * \function igraph_matrix_select_rows_cols | 417 | * \function igraph_matrix_select_rows_cols |
98 | 418 | * \brief Select some rows and columns of a matrix | 418 | * \brief Select some rows and columns of a matrix. |
99 | 419 | * | 419 | * |
100 | 420 | * This function selects some rows and columns of a matrix and returns | 420 | * This function selects some rows and columns of a matrix and returns |
101 | 421 | * them in a new matrix. The result matrix should be initialized before | 421 | * them in a new matrix. The result matrix should be initialized before |
102 | @@ -423,9 +423,9 @@ | |||
103 | 423 | * \param m The input matrix. | 423 | * \param m The input matrix. |
104 | 424 | * \param res The result matrix. It should be initialized and will be | 424 | * \param res The result matrix. It should be initialized and will be |
105 | 425 | * resized as needed. | 425 | * resized as needed. |
107 | 426 | * \param rows Vector, it contains the row indices (starting with | 426 | * \param rows Vector; it contains the row indices (starting with |
108 | 427 | * zero) to extract. Note that no range checking is performed. | 427 | * zero) to extract. Note that no range checking is performed. |
110 | 428 | * \param cols Vector, it contains the column indices (starting with | 428 | * \param cols Vector; it contains the column indices (starting with |
111 | 429 | * zero) to extract. Note that no range checking is performed. | 429 | * zero) to extract. Note that no range checking is performed. |
112 | 430 | * \return Error code. | 430 | * \return Error code. |
113 | 431 | * | 431 | * |
114 | @@ -454,13 +454,13 @@ | |||
115 | 454 | 454 | ||
116 | 455 | /** | 455 | /** |
117 | 456 | * \function igraph_matrix_get_col | 456 | * \function igraph_matrix_get_col |
119 | 457 | * \brief Select a column | 457 | * \brief Select a column. |
120 | 458 | * | 458 | * |
122 | 459 | * Extract a column of a matrix and return it in a vector. | 459 | * Extract a column of a matrix and return it as a vector. |
123 | 460 | * \param m The input matrix. | 460 | * \param m The input matrix. |
124 | 461 | * \param res The result will we stored in this vector. It should be | 461 | * \param res The result will we stored in this vector. It should be |
125 | 462 | * initialized and will be resized as needed. | 462 | * initialized and will be resized as needed. |
127 | 463 | * \param index The index of the solumn to select. | 463 | * \param index The index of the column to select. |
128 | 464 | * \return Error code. | 464 | * \return Error code. |
129 | 465 | * | 465 | * |
130 | 466 | * Time complexity: O(n), the number of rows in the matrix. | 466 | * Time complexity: O(n), the number of rows in the matrix. |
131 | @@ -481,7 +481,7 @@ | |||
132 | 481 | 481 | ||
133 | 482 | /** | 482 | /** |
134 | 483 | * \function igraph_matrix_sum | 483 | * \function igraph_matrix_sum |
136 | 484 | * \brief Sum of elements | 484 | * \brief Sum of elements. |
137 | 485 | * | 485 | * |
138 | 486 | * Returns the sum of the elements of a matrix. | 486 | * Returns the sum of the elements of a matrix. |
139 | 487 | * \param m The input matrix. | 487 | * \param m The input matrix. |
140 | @@ -499,12 +499,13 @@ | |||
141 | 499 | * \brief Are two matrices equal? | 499 | * \brief Are two matrices equal? |
142 | 500 | * | 500 | * |
143 | 501 | * Decides whether two matrices are equal. Two matrices are equal if | 501 | * Decides whether two matrices are equal. Two matrices are equal if |
145 | 502 | * they have the same size and contain exactly the same elements. | 502 | * they have the same dimensions and contain exactly the same elements in |
146 | 503 | * corresponding rows and columns. | ||
147 | 503 | * \param m1 The first matrix. | 504 | * \param m1 The first matrix. |
148 | 504 | * \param m2 The second matrix. | 505 | * \param m2 The second matrix. |
149 | 505 | * \return \c TRUE if they are equal, \c FALSE otherwise. | 506 | * \return \c TRUE if they are equal, \c FALSE otherwise. |
150 | 506 | * | 507 | * |
152 | 507 | * Time complexity: O(1) if the sizes are different, O(mn) otherwise. | 508 | * Time complexity: O(1) if the dimensions are different, O(mn) otherwise. |
153 | 508 | */ | 509 | */ |
154 | 509 | 510 | ||
155 | 510 | igraph_bool_t FUNCTION(igraph_matrix,is_equal)(const TYPE(igraph_matrix) *m1, | 511 | igraph_bool_t FUNCTION(igraph_matrix,is_equal)(const TYPE(igraph_matrix) *m1, |
156 | @@ -520,9 +521,9 @@ | |||
157 | 520 | * \brief Maximum absolute difference between two matrices | 521 | * \brief Maximum absolute difference between two matrices |
158 | 521 | * | 522 | * |
159 | 522 | * Calculate the maximum absolute difference of two matrices. Both matrices | 523 | * Calculate the maximum absolute difference of two matrices. Both matrices |
163 | 523 | * must be non-empty. If their size differs then a warning is given and the | 524 | * must be non-empty. If their dimensions differ then a warning is given and |
164 | 524 | * comparision is performed by vectors columnwise from both matrices, | 525 | * the comparison is performed by vectors columnwise from both matrices. |
165 | 525 | * columnwise, the remaining elements in the larger vector are ignored. | 526 | * Columnwise, the remaining elements in the larger vector are ignored. |
166 | 526 | * \param m1 The first matrix. | 527 | * \param m1 The first matrix. |
167 | 527 | * \param m2 The second matrix. | 528 | * \param m2 The second matrix. |
168 | 528 | * \return The element with the largest absolute value in \c m1 - \c m2. | 529 | * \return The element with the largest absolute value in \c m1 - \c m2. |
169 | @@ -546,7 +547,7 @@ | |||
170 | 546 | 547 | ||
171 | 547 | /** | 548 | /** |
172 | 548 | * \function igraph_matrix_transpose | 549 | * \function igraph_matrix_transpose |
174 | 549 | * \brief Transpose | 550 | * \brief Transpose. |
175 | 550 | * | 551 | * |
176 | 551 | * Calculate the transpose of a matrix. Note that the function | 552 | * Calculate the transpose of a matrix. Note that the function |
177 | 552 | * reallocates the memory used for the matrix. | 553 | * reallocates the memory used for the matrix. |
178 | @@ -580,7 +581,7 @@ | |||
179 | 580 | 581 | ||
180 | 581 | /** | 582 | /** |
181 | 582 | * \function igraph_matrix_e | 583 | * \function igraph_matrix_e |
183 | 583 | * Extract an element | 584 | * Extract an element. |
184 | 584 | * | 585 | * |
185 | 585 | * Use this if you need a function for some reason and cannot use the | 586 | * Use this if you need a function for some reason and cannot use the |
186 | 586 | * \ref MATRIX macro. Note that no range checking is performed. | 587 | * \ref MATRIX macro. Note that no range checking is performed. |
187 | @@ -599,7 +600,7 @@ | |||
188 | 599 | 600 | ||
189 | 600 | /** | 601 | /** |
190 | 601 | * \function igraph_matrix_e_ptr | 602 | * \function igraph_matrix_e_ptr |
192 | 602 | * Pointer to an element | 603 | * Pointer to an element. |
193 | 603 | * | 604 | * |
194 | 604 | * The function returns a pointer to an element. No range checking is | 605 | * The function returns a pointer to an element. No range checking is |
195 | 605 | * performed. | 606 | * performed. |
196 | @@ -620,7 +621,7 @@ | |||
197 | 620 | * \function igraph_matrix_set | 621 | * \function igraph_matrix_set |
198 | 621 | * Set an element. | 622 | * Set an element. |
199 | 622 | * | 623 | * |
201 | 623 | * Set and element of a matrix. No range cheking is performed. | 624 | * Set an element of a matrix. No range checking is performed. |
202 | 624 | * \param m The input matrix. | 625 | * \param m The input matrix. |
203 | 625 | * \param row The row index. | 626 | * \param row The row index. |
204 | 626 | * \param col The column index. | 627 | * \param col The column index. |
205 | @@ -656,7 +657,7 @@ | |||
206 | 656 | * This function replicates \p from in the matrix \p to. | 657 | * This function replicates \p from in the matrix \p to. |
207 | 657 | * Note that \p to must be already initialized. | 658 | * Note that \p to must be already initialized. |
208 | 658 | * \param to The result matrix. | 659 | * \param to The result matrix. |
210 | 659 | * \param from The matrix to replicate, it is left unchanged. | 660 | * \param from The matrix to replicate; it is left unchanged. |
211 | 660 | * \return Error code. | 661 | * \return Error code. |
212 | 661 | * | 662 | * |
213 | 662 | * Time complexity: O(mn), the number of elements. | 663 | * Time complexity: O(mn), the number of elements. |
214 | @@ -672,12 +673,12 @@ | |||
215 | 672 | 673 | ||
216 | 673 | /** | 674 | /** |
217 | 674 | * \function igraph_matrix_rbind | 675 | * \function igraph_matrix_rbind |
219 | 675 | * Combine two matrices rowwise | 676 | * Combine two matrices rowwise. |
220 | 676 | * | 677 | * |
221 | 677 | * This function places the rows of \p from below the rows of \c to | 678 | * This function places the rows of \p from below the rows of \c to |
222 | 678 | * and stores the result in \p to. The number of columns in the two | 679 | * and stores the result in \p to. The number of columns in the two |
223 | 679 | * matrices must match. | 680 | * matrices must match. |
225 | 680 | * \param to The upper matrix, the result is also stored here. | 681 | * \param to The upper matrix; the result is also stored here. |
226 | 681 | * \param from The lower matrix. It is left unchanged. | 682 | * \param from The lower matrix. It is left unchanged. |
227 | 682 | * \return Error code. | 683 | * \return Error code. |
228 | 683 | * | 684 | * |
229 | @@ -691,7 +692,7 @@ | |||
230 | 691 | long int torows=to->nrow, fromrows=from->nrow; | 692 | long int torows=to->nrow, fromrows=from->nrow; |
231 | 692 | long int offset, c, r, index, offset2; | 693 | long int offset, c, r, index, offset2; |
232 | 693 | if (tocols != fromcols) { | 694 | if (tocols != fromcols) { |
234 | 694 | IGRAPH_ERROR("Cannot do rbind, number of colums do not match", IGRAPH_EINVAL); | 695 | IGRAPH_ERROR("Cannot do rbind, number of columns do not match", IGRAPH_EINVAL); |
235 | 695 | } | 696 | } |
236 | 696 | 697 | ||
237 | 697 | IGRAPH_CHECK(FUNCTION(igraph_vector,resize)(&to->data, | 698 | IGRAPH_CHECK(FUNCTION(igraph_vector,resize)(&to->data, |
238 | @@ -719,11 +720,11 @@ | |||
239 | 719 | 720 | ||
240 | 720 | /** | 721 | /** |
241 | 721 | * \function igraph_matrix_cbind | 722 | * \function igraph_matrix_cbind |
243 | 722 | * Combine matrices, columnwise. | 723 | * Combine matrices columnwise. |
244 | 723 | * | 724 | * |
245 | 724 | * This function places the columns of \p from on the right of \p to, | 725 | * This function places the columns of \p from on the right of \p to, |
246 | 725 | * and stores the result in \p to. | 726 | * and stores the result in \p to. |
248 | 726 | * \param to The left matrix, the result is stored here too. | 727 | * \param to The left matrix; the result is stored here too. |
249 | 727 | * \param from The right matrix. It is left unchanged. | 728 | * \param from The right matrix. It is left unchanged. |
250 | 728 | * \return Error code. | 729 | * \return Error code. |
251 | 729 | * | 730 | * |
252 | @@ -745,10 +746,10 @@ | |||
253 | 745 | 746 | ||
254 | 746 | /** | 747 | /** |
255 | 747 | * \function igraph_matrix_swap | 748 | * \function igraph_matrix_swap |
257 | 748 | * Swap two matrices | 749 | * Swap two matrices. |
258 | 749 | * | 750 | * |
261 | 750 | * The contents of the two matrices will be swapped. They must be the | 751 | * The contents of the two matrices will be swapped. They must have the |
262 | 751 | * same size. | 752 | * same dimensions. |
263 | 752 | * \param m1 The first matrix. | 753 | * \param m1 The first matrix. |
264 | 753 | * \param m2 The second matrix. | 754 | * \param m2 The second matrix. |
265 | 754 | * \return Error code. | 755 | * \return Error code. |
266 | @@ -765,11 +766,11 @@ | |||
267 | 765 | 766 | ||
268 | 766 | /** | 767 | /** |
269 | 767 | * \function igraph_matrix_get_row | 768 | * \function igraph_matrix_get_row |
271 | 768 | * Extract a row | 769 | * Extract a row. |
272 | 769 | * | 770 | * |
273 | 770 | * Extract a row from a matrix and return it as a vector. | 771 | * Extract a row from a matrix and return it as a vector. |
274 | 771 | * \param m The input matrix. | 772 | * \param m The input matrix. |
276 | 772 | * \param res Pointer to an initialized vector, it will be resized if | 773 | * \param res Pointer to an initialized vector; it will be resized if |
277 | 773 | * needed. | 774 | * needed. |
278 | 774 | * \param index The index of the row to select. | 775 | * \param index The index of the row to select. |
279 | 775 | * \return Error code. | 776 | * \return Error code. |
280 | @@ -797,9 +798,10 @@ | |||
281 | 797 | * \function igraph_matrix_set_row | 798 | * \function igraph_matrix_set_row |
282 | 798 | * Set a row from a vector. | 799 | * Set a row from a vector. |
283 | 799 | * | 800 | * |
285 | 800 | * Sets the elements of a row, from the given vector. The length of | 801 | * Sets the elements of a row with the given vector. This has the effect of |
286 | 802 | * setting row \c index to have the elements in the vector \c v. The length of | ||
287 | 801 | * the vector and the number of columns in the matrix must match, | 803 | * the vector and the number of columns in the matrix must match, |
289 | 802 | * otherwise and error is triggered. | 804 | * otherwise an error is triggered. |
290 | 803 | * \param m The input matrix. | 805 | * \param m The input matrix. |
291 | 804 | * \param v The vector containing the new elements of the row. | 806 | * \param v The vector containing the new elements of the row. |
292 | 805 | * \param index Index of the row to set. | 807 | * \param index Index of the row to set. |
293 | @@ -829,9 +831,10 @@ | |||
294 | 829 | * \function igraph_matrix_set_col | 831 | * \function igraph_matrix_set_col |
295 | 830 | * Set a column from a vector. | 832 | * Set a column from a vector. |
296 | 831 | * | 833 | * |
298 | 832 | * Sets the elements of a column, from the given vector. The length of | 834 | * Sets the elements of a column with the given vector. In effect, column |
299 | 835 | * \c index will be set with elements from the vector \c v. The length of | ||
300 | 833 | * the vector and the number of rows in the matrix must match, | 836 | * the vector and the number of rows in the matrix must match, |
302 | 834 | * otherwise and error is triggered. | 837 | * otherwise an error is triggered. |
303 | 835 | * \param m The input matrix. | 838 | * \param m The input matrix. |
304 | 836 | * \param v The vector containing the new elements of the column. | 839 | * \param v The vector containing the new elements of the column. |
305 | 837 | * \param index Index of the column to set. | 840 | * \param index Index of the column to set. |
306 | @@ -859,7 +862,7 @@ | |||
307 | 859 | 862 | ||
308 | 860 | /** | 863 | /** |
309 | 861 | * \function igraph_matrix_swap_rows | 864 | * \function igraph_matrix_swap_rows |
311 | 862 | * Swap two rows | 865 | * Swap two rows. |
312 | 863 | * | 866 | * |
313 | 864 | * Swap two rows in the matrix. | 867 | * Swap two rows in the matrix. |
314 | 865 | * \param m The input matrix. | 868 | * \param m The input matrix. |
315 | @@ -890,7 +893,7 @@ | |||
316 | 890 | 893 | ||
317 | 891 | /** | 894 | /** |
318 | 892 | * \function igraph_matrix_swap_cols | 895 | * \function igraph_matrix_swap_cols |
320 | 893 | * Swap two columns | 896 | * Swap two columns. |
321 | 894 | * | 897 | * |
322 | 895 | * Swap two columns in the matrix. | 898 | * Swap two columns in the matrix. |
323 | 896 | * \param m The input matrix. | 899 | * \param m The input matrix. |
324 | @@ -935,10 +938,10 @@ | |||
325 | 935 | * \function igraph_matrix_add | 938 | * \function igraph_matrix_add |
326 | 936 | * Add two matrices. | 939 | * Add two matrices. |
327 | 937 | * | 940 | * |
329 | 938 | * Add \p m2 to \p m1, and store the result in \p m1. The size of the | 941 | * Add \p m2 to \p m1, and store the result in \p m1. The dimensions of the |
330 | 939 | * matrices must match. | 942 | * matrices must match. |
333 | 940 | * \param m1 The first matrix, the result will be stored here. | 943 | * \param m1 The first matrix; the result will be stored here. |
334 | 941 | * \param m2 The second matrix, it is left unchanged. | 944 | * \param m2 The second matrix; it is left unchanged. |
335 | 942 | * \return Error code. | 945 | * \return Error code. |
336 | 943 | * | 946 | * |
337 | 944 | * Time complexity: O(mn), the number of elements. | 947 | * Time complexity: O(mn), the number of elements. |
338 | @@ -957,9 +960,9 @@ | |||
339 | 957 | * Difference of two matrices. | 960 | * Difference of two matrices. |
340 | 958 | * | 961 | * |
341 | 959 | * Subtract \p m2 from \p m1 and store the result in \p m1. | 962 | * Subtract \p m2 from \p m1 and store the result in \p m1. |
345 | 960 | * The size of the two matrices must match. | 963 | * The dimensions of the two matrices must match. |
346 | 961 | * \param m1 The first matrix, the result is stored here. | 964 | * \param m1 The first matrix; the result is stored here. |
347 | 962 | * \param m2 The second matrix, it is left unchanged. | 965 | * \param m2 The second matrix; it is left unchanged. |
348 | 963 | * \return Error code. | 966 | * \return Error code. |
349 | 964 | * | 967 | * |
350 | 965 | * Time complexity: O(mn), the number of elements. | 968 | * Time complexity: O(mn), the number of elements. |
351 | @@ -978,9 +981,9 @@ | |||
352 | 978 | * Elementwise multiplication. | 981 | * Elementwise multiplication. |
353 | 979 | * | 982 | * |
354 | 980 | * Multiply \p m1 by \p m2 elementwise and store the result in \p m1. | 983 | * Multiply \p m1 by \p m2 elementwise and store the result in \p m1. |
358 | 981 | * The size of the two matrices must match. | 984 | * The dimensions of the two matrices must match. |
359 | 982 | * \param m1 The first matrix, the result is stored here. | 985 | * \param m1 The first matrix; the result is stored here. |
360 | 983 | * \param m2 The second matrix, it is left unchanged. | 986 | * \param m2 The second matrix; it is left unchanged. |
361 | 984 | * \return Error code. | 987 | * \return Error code. |
362 | 985 | * | 988 | * |
363 | 986 | * Time complexity: O(mn), the number of elements. | 989 | * Time complexity: O(mn), the number of elements. |
364 | @@ -999,8 +1002,8 @@ | |||
365 | 999 | * Elementwise division. | 1002 | * Elementwise division. |
366 | 1000 | * | 1003 | * |
367 | 1001 | * Divide \p m1 by \p m2 elementwise and store the result in \p m1. | 1004 | * Divide \p m1 by \p m2 elementwise and store the result in \p m1. |
370 | 1002 | * The size of the two matrices must match. | 1005 | * The dimensions of the two matrices must match. |
371 | 1003 | * \param m1 The divident. The result is store here. | 1006 | * \param m1 The dividend. The result is store here. |
372 | 1004 | * \param m2 The divisor. It is left unchanged. | 1007 | * \param m2 The divisor. It is left unchanged. |
373 | 1005 | * \return Error code. | 1008 | * \return Error code. |
374 | 1006 | * | 1009 | * |
375 | @@ -1203,9 +1206,9 @@ | |||
376 | 1203 | * \function igraph_matrix_prod | 1206 | * \function igraph_matrix_prod |
377 | 1204 | * Product of the elements. | 1207 | * Product of the elements. |
378 | 1205 | * | 1208 | * |
380 | 1206 | * Note this function can result an overflow easily, even for not too | 1209 | * Note this function can result in overflow easily, even for not too |
381 | 1207 | * big matrices. | 1210 | * big matrices. |
383 | 1208 | * \param The input matrix. | 1211 | * \param m The input matrix. |
384 | 1209 | * \return The product of the elements. | 1212 | * \return The product of the elements. |
385 | 1210 | * | 1213 | * |
386 | 1211 | * Time complexity: O(mn), the number of elements. | 1214 | * Time complexity: O(mn), the number of elements. |
387 | @@ -1217,11 +1220,11 @@ | |||
388 | 1217 | 1220 | ||
389 | 1218 | /** | 1221 | /** |
390 | 1219 | * \function igraph_matrix_rowsum | 1222 | * \function igraph_matrix_rowsum |
392 | 1220 | * Rowwise sum | 1223 | * Rowwise sum. |
393 | 1221 | * | 1224 | * |
394 | 1222 | * Calculate the sum of the elements in each row. | 1225 | * Calculate the sum of the elements in each row. |
395 | 1223 | * \param m The input matrix. | 1226 | * \param m The input matrix. |
397 | 1224 | * \param res Pointer to an initialized vector, the result is stored | 1227 | * \param res Pointer to an initialized vector; the result is stored |
398 | 1225 | * here. It will be resized if necessary. | 1228 | * here. It will be resized if necessary. |
399 | 1226 | * \return Error code. | 1229 | * \return Error code. |
400 | 1227 | * | 1230 | * |
401 | @@ -1250,11 +1253,11 @@ | |||
402 | 1250 | 1253 | ||
403 | 1251 | /** | 1254 | /** |
404 | 1252 | * \function igraph_matrix_colsum | 1255 | * \function igraph_matrix_colsum |
406 | 1253 | * Columnwise sum | 1256 | * Columnwise sum. |
407 | 1254 | * | 1257 | * |
408 | 1255 | * Calculate the sum of the elements in each column. | 1258 | * Calculate the sum of the elements in each column. |
409 | 1256 | * \param m The input matrix. | 1259 | * \param m The input matrix. |
411 | 1257 | * \param res Pointer to an initialized vector, the result is stored | 1260 | * \param res Pointer to an initialized vector; the result is stored |
412 | 1258 | * here. It will be resized if necessary. | 1261 | * here. It will be resized if necessary. |
413 | 1259 | * \return Error code. | 1262 | * \return Error code. |
414 | 1260 | * | 1263 | * |
415 | @@ -1335,7 +1338,7 @@ | |||
416 | 1335 | 1338 | ||
417 | 1336 | /** | 1339 | /** |
418 | 1337 | * \function igraph_matrix_remove_row | 1340 | * \function igraph_matrix_remove_row |
420 | 1338 | * Remove a row | 1341 | * Remove a row. |
421 | 1339 | * | 1342 | * |
422 | 1340 | * A row is removed from the matrix. | 1343 | * A row is removed from the matrix. |
423 | 1341 | * \param m The input matrix. | 1344 | * \param m The input matrix. |
424 | @@ -1367,7 +1370,7 @@ | |||
425 | 1367 | 1370 | ||
426 | 1368 | /** | 1371 | /** |
427 | 1369 | * \function igraph_matrix_select_cols | 1372 | * \function igraph_matrix_select_cols |
429 | 1370 | * \brief Select some columns of a matrix | 1373 | * \brief Select some columns of a matrix. |
430 | 1371 | * | 1374 | * |
431 | 1372 | * This function selects some columns of a matrix and returns them in a | 1375 | * This function selects some columns of a matrix and returns them in a |
432 | 1373 | * new matrix. The result matrix should be initialized before calling | 1376 | * new matrix. The result matrix should be initialized before calling |
433 | @@ -1375,7 +1378,7 @@ | |||
434 | 1375 | * \param m The input matrix. | 1378 | * \param m The input matrix. |
435 | 1376 | * \param res The result matrix. It should be initialized and will be | 1379 | * \param res The result matrix. It should be initialized and will be |
436 | 1377 | * resized as needed. | 1380 | * resized as needed. |
438 | 1378 | * \param cols Vector, it contains the column indices (starting with | 1381 | * \param cols Vector; it contains the column indices (starting with |
439 | 1379 | * zero) to extract. Note that no range checking is performed. | 1382 | * zero) to extract. Note that no range checking is performed. |
440 | 1380 | * \return Error code. | 1383 | * \return Error code. |
441 | 1381 | * | 1384 | * |