1 |
/* |
/* ASCEND modelling environment |
2 |
* mtx: Ascend Sparse Matrix Package |
Copyright (C) 2006 Carnegie Mellon University |
3 |
* by Benjamin Andrew Allan |
Copyright (C) 1996 Benjamin Andrew Allan |
4 |
* Derived from mtx by Karl Michael Westerberg |
|
5 |
* Created: 5/3/90 |
This program is free software; you can redistribute it and/or modify |
6 |
* Version: $Revision: 1.10 $ |
it under the terms of the GNU General Public License as published by |
7 |
* Version control file: $RCSfile: mtx_perms.h,v $ |
the Free Software Foundation; either version 2, or (at your option) |
8 |
* Date last modified: $Date: 1998/05/06 17:28:54 $ |
any later version. |
9 |
* Last modified by: $Author: ballan $ |
|
10 |
* |
This program is distributed in the hope that it will be useful, |
11 |
* This file is part of the SLV solver. |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
* |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
* Copyright (C) 1996 Benjamin Andrew Allan |
GNU General Public License for more details. |
14 |
* |
|
15 |
* The SLV solver is free software; you can redistribute |
You should have received a copy of the GNU General Public License |
16 |
* it and/or modify it under the terms of the GNU General Public License as |
along with this program; if not, write to the Free Software |
17 |
* published by the Free Software Foundation; either version 2 of the |
Foundation, Inc., 59 Temple Place - Suite 330, |
18 |
* License, or (at your option) any later version. |
Boston, MA 02111-1307, USA. |
19 |
* |
*//** @file |
20 |
* The SLV solver is distributed in hope that it will be |
Sparse matrix permutation functions |
21 |
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Requires: |
23 |
* General Public License for more details. |
#include "utilities/ascConfig.h" |
24 |
* |
#include "mtx.h" |
25 |
* You should have received a copy of the GNU General Public License along with |
*//* |
26 |
* the program; if not, write to the Free Software Foundation, Inc., 675 |
by Benjamin Andrew Allan |
27 |
* Mass Ave, Cambridge, MA 02139 USA. Check the file named COPYING. |
derived from mtx by Karl Michael Westerberg |
28 |
* COPYING is found in ../compiler. |
Created: 5/3/90 |
29 |
*/ |
Last in CVS: $Revision: 1.10 $ $Date: 1998/05/06 17:28:54 $ $Author: ballan $ |
30 |
|
*/ |
31 |
|
|
32 |
/** @file |
#ifndef ASC_MTX_PERMS_H |
33 |
* mtx2: Ascend Sparse Matrix Package. |
#define ASC_MTX_PERMS_H |
|
* <pre> |
|
|
* requires: #include "utilities/ascConfig.h" |
|
|
* requires: #include "mtx.h" |
|
|
* </pre> |
|
|
*/ |
|
|
|
|
|
#ifndef __MTX_PERMS_H_SEEN__ |
|
|
#define __MTX_PERMS_H_SEEN__ |
|
34 |
|
|
35 |
/* the following block_perm functions are not yet implemented: |
/* the following block_perm functions are not yet implemented: |
36 |
* this is the software spec. 5/3/95 baa. */ |
* this is the software spec. 5/3/95 baa. */ |
37 |
|
|
38 |
extern mtx_block_perm_t mtx_create_block_perm(mtx_matrix_t mtx); |
extern mtx_block_perm_t mtx_create_block_perm(mtx_matrix_t mtx); |
39 |
/**< |
/**< |
|
*** <!-- bp = mtx_create_block_perm(mtx); --> |
|
|
*** <!-- mtx_matrix_t mtx; --> |
|
|
*** <!-- mtx_block_perm_t bp; --> |
|
|
*** |
|
40 |
*** Returns a token with the permutation/block information of the |
*** Returns a token with the permutation/block information of the |
41 |
*** mtx given. The mtx given must be previously output assigned and, |
*** mtx given. The mtx given must be previously output assigned and, |
42 |
*** if it is to be partitioned, should already be partitioned. |
*** if it is to be partitioned, should already be partitioned. |
56 |
int32 bnum, |
int32 bnum, |
57 |
mtx_block_perm_t bperm); |
mtx_block_perm_t bperm); |
58 |
/**< |
/**< |
|
*** <!-- mtx_update_block_perm(mtx,bnum,bperm); --> |
|
|
*** <!-- mtx_matrix_t mtx; --> |
|
|
*** <!-- int32 bnum; --> |
|
|
*** <!-- mtx_block_perm_t bperm; --> |
|
|
*** |
|
59 |
*** Given an mtx, a block number, and an existing bperm, this |
*** Given an mtx, a block number, and an existing bperm, this |
60 |
*** routine updates the bperm permutation information about the |
*** routine updates the bperm permutation information about the |
61 |
*** block bnum in the mtx. |
*** block bnum in the mtx. |
84 |
int32 bnum, |
int32 bnum, |
85 |
mtx_block_perm_t bperm); |
mtx_block_perm_t bperm); |
86 |
/**< |
/**< |
|
*** <!-- mtx_restore_block_perm(mtx,bnum,bperm); --> |
|
|
*** <!-- mtx_matrix_t mtx; --> |
|
|
*** <!-- int32 bnum; --> |
|
|
*** <!-- mtx_block_perm_t bperm; --> |
|
|
*** |
|
87 |
*** Given an mtx, a block number, and an existing bperm, this |
*** Given an mtx, a block number, and an existing bperm, this |
88 |
*** routine updates the mtx permutation information for the |
*** routine updates the mtx permutation information for the |
89 |
*** block bnum using the bperm. |
*** block bnum using the bperm. |
115 |
|
|
116 |
extern int mtx_destroy_block_perm(mtx_block_perm_t bperm); |
extern int mtx_destroy_block_perm(mtx_block_perm_t bperm); |
117 |
/**< |
/**< |
|
*** <!-- mtx_destroy_block_perm(bperm); --> |
|
|
*** <!-- mtx_block_perm_t bperm; --> |
|
|
*** |
|
118 |
*** Deallocates all memory associated with the bperm. |
*** Deallocates all memory associated with the bperm. |
119 |
*** Has nothing to do with the matrix of bperm's origin. |
*** Has nothing to do with the matrix of bperm's origin. |
120 |
*** Returns 1 if anything untoward happens during the |
*** Returns 1 if anything untoward happens during the |
123 |
|
|
124 |
extern size_t mtx_block_perm_size(mtx_block_perm_t bperm); |
extern size_t mtx_block_perm_size(mtx_block_perm_t bperm); |
125 |
/**< |
/**< |
|
*** <!-- mtx_block_perm_size(bperm); --> |
|
|
*** <!-- mtx_block_perm_t bperm; --> |
|
|
*** |
|
126 |
*** One for the bean counters. Returns current memory used by |
*** One for the bean counters. Returns current memory used by |
127 |
*** the mtx_block_perm_t. Bytes as usual. |
*** the mtx_block_perm_t. Bytes as usual. |
128 |
**/ |
**/ |
129 |
|
|
130 |
/* end block_perm functions */ |
/* end block_perm functions */ |
131 |
|
|
132 |
/* ********************************************************************* *\ |
/*------------------------------------------------------------------------------ |
133 |
mtx permutation and permutation info routines |
MTX PERMUTATION AND PERMUTATION INFO ROUTINES |
134 |
\* ********************************************************************* */ |
*/ |
135 |
|
|
136 |
extern void mtx_swap_rows(mtx_matrix_t mtx, int32 row1, int32 row2); |
extern void mtx_swap_rows(mtx_matrix_t mtx, int32 row1, int32 row2); |
137 |
/**< |
/**< |
138 |
*** Swaps two rows of the matrix. The association between the |
*** Swaps two rows of the matrix. The association between the |
185 |
*** Passes calls on slave matrices up to the master matrix. |
*** Passes calls on slave matrices up to the master matrix. |
186 |
-$- Does nothing to a bad matrix. |
-$- Does nothing to a bad matrix. |
187 |
**/ |
**/ |
188 |
/* OLD GROUP COMMENT */ |
|
|
/* |
|
|
-$- mtx_swap_rows(matrix,row1,row2) |
|
|
-$- mtx_swap_cols(matrix,col1,col2) |
|
|
-$- mtx_drag(matrix,d1,d2) |
|
|
-$- mtx_reverse_diagonal(matrix,d1,d2) |
|
|
*** mtx_matrix_t matrix; |
|
|
*** int32 row1,row2; |
|
|
*** int32 col1,col2; |
|
|
*** int32 d1,d2; |
|
|
*** |
|
|
*** Swaps two rows/columns of the matrix. The association between the |
|
|
*** "original row/column number" and the row/column contents is not |
|
|
*** changed, so that some record is kept as to where a given row/column |
|
|
*** originally came from (see mtx_org_to_row, etc.). |
|
|
*** |
|
|
*** Drag shifts diagonal element d1 to position d2, or vice versa, |
|
|
*** rotating all the intermediate elements as if d1 were swapped |
|
|
*** (row and col) with all the intermediate di. |
|
|
*** Drag exists because it is twice the speed of the following |
|
|
*** implementation outside of mtx: |
|
|
*** while( n1 < n2 ) { |
|
|
*** mtx_swap_rows(mtx,n1,n1+1); |
|
|
*** mtx_swap_cols(mtx,n1,n1+1); |
|
|
*** ++n1; |
|
|
*** } |
|
|
*** while( n1 > n2 ) { |
|
|
*** mtx_swap_rows(mtx,n1,n1-1); |
|
|
*** mtx_swap_cols(mtx,n1,n1-1); |
|
|
*** --n1; |
|
|
*** } |
|
|
*** If it turns out that a cycle_col or cycle_row (independent of diagonal) |
|
|
*** is wanted, implementation is now trivial. |
|
|
*** |
|
|
*** Reverse_diagonal does a series of symmetric permutations that reverses |
|
|
*** the ordering of the diagonal between (and including) d1 & d2. |
|
|
*** If d2 < d1, does nothing. |
|
|
*** |
|
|
*** All pass calls on slave matrices up to the master matrix. |
|
|
*** |
|
|
-$- Does nothing to a bad matrix. |
|
|
**/ |
|
189 |
|
|
190 |
ASC_DLLSPEC(int32 ) mtx_row_to_org(mtx_matrix_t mtx, int32 row); |
ASC_DLLSPEC(int32 ) mtx_row_to_org(mtx_matrix_t mtx, int32 row); |
191 |
/**< |
/**< |
192 |
*** Converts original row number <--> row number. |
Converts original row number <--> row number. |
193 |
*** Passes calls on slave matrices up to the master matrix. |
Passes calls on slave matrices up to the master matrix. |
194 |
-$- Returns -1 from a bad matrix. |
|
195 |
**/ |
@return original row number, or -1 from a bad matrix. |
196 |
|
*/ |
197 |
|
|
198 |
ASC_DLLSPEC(int32 ) mtx_col_to_org(mtx_matrix_t mtx, int32 col); |
ASC_DLLSPEC(int32 ) mtx_col_to_org(mtx_matrix_t mtx, int32 col); |
199 |
/**< |
/**< |
200 |
*** Converts original column number <--> column number. |
Converts original column number <--> column number. |
201 |
*** Passes calls on slave matrices up to the master matrix. |
Passes calls on slave matrices up to the master matrix. |
202 |
-$- Returns -1 from a bad matrix. |
|
203 |
**/ |
@return original column numner, or -1 from a bad matrix. |
204 |
|
*/ |
205 |
|
|
206 |
ASC_DLLSPEC(int32 ) mtx_org_to_row(mtx_matrix_t mtx, int32 orgrow); |
ASC_DLLSPEC(int32 ) mtx_org_to_row(mtx_matrix_t mtx, int32 orgrow); |
207 |
/**< |
/**< |
208 |
*** Converts original row number <--> row number. |
Converts original row number <--> row number. |
209 |
*** Passes calls on slave matrices up to the master matrix. |
Passes calls on slave matrices up to the master matrix. |
210 |
-$- Returns -1 from a bad matrix. |
|
211 |
**/ |
@return row number, or -1 from a bad matrix. |
212 |
|
*/ |
213 |
|
|
214 |
ASC_DLLSPEC(int32 ) mtx_org_to_col(mtx_matrix_t mtx, int32 orgcol); |
ASC_DLLSPEC(int32 ) mtx_org_to_col(mtx_matrix_t mtx, int32 orgcol); |
215 |
/**< |
/**< |
216 |
*** Converts original column number <--> column number. |
Converts original column number <--> column number. |
217 |
*** Passes calls on slave matrices up to the master matrix. |
Passes calls on slave matrices up to the master matrix. |
218 |
-$- Returns -1 from a bad matrix. |
|
219 |
**/ |
@return column number, or -1 in case of a bad matrix. |
220 |
/* OLD GROUP COMMENT */ |
*/ |
221 |
/* |
|
|
-$- org_row = mtx_row_to_org(matrix,row) |
|
|
-$- org_col = mtx_col_to_org(matrix,col) |
|
|
-$- row = mtx_org_to_row(matrix,org_row) |
|
|
-$- col = mtx_org_to_col(matrix,org_col) |
|
|
*** int32 org_row,row,org_col,col; |
|
|
*** mtx_matrix_t matrix; |
|
|
*** |
|
|
*** Converts original row number <--> row number, and original column |
|
|
*** number <--> column number. |
|
|
*** All pass calls on slave matrices up to the master matrix. |
|
|
*** |
|
|
-$- Returns -1 from a bad matrix. |
|
|
**/ |
|
222 |
|
|
223 |
extern boolean mtx_row_parity(mtx_matrix_t mtx); |
extern boolean mtx_row_parity(mtx_matrix_t mtx); |
224 |
/**< |
/**< |
234 |
*** Passes calls on slave matrices up to the master matrix. |
*** Passes calls on slave matrices up to the master matrix. |
235 |
-$- Returns -1 from a bad matrix. |
-$- Returns -1 from a bad matrix. |
236 |
**/ |
**/ |
|
/* OLD GROUP COMMENT */ |
|
|
/* |
|
|
-$- parity = mtx_row_parity(matrix) |
|
|
-$- parity = mtx_col_parity(matrix) |
|
|
*** boolean parity; |
|
|
*** mtx_matrix_t matrix; |
|
|
*** |
|
|
*** Returns the parity (even=FALSE,odd=TRUE) of the permutation which |
|
|
*** carries original row/column to current row/column numbers. |
|
|
*** All pass calls on slave matrices up to the master matrix. |
|
|
*** |
|
|
-$- Returns -1 from a bad matrix. |
|
|
**/ |
|
237 |
|
|
238 |
/* ********************************************************************* *\ |
/*------------------------------------------------------------------------------ |
239 |
mtx structural manipulation and info routines |
MTX STRUCTURAL MANIPULATION AND INFO ROUTINES |
240 |
\* ********************************************************************* */ |
*/ |
241 |
|
|
242 |
extern int mtx_output_assign_region(mtx_matrix_t mtx, |
extern int mtx_output_assign_region(mtx_matrix_t mtx, |
243 |
mtx_region_t *region, |
mtx_region_t *region, |
244 |
int *orphaned_rows); |
int *orphaned_rows); |
245 |
/**< |
/**< |
|
*** <!-- int rank = mtx_output_assign_region(matrix,region,orphaned_rows) --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- mtx_region_t *reg; --> |
|
|
*** <!-- int orphaned_rows; --> |
|
|
*** |
|
246 |
*** This function is very similar to its sister function mtx_output_assign. |
*** This function is very similar to its sister function mtx_output_assign. |
247 |
*** It reorders the matrix to put as many non-zeros on the diagonal as |
*** It reorders the matrix to put as many non-zeros on the diagonal as |
248 |
*** possible. It mtx_ENTIRE_MATRIX is sent in as the region, the output |
*** possible. It mtx_ENTIRE_MATRIX is sent in as the region, the output |
260 |
|
|
261 |
extern void mtx_output_assign(mtx_matrix_t mtx, int32 hirow, int32 hicol); |
extern void mtx_output_assign(mtx_matrix_t mtx, int32 hirow, int32 hicol); |
262 |
/**< |
/**< |
|
*** <!-- mtx_output_assign(matrix,hirow,hicol) --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- int32 hirow,hicol; --> |
|
|
*** |
|
263 |
*** Reorders the matrix to put as many non-zeros on the diagonal as |
*** Reorders the matrix to put as many non-zeros on the diagonal as |
264 |
*** possible. This function does not assume the validity of a previous |
*** possible. This function does not assume the validity of a previous |
265 |
*** assignment. mtx_symbolic_rank() may be subsequently called to produce |
*** assignment. mtx_symbolic_rank() may be subsequently called to produce |
293 |
|
|
294 |
ASC_DLLSPEC(boolean ) mtx_output_assigned(mtx_matrix_t mtx); |
ASC_DLLSPEC(boolean ) mtx_output_assigned(mtx_matrix_t mtx); |
295 |
/**< |
/**< |
|
*** <!-- symbolic_rank_exists = mtx_output_assigned(matrix) --> |
|
|
*** <!-- boolean symbolic_rank_exists; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
296 |
*** Determines if the matrix has been previously output assigned. |
*** Determines if the matrix has been previously output assigned. |
297 |
*** Calls on slaves are passed up to the master matrix. |
*** Calls on slaves are passed up to the master matrix. |
298 |
*** |
*** |
301 |
|
|
302 |
ASC_DLLSPEC(int32 ) mtx_symbolic_rank(mtx_matrix_t mtx); |
ASC_DLLSPEC(int32 ) mtx_symbolic_rank(mtx_matrix_t mtx); |
303 |
/**< |
/**< |
|
*** <!-- symbolic_rank = mtx_symbolic_rank(matrix) --> |
|
|
*** <!-- int32 symbolic_rank; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
304 |
*** Returns the symbolic rank determined by a previous call to |
*** Returns the symbolic rank determined by a previous call to |
305 |
*** mtx_output_assign(). |
*** mtx_output_assign(). |
306 |
*** Calls on slaves are passed up to the master matrix. |
*** Calls on slaves are passed up to the master matrix. |
310 |
|
|
311 |
extern void mtx_set_symbolic_rank(mtx_matrix_t mtx, int32 rank); |
extern void mtx_set_symbolic_rank(mtx_matrix_t mtx, int32 rank); |
312 |
/**< |
/**< |
|
*** <!-- mtx_symbolic_rank(matrix,rank) --> |
|
|
*** <!-- int32 rank; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
313 |
*** Sets symbolic rank of mtx. This is used in a hack |
*** Sets symbolic rank of mtx. This is used in a hack |
314 |
*** and is not intended for general use. |
*** and is not intended for general use. |
315 |
**/ |
**/ |
318 |
int32 col, |
int32 col, |
319 |
mtx_range_t *rng); |
mtx_range_t *rng); |
320 |
/**< |
/**< |
|
*** <!-- swapped = mtx_make_col_independent(matrix,col,rng) --> |
|
|
*** <!-- boolean swapped; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- int32 col; --> |
|
|
*** <!-- mtx_range_t *rng; --> |
|
|
*** |
|
321 |
*** Removes col from the basis in place of one of the columns in rng. |
*** Removes col from the basis in place of one of the columns in rng. |
322 |
*** I.e. redoes the mtx_output_assign so as to not use col, if |
*** I.e. redoes the mtx_output_assign so as to not use col, if |
323 |
*** possible, using one of the cols in rng instead. |
*** possible, using one of the cols in rng instead. |
330 |
|
|
331 |
extern void mtx_org_permute(mtx_matrix_t mtx, mtx_region_t * region); |
extern void mtx_org_permute(mtx_matrix_t mtx, mtx_region_t * region); |
332 |
/**< |
/**< |
|
*** <!-- mtx_org_permute(mtx,region); --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- mtx_region_t *region. --> |
|
|
*** |
|
333 |
*** Given a region, repermutes rows and columns within it to the ordering |
*** Given a region, repermutes rows and columns within it to the ordering |
334 |
*** where mtx_row_to_org(mtx,i) < mtx_row_to_org(mtx,i+1) for all i and |
*** where mtx_row_to_org(mtx,i) < mtx_row_to_org(mtx,i+1) for all i and |
335 |
*** where mtx_col_to_org(mtx,j) < mtx_row_to_org(mtx,j+1) for all j |
*** where mtx_col_to_org(mtx,j) < mtx_row_to_org(mtx,j+1) for all j |
342 |
|
|
343 |
extern int32 mtx_full_diagonal(mtx_matrix_t mtx, mtx_range_t *rng, int noisy); |
extern int32 mtx_full_diagonal(mtx_matrix_t mtx, mtx_range_t *rng, int noisy); |
344 |
/**< |
/**< |
|
*** <!-- mtx_full_diagonal(mtx,rng,noisy); --> |
|
|
*** |
|
345 |
*** This function checks the diagonal for holes. If symbolic_rank is |
*** This function checks the diagonal for holes. If symbolic_rank is |
346 |
*** set, and rng->high < rank, returns immediately. |
*** set, and rng->high < rank, returns immediately. |
347 |
*** Returns number of holes detected in diagonal in rng given. |
*** Returns number of holes detected in diagonal in rng given. |
354 |
|
|
355 |
extern int32 mtx_transpose(mtx_matrix_t mtx); |
extern int32 mtx_transpose(mtx_matrix_t mtx); |
356 |
/**< |
/**< |
|
*** <!-- mtx_transpose(mtx); --> |
|
357 |
*** Transposes everything about the matrix. The user is |
*** Transposes everything about the matrix. The user is |
358 |
*** responsible for keeping track of the change in the semantics |
*** responsible for keeping track of the change in the semantics |
359 |
*** this implies if the matrix is being used in a nonlinear context.<br><br> |
*** this implies if the matrix is being used in a nonlinear context.<br><br> |
368 |
|
|
369 |
extern int32 mtx_isa_transpose(mtx_matrix_t mtx); |
extern int32 mtx_isa_transpose(mtx_matrix_t mtx); |
370 |
/**< |
/**< |
|
*** <!-- mtx_isa_transpose(mtx); --> |
|
371 |
*** Returns 1 if the matrix is transposed from another and 0 if not. |
*** Returns 1 if the matrix is transposed from another and 0 if not. |
372 |
*** Calling mtx_transpose twice yields a mtx which responds with 0. |
*** Calling mtx_transpose twice yields a mtx which responds with 0. |
373 |
-$- Returns mtx_NONE on a bad or 0 order matrix. |
-$- Returns mtx_NONE on a bad or 0 order matrix. |
374 |
**/ |
**/ |
375 |
|
|
376 |
/* ********************************************************************* *\ |
/*------------------------------------------------------------------------------ |
377 |
Start of some block matrix routines. At the moment the block |
START OF SOME NEW BLOCK MATRIX ROUTINES. |
378 |
structure is intimately tied up with the matrix. |
|
379 |
\* ********************************************************************* */ |
At the moment the block structure is intimately tied up with the matrix. |
380 |
|
*/ |
381 |
|
|
382 |
extern mtx_block_t *mtx_block_partition(mtx_matrix_t mtx, mtx_region_t *reg); |
extern mtx_block_t *mtx_block_partition(mtx_matrix_t mtx, mtx_region_t *reg); |
383 |
/**< |
/**< |
|
*** <!-- mtx_partition(mtx,reg); --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- mtx_region_t *reg. --> |
|
|
*** |
|
384 |
*** Partitions the single block of a previously output assigned matrix |
*** Partitions the single block of a previously output assigned matrix |
385 |
*** into smaller blocks if possible. This function unlike its sister |
*** into smaller blocks if possible. This function unlike its sister |
386 |
*** mtx_partition, takes in, and returns information explicitly, rather |
*** mtx_partition, takes in, and returns information explicitly, rather |
396 |
*** Calls on slaves are passed up to the master matrix. |
*** Calls on slaves are passed up to the master matrix. |
397 |
**/ |
**/ |
398 |
|
|
399 |
/* ********************************************************************* *\ |
|
400 |
The original block manipulation routines. |
/*------------------------------------------------------------------------------ |
401 |
\* ********************************************************************* */ |
THE ORIGINAL BLOCK MANIPULATION ROUTINES. |
402 |
|
*/ |
403 |
|
|
404 |
extern void mtx_partition(mtx_matrix_t mtx); |
extern void mtx_partition(mtx_matrix_t mtx); |
405 |
/**< |
/**< |
|
*** <!-- mtx_partition(matrix); --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
406 |
*** Takes an output assigned matrix and does a permutation to |
*** Takes an output assigned matrix and does a permutation to |
407 |
*** block-lower-triangular form of the square region from |
*** block-lower-triangular form of the square region from |
408 |
*** 0,0 to symbolic_rank-1, symbolic_rank-1.<br><br> |
*** 0,0 to symbolic_rank-1, symbolic_rank-1.<br><br> |
412 |
|
|
413 |
extern void mtx_ut_partition(mtx_matrix_t mtx); |
extern void mtx_ut_partition(mtx_matrix_t mtx); |
414 |
/**< |
/**< |
|
*** <!-- mtx_ut_partition(matrix); --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
415 |
*** Takes an output assigned matrix and does a permutation to |
*** Takes an output assigned matrix and does a permutation to |
416 |
*** block-UPPER-triangular form of the square region from |
*** block-UPPER-triangular form of the square region from |
417 |
*** 0,0 to symbolic_rank-1, symbolic_rank-1.<br><br> |
*** 0,0 to symbolic_rank-1, symbolic_rank-1.<br><br> |
421 |
|
|
422 |
extern boolean mtx_check_blocks(mtx_matrix_t mtx); |
extern boolean mtx_check_blocks(mtx_matrix_t mtx); |
423 |
/**< |
/**< |
|
*** <!-- valid = mtx_check_blocks(matrix) --> |
|
|
*** <!-- boolean valid; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
424 |
*** Checks whether or not the block data are consistent with the |
*** Checks whether or not the block data are consistent with the |
425 |
*** non-zero structure of the matrix. If not, the block data |
*** non-zero structure of the matrix. If not, the block data |
426 |
*** are destroyed. Matrix must be previously output assigned, |
*** are destroyed. Matrix must be previously output assigned, |
431 |
|
|
432 |
extern int32 mtx_number_of_blocks(mtx_matrix_t mtx); |
extern int32 mtx_number_of_blocks(mtx_matrix_t mtx); |
433 |
/**< |
/**< |
|
*** |
|
|
-$- <!-- nblocks = mtx_number_of_blocks(matrix) --> |
|
|
*** <!-- int32 nblocks; --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** |
|
434 |
*** Returns the number of blocks in the matrix. Matrix must be |
*** Returns the number of blocks in the matrix. Matrix must be |
435 |
*** previously output assigned. |
*** previously output assigned. |
436 |
*** |
*** |
444 |
int32 block_number, |
int32 block_number, |
445 |
mtx_region_t *block); |
mtx_region_t *block); |
446 |
/**< |
/**< |
|
*** <!-- bndx = mtx_block(matrix,block_number,block) --> |
|
|
*** <!-- mtx_matrix_t matrix; --> |
|
|
*** <!-- int32 block_number; --> |
|
|
*** <!-- mtx_region_t *block; --> |
|
|
*** |
|
447 |
*** Sets block to the "block_number"-th block (indexed 0 to nblocks-1) in |
*** Sets block to the "block_number"-th block (indexed 0 to nblocks-1) in |
448 |
*** the matrix. Matrix must be previously output assigned. |
*** the matrix. Matrix must be previously output assigned. |
449 |
*** Returns mtx_NONE if not previously output assigned |
*** Returns mtx_NONE if not previously output assigned |
477 |
*** |
*** |
478 |
*** Calls on slaves are passed up to the master matrix. |
*** Calls on slaves are passed up to the master matrix. |
479 |
**/ |
**/ |
|
/* OLD GROUP COMMENT */ |
|
|
/* |
|
|
*** block_number = mtx_block_containing_row(matrix,row,block) |
|
|
*** block_number = mtx_block_containing_col(matrix,col,block) |
|
|
*** int32 block_number; |
|
|
*** mtx_matrix_t matrix; |
|
|
*** int32 row,col; |
|
|
*** mtx_region_t *block; |
|
|
*** |
|
|
*** Sets block to the block which contains the given row/column and |
|
|
*** returns the block number. If the given row/column doesn't belong |
|
|
*** to any block, mtx_NONE is returned. Matrix must be previously output |
|
|
*** assigned or a 0 is returned. |
|
|
*** |
|
|
*** Calls on slaves are passed up to the master matrix. |
|
|
**/ |
|
480 |
|
|
481 |
#endif /* __MTX_PERMS_H_SEEN__ */ |
#endif /* ASC_MTX_PERMS_H */ |