/usr/include/spooles/A2/A2.h is in libspooles-dev 2.2-9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 | /* A2.h */
#include "../cfiles.h"
#include "../SPOOLES.h"
#include "../ZV.h"
#include "../IV.h"
#include "../DV.h"
/*====================================================================*/
/*
-----------------------------------------------------------
the A2 structure holds a 2-d dense array of double complex
type -- type of entries
1 -- real
2 -- complex
n1 -- number of rows (first dimension)
n2 -- number of columns (second dimension)
inc1 --
increment in storage along first dimension,
when inc1 == 1, the storage is column major
inc2 --
increment in storage along second dimension,
when inc2 == 1, the storage is row major
nowned -- number of owned entries starting at entries
when > 0, storage pointed to by entries
has been allocated here and can be free'd.
when = 0, storage pointed to by entries
has not been allocated here and cannot be free'd.
entries -- base address for the entries
if real then
entry(i,j) is found in entries[i*inc1 + j*inc2]
else
entry(i,j) is found in entries[2*(i*inc1 + j*inc2)]
and entries[2*(i*inc1 + j*inc2)+1]
endif
-----------------------------------------------------------
*/
typedef
struct _A2 {
int type ;
int n1 ;
int n2 ;
int inc1 ;
int inc2 ;
int nowned ;
double *entries ;
} A2 ;
#define A2_IS_REAL(chv) ((chv)->type == SPOOLES_REAL)
#define A2_IS_COMPLEX(chv) ((chv)->type == SPOOLES_COMPLEX)
#define A2_STRICT_LOWER 1
#define A2_LOWER 2
#define A2_DIAGONAL 3
#define A2_UPPER 4
#define A2_STRICT_UPPER 5
#define A2_ALL_ENTRIES 6
#define A2_BY_ROWS 0
#define A2_BY_COLUMNS 1
/*====================================================================*/
/*
------------------------------------------------------------------------
----- methods found in basics.c ----------------------------------------
------------------------------------------------------------------------
*/
/*
-----------------------
simplest constructor
created -- 98may01, cca
-----------------------
*/
A2 *
A2_new (
void
) ;
/*
-----------------------
set the default fields
created -- 98may01, cca
-----------------------
*/
void
A2_setDefaultFields (
A2 *mtx
) ;
/*
--------------------------------------------------
clear the data fields, releasing allocated storage
created -- 98may01, cca
--------------------------------------------------
*/
void
A2_clearData (
A2 *mtx
) ;
/*
------------------------------------------
destructor, free's the object and its data
created -- 98may01, cca
------------------------------------------
*/
void
A2_free (
A2 *mtx
) ;
/*
------------------------------------------------------------------------
----- methods found in instance.c --------------------------------------
------------------------------------------------------------------------
*/
/*
--------------------------------------
return the number of rows in the array
created -- 98may01, cca
--------------------------------------
*/
int
A2_nrow (
A2 *mtx
) ;
/*
-----------------------------------------
return the number of columns in the array
created -- 98may01, cca
-----------------------------------------
*/
int
A2_ncol (
A2 *mtx
) ;
/*
--------------------------
return the first increment
created -- 98may01, cca
--------------------------
*/
int
A2_inc1 (
A2 *mtx
) ;
/*
---------------------------
return the second increment
created -- 98may01, cca
---------------------------
*/
int
A2_inc2 (
A2 *mtx
) ;
/*
-------------------------------
return a pointer to the entries
created -- 98may01, cca
-------------------------------
*/
double *
A2_entries (
A2 *mtx
) ;
/*
--------------------------------------------
return a pointer to the first entry in a row
created -- 98may01, cca
--------------------------------------------
*/
double *
A2_row (
A2 *mtx,
int irow
) ;
/*
-----------------------------------------------
return a pointer to the first entry in a column
created -- 98may01, cca
-----------------------------------------------
*/
double *
A2_column (
A2 *mtx,
int jcol
) ;
/*
-------------------------------------------
fill *pValue with the entry in (irow, jcol)
created -- 98may01, cca
-------------------------------------------
*/
void
A2_realEntry (
A2 *mtx,
int irow,
int jcol,
double *pValue
) ;
/*
---------------------------------------------------
fill (*pReal,*pImag) with the entry in (irow, jcol)
created -- 98may01, cca
---------------------------------------------------
*/
void
A2_complexEntry (
A2 *mtx,
int irow,
int jcol,
double *pReal,
double *pImag
) ;
/*
-----------------------------------------
set the entry in (irow, jcol) to be value
created -- 98may01, cca
-----------------------------------------
*/
void
A2_setRealEntry (
A2 *mtx,
int irow,
int jcol,
double value
) ;
/*
-----------------------------------------------
set the entry in (irow, jcol) to be (real,imag)
created -- 98may01, cca
-----------------------------------------------
*/
void
A2_setComplexEntry (
A2 *mtx,
int irow,
int jcol,
double real,
double imag
) ;
/*
---------------------------------------
fill pointers to the matrix first entry
in row irow and column jcol
created -- 98may01, cca
---------------------------------------
*/
void
A2_pointerToRealEntry (
A2 *mtx,
int irow,
int jcol,
double **ppValue
) ;
/*
---------------------------------------
fill pointers to the matrix first entry
in row irow and column jcol
created -- 98may01, cca
---------------------------------------
*/
void
A2_pointerToComplexEntry (
A2 *mtx,
int irow,
int jcol,
double **ppReal,
double **ppImag
) ;
/*
------------------------------------------------------------------------
----- methods found in init.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
------------------------------------------------------------------
initializer. sets the n1, n2, inc1 and inc2 fields.
must have
mtx != NULL
type = SPOOLES_REAL or SPOOLES_COMPLEX
n1, n2, inc1, inc2 > 0
(inc1 = 1 and inc2 = nrow) or (inc1 = ncol and inc2 = 1)
if entries is NULL then
entries are allocated and zeroed.
else
mtx->nowned is set to 0
mtx->entries is set to entries.
endif
n1, n2, inc1, inc2 set
created -- 98apr15, cca
------------------------------------------------------------------
*/
void
A2_init (
A2 *mtx,
int type,
int n1,
int n2,
int inc1,
int inc2,
double *entries
) ;
/*
--------------------------------------------------
submatrix initializer
A(0:lastrow-firstrow,0:lastcol-firstcol)
= B(firstrow:lastrow, firstcol:lastcol)
created -- 98apr15, cca
--------------------------------------------------
*/
void
A2_subA2 (
A2 *mtxA,
A2 *mtxB,
int firstrow,
int lastrow,
int firstcol,
int lastcol
) ;
/*
------------------------------------------------------------------------
----- methods found in norms.c -----------------------------------------
------------------------------------------------------------------------
*/
/*
-------------------------------------
return the entry of maximum magnitude
created -- 98apr15, cca
-------------------------------------
*/
double
A2_maxabs (
A2 *a
) ;
/*
---------------------------------------
return the frobenius norm of the matrix
created -- 98apr15, cca
---------------------------------------
*/
double
A2_frobNorm (
A2 *mtx
) ;
/*
---------------------------------
return the one-norm of the matrix
created -- 98apr15, cca
---------------------------------
*/
double
A2_oneNorm (
A2 *mtx
) ;
/*
--------------------------------------
return the infinity-norm of the matrix
created -- 98apr15, cca
--------------------------------------
*/
double
A2_infinityNorm (
A2 *mtx
) ;
/*
----------------------------------
return the one-norm of column jcol
created -- 98apr15, cca
----------------------------------
*/
double
A2_oneNormOfColumn (
A2 *mtx,
int jcol
) ;
/*
----------------------------------
return the two-norm of column jcol
created -- 98apr15, cca
----------------------------------
*/
double
A2_twoNormOfColumn (
A2 *mtx,
int jcol
) ;
/*
---------------------------------------
return the infinity-norm of column jcol
created -- 98apr15, cca
---------------------------------------
*/
double
A2_infinityNormOfColumn (
A2 *mtx,
int jcol
) ;
/*
-------------------------------
return the one-norm of row irow
created -- 98apr15, cca
-------------------------------
*/
double
A2_oneNormOfRow (
A2 *mtx,
int irow
) ;
/*
-------------------------------
return the two-norm of row irow
created -- 98apr15, cca
-------------------------------
*/
double
A2_twoNormOfRow (
A2 *mtx,
int irow
) ;
/*
------------------------------------
return the infinity-norm of row irow
created -- 98apr15, cca
------------------------------------
*/
double
A2_infinityNormOfRow (
A2 *mtx,
int irow
) ;
/*
------------------------------------------------------------------------
----- methods found in sort.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
-----------------------------------------
permute the rows of the matrix
A(*,*) = A(index(*),*)
this method calls A2_sortRowsUp
but does not overwrite the index[] vector
created -- 98apr15, cca
-----------------------------------------
*/
void
A2_permuteRows (
A2 *mtx,
int nrow,
int index[]
) ;
/*
-----------------------------------------
permute the columns of the matrix
A(*,*) = A(*,index(*))
this method calls A2_sortColumnsUp
but does not overwrite the index[] vector
created -- 98apr15, cca
-----------------------------------------
*/
void
A2_permuteColumns (
A2 *mtx,
int ncol,
int index[]
) ;
/*
----------------------------------------------
sort the rows of the matrix in ascending order
of the rowids[] vector. on return, rowids is
in asending order. return value is the number
of row swaps made.
created -- 98apr15, cca
----------------------------------------------
*/
int
A2_sortRowsUp (
A2 *mtx,
int nrow,
int rowids[]
) ;
/*
-------------------------------------------------
sort the columns of the matrix in ascending order
of the colids[] vector. on return, colids is
in asending order. return value is the number
of column swaps made.
created -- 98apr15, cca
-------------------------------------------------
*/
int
A2_sortColumnsUp (
A2 *mtx,
int ncol,
int colids[]
) ;
/*
------------------------------------------------------------------------
----- methods found in QRreduce.c --------------------------------------
------------------------------------------------------------------------
*/
/*
--------------------------------------------------------------
purpose -- compute A = QR, where Q is a product of householder
vectors, (I - beta_j v_j v_j^T). on return, v_j is
found in the lower triangle of A, v_j(j) = 1.0.
return value -- # of floating point operations
created -- 98may25, cca
--------------------------------------------------------------
*/
double
A2_QRreduce (
A2 *mtxA,
DV *workDV,
int msglvl,
FILE *msgFile
) ;
/*
-----------------------------------------------------------
A contains the following data from the A = QR factorization
A(1:ncolA,1:ncolA) = R
A(j+1:nrowA,j) is v_j, the j-th householder vector,
where v_j[j] = 1.0
NOTE: A and Q must be column major
created -- 98dec10, cca
-----------------------------------------------------------
*/
void
A2_computeQ (
A2 *Q,
A2 *A,
DV *workDV,
int msglvl,
FILE *msgFile
) ;
/*
-----------------------------------------------------------
A contains the following data from the A = QR factorization
A(1:ncolA,1:ncolA) = R
A(j+1:nrowA,j) is v_j, the j-th householder vector,
where v_j[j] = 1.0
we compute Y = Q^T X when A is real
and Y = Q^H X when A is complex
NOTE: A, Y and X must be column major.
NOTE: Y and X can be the same object,
in which case X is overwritten with Y
created -- 98dec10, cca
-----------------------------------------------------------
*/
void
A2_applyQT (
A2 *Y,
A2 *A,
A2 *X,
DV *workDV,
int msglvl,
FILE *msgFile
) ;
/*
------------------------------------------------------------------------
----- methods found in copyEntriesToVector.c ---------------------------
------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------
purpose -- copy entries to a vector. the portion copied
can be a union of the strict lower portion,
the diagonal portion, and the strict upper
portion. there is one restriction, if the strict
lower and strict upper are to be copied, the
diagonal will also be copied.
length -- length of dvec[]
dvec[] -- vector to receive matrix entries
copyflag -- flag to denote what part of the entries to move
A2_STRICT_LOWER --> move strict lower entries
A2_LOWER --> move lower entries (includes the diagonal)
A2_DIAGONAL --> move diagonal entries
A2_UPPER --> move upper entries (includes the diagonal)
A2_STRICT_UPPER --> move strict upper entries
A2_ALL_ENTRIES --> move all entries
storeflag -- flag to denote how to store entries in dvec[]
A2_BY_ROWS --> store by rows
A2_BY_COLUMNS --> store by columns
return value -- number of entries copied
created -- 97jun03, cca, dkw
modified -- 98may25, cca
----------------------------------------------------------------
*/
int
A2_copyEntriesToVector (
A2 *mtx,
int length,
double *dvec,
int copyflag,
int storeflag
) ;
/*
------------------------------------------------------------------------
----- methods found in makeStaircase.c ---------------------------------
------------------------------------------------------------------------
*/
/*
-----------------------------------------------------------------
purpose -- to permute the rows so the matrix is in staircase form
created -- 98may25, cca
-----------------------------------------------------------------
*/
void
A2_makeStaircase (
A2 *mtxA
) ;
/*
------------------------------------------------------------------------
----- methods found in util.c ------------------------------------------
------------------------------------------------------------------------
*/
/*
----------------------------------------------
return the number of bytes taken by the object
created -- 98may01, cca
----------------------------------------------
*/
int
A2_sizeOf (
A2 *mtx
) ;
/*
---------------------------------------------------------------
shift the base of the entries and adjust dimensions
mtx(0:n1-rowoff-1,0:n2-coloff-1) = mtx(rowoff:n1-1,coloff:n2-1)
created -- 98may01, cca
---------------------------------------------------------------
*/
void
A2_shiftBase (
A2 *mtx,
int rowoff,
int coloff
) ;
/*
--------------------------------------------------------------
returns 1 if the storage is row major, otherwise returns zero.
created -- 98may01, cca
--------------------------------------------------------------
*/
int
A2_rowMajor (
A2 *mtx
) ;
/*
-----------------------------------------------------------------
returns 1 if the storage is column major, otherwise returns zero.
created -- 98may01, cca
-----------------------------------------------------------------
*/
int
A2_columnMajor (
A2 *mtx
) ;
/*
-----------------------
transpose the matrix
created -- 98may01, cca
-----------------------
*/
void
A2_transpose (
A2 *mtx
) ;
/*
----------------------------
extract row[*] = mtx(irow,*)
created -- 98may01, cca
----------------------------
*/
void
A2_extractRow (
A2 *mtx,
double row[],
int irow
) ;
/*
----------------------------
extract col[*] = mtx(*,jcol)
created -- 98may01, cca
----------------------------
*/
void
A2_extractColumn (
A2 *mtx,
double col[],
int jcol
) ;
/*
-----------------------
set mtx(irow,*) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setRow (
A2 *mtx,
double row[],
int irow
) ;
/*
-----------------------
set mtx(*,jcol) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setColumn (
A2 *mtx,
double col[],
int jcol
) ;
/*
----------------------------
extract row[*] = mtx(irow,*)
created -- 98may01, cca
----------------------------
*/
void
A2_extractRowDV (
A2 *mtx,
DV *rowDV,
int irow
) ;
/*
----------------------------
extract row[*] = mtx(irow,*)
created -- 98may01, cca
----------------------------
*/
void
A2_extractRowZV (
A2 *mtx,
ZV *rowZV,
int irow
) ;
/*
----------------------------
extract col[*] = mtx(*,jcol)
created -- 98may01, cca
----------------------------
*/
void
A2_extractColumnDV (
A2 *mtx,
DV *colDV,
int jcol
) ;
/*
----------------------------
extract col[*] = mtx(*,jcol)
created -- 98may01, cca
----------------------------
*/
void
A2_extractColumnZV (
A2 *mtx,
ZV *colZV,
int jcol
) ;
/*
-----------------------
set mtx(irow,*) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setRowDV (
A2 *mtx,
DV *rowDV,
int irow
) ;
/*
-----------------------
set mtx(irow,*) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setRowZV (
A2 *mtx,
ZV *rowZV,
int irow
) ;
/*
-----------------------
set mtx(*,jcol) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setColumnDV (
A2 *mtx,
DV *colDV,
int jcol
) ;
/*
-----------------------
set mtx(*,jcol) = y[*]
created -- 98may01, cca
-----------------------
*/
void
A2_setColumnZV (
A2 *mtx,
ZV *colZV,
int jcol
) ;
/*
-------------------------------------------------------------
fill the matrix with uniform random numbers in [lower, upper]
created -- 98may01, cca
-------------------------------------------------------------
*/
void
A2_fillRandomUniform (
A2 *a,
double lower,
double upper,
int seed
) ;
/*
-----------------------------------------------
fill the matrix with normal(0,1) random numbers
created -- 98may01, cca
-----------------------------------------------
*/
void
A2_fillRandomNormal (
A2 *a,
double mean,
double variance,
int seed
) ;
/*
----------------------------------------
fill the matrix with the identity matrix
created -- 98may01, cca
----------------------------------------
*/
void
A2_fillWithIdentity (
A2 *a
) ;
/*
--------------------------
fill the matrix with zeros
created -- 98may01, cca
--------------------------
*/
void
A2_zero (
A2 *a
) ;
/*
----------------------------
copy one matrix into another
A := B
created -- 98may01, cca
----------------------------
*/
void
A2_copy (
A2 *A,
A2 *B
) ;
/*
--------------------------------
subtract one matrix from another
A := A - B
created -- 98may01, cca
----------------------------
*/
void
A2_sub (
A2 *A,
A2 *B
) ;
/*
---------------------------
swap two rows of the matrix
created -- 98may01, cca
---------------------------
*/
void
A2_swapRows (
A2 *a,
int irow1,
int irow2
) ;
/*
------------------------------
swap two columns of the matrix
created -- 98may01, cca
------------------------------
*/
void
A2_swapColumns (
A2 *a,
int jcol1,
int jcol2
) ;
/*
------------------------------------------------------------------------
----- methods found in IO.c --------------------------------------------
------------------------------------------------------------------------
*/
/*
--------------------------------------------
purpose -- to read in the object from a file
input --
fn -- filename, must be *.a2b or *.a2f
return value -- 1 if success, 0 if failure
created -- 98may01, cca
--------------------------------------------
*/
int
A2_readFromFile (
A2 *mtx,
char *fn
) ;
/*
--------------------------------------------------
purpose -- to read an object from a formatted file
return value -- 1 if success, 0 if failure
created -- 98may01, cca
--------------------------------------------------
*/
int
A2_readFromFormattedFile (
A2 *mtx,
FILE *fp
) ;
/*
-----------------------------------------------
purpose -- to read an object from a binary file
return value -- 1 if success, 0 if failure
created -- 98may01, cca
-----------------------------------------------
*/
int
A2_readFromBinaryFile (
A2 *mtx,
FILE *fp
) ;
/*
---------------------------------------
purpose -- to write an object to a file
input --
fn -- filename
*.a2b -- binary
*.a2f -- formatted
anything else -- for human eye
created -- 98may01, cca
---------------------------------------
*/
void
A2_writeToFile (
A2 *mtx,
char *fn
) ;
/*
-------------------------------------------------
purpose -- to write an object to a formatted file
created -- 98may01, cca
-------------------------------------------------
*/
void
A2_writeToFormattedFile (
A2 *mtx,
FILE *fp
) ;
/*
--------------------------------------------------------
purpose -- to write an adjacency object to a binary file
created -- 98may01, cca
--------------------------------------------------------
*/
void
A2_writeToBinaryFile (
A2 *mtx,
FILE *fp
) ;
/*
----------------------------------------------
purpose -- to write the object for a human eye
created -- 98may01, cca
----------------------------------------------
*/
void
A2_writeForHumanEye (
A2 *mtx,
FILE *fp
) ;
/*
--------------------------------------
purpose -- to write out the statistics
created -- 98may01, cca
--------------------------------------
*/
void
A2_writeStats (
A2 *mtx,
FILE *fp
) ;
/*
-----------------------------------------------
purpose -- to write the matrix in matlab format
created -- 98may01, cca
-----------------------------------------------
*/
void
A2_writeForMatlab (
A2 *mtx,
char *mtxname,
FILE *fp
) ;
/*====================================================================*/
|