1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2%% 3%% bigint_matrix.tex LiDIA documentation 4%% 5%% This file contains the documentation of the class bigint_matrix 6%% 7%% Copyright (c) 1995 by LiDIA-Group 8%% 9%% Authors: Patrick Theobald 10%% 11 12%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 14\NAME 15 16\CLASS{bigint_matrix} \dotfill Linear algebra over $\bbfZ$ 17 18 19%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 20 21\ABSTRACT 22 23\code{bigint_matrix} is a class for doing linear algebra over the ring of rational integers. 24This class may either be used for representing a modul, which is generated by the columns of the 25matrix 26\begin{displaymath} 27 A = (a_{i,j}) \in \bbfZ^{m\times n} \enspace,\quad 0 \leq i < m,\, 0 \leq j < n 28\end{displaymath} 29or for representing a homomorphism by its matrix. In the first case, the class supports for 30example computing bases, hermite normal form, smith normal form etc., in the second case it may 31be used for computing the determinant, the characteristic polynomial, the image, the kernel 32etc.~of the homomorphism. 33 34According to the template introduction (see page \pageref{template_introduction2}) the class 35\code{bigint_matrix} is derived from \code{math_matrix< bigint >}. So you can apply all the 36functions and operators of class \code{base_matrix< bigint >} and \code{math_matrix< bigint >} 37to instances of type \code{bigint_matrix}. 38 39 40%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 41 42\DESCRIPTION 43 44A variable of type \code{bigint_matrix} contains the same components as a \code{math_matrix< 45 bigint >}. 46 47As usually in the following descriptions we use \code{$A$.rows} to label the number of rows and 48\code{$A$.columns} to label the number of columns of matrix $A$. 49 50For some computations modular arithmetic is used, for which we use an external table of prime 51numbers. By default, this table is taken out of the file 52\path{LIDIA_INSTALL_DIR/lib/LiDIA/LIDIA_PRIMES}, where \path{LIDIA_INSTALL_DIR} denotes the 53directory, where \LiDIA was installed by the installation procedure. For efficiency reasons, we 54assume at first, that 300 prime numbers are sufficient. If this is not the case, the number of 55used prime numbers is successively doubled. 56 57If you want to use some other file location for the file containing the prime numbers, you have 58to set the environment variable \code{LIDIA_PRIMES_NAME} to point to this location. Depending 59on your architecture quite some gain in running time may be achieved by using lists of larger 60prime numbers, e.g.~if you have a 64 bit CPU using our list of 26 bit primes (optimized for 61SPARC V7/V8 architectures) is just a convenient though slow way to get our library to work. If 62you do computations with very large numbers, you might consider to start with a larger buffer 63for the prime numbers by setting the environment variable \code{LIDIA_PRIMES_SIZE} to some 64larger number, e.g.~to 6000. 65 66 67%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 68 69\CONS 70 71If $a \leq 0$ or $b \leq 0$ or $v = \code{NULL}$ in one of the following constructors the \LEH 72will be invoked. 73 74\begin{fcode}{ct}{bigint_matrix}{} 75 constructs a $1 \times 1$ matrix initialized with zero. 76\end{fcode} 77 78\begin{fcode}{ct}{bigint_matrix}{lidia_size_t $a$, lidia_size_t $b$} 79 constructs an $a \times b$ matrix initialized with zero. 80\end{fcode} 81 82\begin{fcode}{ct}{bigint_matrix}{lidia_size_t $a$, lidia_size_t $b$, const bigint ** $v$} 83 constructs an $a \times b$ matrix initialized with the values of the 2-dimensional array $v$. 84 The behaviour of this constructor is undefined if the array $v$ has less than $a$ rows or less 85 than $b$ columns. 86\end{fcode} 87 88\begin{fcode}{ct}{bigint_matrix}{const base_matrix< bigint > & $A$} 89 constructs a copy of matrix $A$. 90\end{fcode} 91 92\begin{fcode}{dt}{~bigint_matrix}{} 93\end{fcode} 94 95 96%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 97 98\ARTH 99 100In addition to the arithmetical functions and operators of class \code{math_matrix< T >} you can 101use the following operators and function: 102 103The operators \code{bigint_matrix % bigint} and \code{bigint_matrix %= bigint} reduce 104componentwise each entry of the given matrix modulo the given \code{bigint}. 105 106To avoid copying this operator also exist as function: 107 108\begin{fcode}{void}{remainder}{bigint_matrix & $A$, const bigint_matrix & $B$, const bigint & $e$} 109 Let $r = \code{$B$.rows}$ and $c = \code{$B$.columns}$. 110 \begin{displaymath} 111 \begin{pmatrix} 112 a_{0,0} & \dots & a_{0,c-1}\\ 113 \vdots & \ddots & \vdots \\ 114 a_{r-1,0} & \dots & a_{r-1,c-1} 115 \end{pmatrix} \assign 116 \begin{pmatrix} 117 b_{0,0} \bmod e & \dots & b_{0,c'-1} \bmod e\\ 118 \vdots & \ddots & \vdots \\ 119 b_{r-1,0} \bmod e & \dots & b_{r'-1,c'-1} \bmod e 120 \end{pmatrix}\enspace. 121 \end{displaymath} 122 As modulo operation on $\bbfZ$ we use the best remainder function for integers. 123\end{fcode} 124 125 126%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 127 128\COMP 129 130Let $A$ be an variable of type \code{bigint_matrix}. 131 132\begin{cfcode}{bool}{$A$.is_column_zero}{lidia_size_t $i$} 133\end{cfcode} 134 135\begin{fcode}{bool}{is_column_zero}{const bigint_matrix & $A$, lidia_size_t $i$} 136 returns \TRUE if all entries of column $i$ of matrix $A$ are zero, \FALSE otherwise. 137\end{fcode} 138 139\begin{cfcode}{bool}{$A$.is_row_zero}{lidia_size_t $i$} 140\end{cfcode} 141 142\begin{fcode}{bool}{is_row_zero}{const bigint_matrix & $A$, lidia_size_t $i$} 143 returns \TRUE if all entries of row $i$ of matrix $A$ are zero, \FALSE otherwise. 144\end{fcode} 145 146\begin{cfcode}{bool}{$A$.is_matrix_zero}{} 147\end{cfcode} 148 149\begin{fcode}{bool}{is_matrix_zero}{const bigint_matrix & $A$} 150 returns \TRUE if all entries of matrix $A$ are zero, and \FALSE otherwise. 151\end{fcode} 152 153 154%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 155 156\STITLE{Norms and Bounds} 157 158\begin{cfcode}{bigint}{$A$.max}{} 159\end{cfcode} 160 161\begin{fcode}{bigint}{max}{const bigint_matrix & $A$} 162 returns the maximum of all components of matrix $A$. 163\end{fcode} 164 165\begin{cfcode}{void}{$A$.max}{bigint & $x$} 166 $x \assign \code{max($A$)}$. 167\end{cfcode} 168 169\begin{cfcode}{bigint}{$A$.max_abs}{} 170\end{cfcode} 171 172\begin{fcode}{bigint}{max_abs}{const bigint_matrix & $A$} 173 returns the maximum of the absolute values of all components of matrix $A$. 174\end{fcode} 175 176\begin{cfcode}{void}{$A$.max_abs}{bigint & $x$} 177 $x \assign \code{max_abs($A$)}$ 178\end{cfcode} 179 180\begin{cfcode}{bigint}{$A$.max_pos}{lidia_size_t & $x$, lidia_size_t & $y$} 181\end{cfcode} 182 183\begin{fcode}{bigint}{max_pos}{const bigint_matrix & $A$, lidia_size_t & $x$, lidia_size_t & $y$} 184 returns the element $a_{x,y}$ which is the maximum of all components of matrix $A$. 185\end{fcode} 186 187\begin{cfcode}{void}{$A$.max_pos}{bigint & $m$, lidia_size_t & $x$, lidia_size_t & $y$} 188 $m \assign \code{max_pos($A$, $x$, $y$)}$. 189\end{cfcode} 190 191\begin{cfcode}{bigint}{$A$.max_abs_pos}{lidia_size_t & $x$, lidia_size_t & $y$} 192\end{cfcode} 193 194\begin{fcode}{bigint}{max_abs_pos}{const bigint_matrix & $A$, lidia_size_t & $x$, lidia_size_t & $y$} 195 returns the element $a_{x,y}$ which is the maximum of the absolute values of all components of 196 matrix $A$. 197\end{fcode} 198 199\begin{cfcode}{void}{$A$.max_abs_pos}{bigint & $m$, lidia_size_t & $x$, lidia_size_t & $y$} 200 $m \assign \code{max_abs_pos($A$, $x$, $y$)}$ 201\end{cfcode} 202 203\begin{cfcode}{bigint}{$A$.min}{} 204\end{cfcode} 205 206\begin{fcode}{bigint}{min}{const bigint_matrix & $A$} 207 returns the minimum of all components of $A$. 208\end{fcode} 209 210\begin{cfcode}{void}{$A$.min}{bigint & $x$} 211 $x \assign \code{min($A$)}$ 212\end{cfcode} 213 214\begin{cfcode}{bigint}{$A$.min_abs}{} 215\end{cfcode} 216 217\begin{fcode}{bigint}{min_abs}{const bigint_matrix & $A$} 218 returns the minimum of the absolute values of all components of matrix $A$. 219\end{fcode} 220 221\begin{cfcode}{void}{$A$.min_abs}{bigint & $x$} 222 $x \assign \code{min_abs($A$)}$ 223\end{cfcode} 224 225\begin{cfcode}{bigint}{$A$.min_pos}{lidia_size_t & $x$, lidia_size_t & $y$} 226\end{cfcode} 227 228\begin{fcode}{bigint}{min_pos}{const bigint_matrix & $A$, lidia_size_t & $x$, lidia_size_t & $y$} 229 returns the element $a_{x,y}$ which is the minimum of all components of $A$. 230\end{fcode} 231 232\begin{cfcode}{void}{$A$.min_pos}{bigint & $m$, lidia_size_t & $x$, lidia_size_t & $y$} 233 $m \assign \code{min_pos($A$, $x$, $y$)}$ 234\end{cfcode} 235 236\begin{cfcode}{bigint}{$A$.min_abs_pos}{lidia_size_t & $x$, lidia_size_t & $y$} 237\end{cfcode} 238 239\begin{fcode}{bigint}{min_abs_pos}{const bigint_matrix & $A$, lidia_size_t & $x$, lidia_size_t & $y$} 240 returns the element $a_{x,y}$ which is the minimum of the absolute values of all components of 241 matrix $A$. 242\end{fcode} 243 244\begin{cfcode}{void}{$A$.min_abs_pos}{bigint & $x$, lidia_size_t & $x$, lidia_size_t & $y$} 245 $x \assign \code{min_abs_pos($A$, $x$, $y$)}$ 246\end{cfcode} 247 248\begin{cfcode}{bigint}{$A$.hadamard}{} 249\end{cfcode} 250 251\begin{fcode}{bigint}{hadamard}{const bigint_matrix & $A$} 252 returns the Hadamard bound of $A$. 253\end{fcode} 254 255\begin{cfcode}{void}{$A$.hadamard}{bigint & $x$} 256 $x \assign \code{hadamard($A$)}$ 257\end{cfcode} 258 259\begin{fcode}{void}{$A$.row_norm}{bigint & $x$, lidia_size_t $i$, long $j$ = 2} 260 sets $x \assign \sum_{l=0}^{\code{$A$.columns}-1} |a_{i,l}^j|$. If $0 \leq i < \code{$A$.rows}$ 261 doesn't hold, the \LEH will be invoked. 262\end{fcode} 263 264\begin{fcode}{bigint}{$A$.row_norm}{lidia_size_t $i$, long j = 2} 265\end{fcode} 266 267\begin{fcode}{bigint}{row_norm}{const bigint_matrix & $A$, lidia_size_t $i$, long $j$ = 2} 268 returns $\sum_{l=0}^{\code{$A$.columns}-1} |a_{i,l}^j|$. If not $0 \leq i < \code{$A$.rows}$ 269 the \LEH will be invoked. 270\end{fcode} 271 272\begin{fcode}{void}{$A$.column_norm}{bigint & $x$, lidia_size_t $i$, long $j$ = 2} 273 sets $x \assign \sum_{l=0}^{\code{$A$.rows}-1} |a_{l,i}^j|$. If not $0 \leq i < 274 \code{$A$.columns}$ the \LEH will be invoked. 275\end{fcode} 276 277\begin{fcode}{bigint}{$A$.column_norm}{lidia_size_t $i$, long $j$ = 2} 278\end{fcode} 279 280\begin{fcode}{bigint}{column_norm}{const bigint_matrix & $A$, lidia_size_t $i$, long $j$ = 2} 281 returns $\sum_{l=0}^{\code{$A$.rows}-1} |a_l,i^j|$. If not $0 \leq i < \code{$A$.columns}$ 282 the \LEH will be invoked. 283\end{fcode} 284 285 286%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 287 288\STITLE{Randomize} 289 290\begin{fcode}{void}{$A$.randomize}{const bigint & $b$} 291 fills matrix $A$ with random values between $0$ and $b$. The dimensions of matrix $A$ remain 292 unchanged. 293\end{fcode} 294 295\begin{fcode}{void}{$A$.randomize_with_det}{const bigint & $b$, const bigint & $\mathit{DET}$} 296 generates a random matrix $A$ with determinant $\mathit{DET}$. Internally this function 297 creates two triangular matrices with values between $0$ and $b$. One of these matrices has 298 the determinant $1$ and the other determinant $\mathit{DET}$. So the product of these 299 matrices is the wanted matrix $A$. If matrix $A$ is not quadratic, the \LEH will be invoked. 300\end{fcode} 301 302 303%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 304 305\STITLE{Linear Algebra} 306 307If the dimensions of the arguments in the following functions don't satisfy the usual 308restrictions known from linear algebra, the \LEH will be invoked. Some of these are marked by 309(I). These functions are interface functions to select the algorithm, which is the fastest one 310on big, dense matrices. Depending on your application, you might want to choose some other 311algorithm from the list of algorithms described in the next section. 312 313\begin{fcode}{void}{$A$.adj}{const bigint_matrix & $B$} 314\end{fcode} 315 316\begin{fcode}{bigint_matrix}{adj}{const bigint_matrix & $B$} 317 stores the adjoint matrix of $B$ to $A$. 318\end{fcode} 319 320\begin{cfcode}{void}{$A$.charpoly}{base_vector< bigint > & $v$} 321\end{cfcode} 322 323\begin{fcode}{void}{charpoly}{base_vector< bigint > & $v$, const bigint_matrix & $A$} 324 stores the coefficients of the characteristic polynomial of $A$ to $v$, where $v[i]$ contains 325 the coefficient of $x^i$ (see \cite{Mueller_Thesis:1994}). Note that the size of vector $v$ 326 will be adapted if necessary. 327\end{fcode} 328 329\begin{cfcode}{bigint *}{$A$.charpoly}{} 330\end{cfcode} 331 332\begin{fcode}{bigint *}{charpoly}{const bigint_matrix & $A$} 333 returns an array $v$ of coefficients of the characteristic polynomial of $A$, where $v[i]$ 334 contains the coefficient of $x^i$ (see \cite{Mueller_Thesis:1994}). 335\end{fcode} 336 337\begin{cfcode}{bigint}{$A$.det}{} 338\end{cfcode} 339 340\begin{fcode}{bigint}{det}{const bigint_matrix & $A$} 341 returns the determinant of matrix $A$. 342\end{fcode} 343 344\begin{cfcode}{void}{$A$.det}{x} 345 $x \assign \code{det($A$)}$. 346\end{cfcode} 347 348\begin{fcode}{void}{$A$.hnf}{} 349 transforms $A$ into hermite normal form. (I) 350\end{fcode} 351 352\begin{fcode}{bigint_matrix}{hnf}{const bigint_matrix & $A$} 353 returns the hermite normal form of $A$. (I) 354\end{fcode} 355 356\begin{fcode}{void}{$A$.hnf}{bigint_matrix & $T$} 357 transforms $A$ in hermite normal form and sets $T$ to the corresponding transformation matrix. 358 That means: $A \cdot T = \HNF(A)$ (I). 359\end{fcode} 360 361\begin{fcode}{bigint_matrix}{hnf}{const bigint_matrix & $A$, bigint_matrix & $T$} 362 returns the hermite normal form of $A$ and sets $T$ to the corresponding transformation 363 matrix. That means: $A \cdot T = \HNF(A)$ (I). 364\end{fcode} 365 366\begin{fcode}{void}{$A$.image}{const bigint_matrix & $B$} 367 stores a base of the image of the homomorphism defined by $B$ to $A$. That means, the columns 368 of matrix $A$ form a generating system of this image. 369\end{fcode} 370 371\begin{fcode}{bigint_matrix}{image}{const bigint_matrix & $B$} 372 returns a base of the image of the homomorphism defined by $B$. 373\end{fcode} 374 375\begin{fcode}{void}{$A$.invimage}{const bigint_matrix & $B$, const bigint * $v$} 376 stores the solutions of the linear equation system $B \cdot x = v$ to matrix $A$. The last 377 column of matrix $A$ is a solution $x$ of the system and the other columns form a generating 378 system of the kernel of the homomorphism corresponding to matrix $B$. If there is no 379 solution, matrix $A$ has only one column of zeros. If no memory is allocated for array $v$, 380 the \LEH will be invoked. The behaviour of this function is undefined if $v$ has less than 381 \code{$B$.rows} elements. 382\end{fcode} 383 384\begin{fcode}{bigint_matrix}{invimage}{const bigint_matrix & $B$, const bigint * $v$} 385 returns a \code{bigint_matrix} $A$ with the following properties: The last column of matrix 386 $A$ is a solution $x$ of the system $B \cdot x = v$ and the other columns form a generating 387 system of the kernel of the homomorphism corresponding to matrix $B$. If there is no 388 solution, matrix $A$ has only one column of zeros. If no memory is allocated for array $v$, 389 the \LEH will be invoked. The behaviour of this function is undefined if $v$ has less than 390 \code{$B$.rows} elements. 391\end{fcode} 392 393\begin{fcode}{void}{$A$.invimage}{const bigint_matrix & $B$, const math_vector< bigint > & $v$} 394 stores the solutions of the linear equation $B \cdot x = v$ to matrix $A$. The last column of 395 matrix $A$ is a solution $x$ of the system and the other columns form a generating system of 396 the kernel of the homomorphism corresponding to matrix $B$. If there is no solution, matrix 397 $A$ has only one column of zeros. If $\code{$v$.size} \neq \code{$B$.rows}$, the \LEH will be 398 invoked. 399\end{fcode} 400 401\begin{fcode}{bigint_matrix}{invimage}{const bigint_matrix & $B$, const math_vector< bigint > & $v$} 402 returns a \code{bigint_matrix} $A$ with the following properties: The last column of matrix 403 $A$ is a solution $x$ of the system $B \cdot x = v$ and the other columns form a generating 404 system of the kernel of the homomorphism corresponding to matrix $B$. If there is no 405 solution, matrix $A$ has only one column of zeros. If $\code{$v$.size} \neq \code{$B$.rows}$, 406 the \LEH will be invoked. 407\end{fcode} 408 409\begin{fcode}{void}{$A$.kernel}{const bigint_matrix & $B$} 410 stores a basis of the kernel of the homomorphism defined by matrix $B$ to $A$ (see 411 \cite{Mueller_Thesis:1994}), i.e. the columns of the matrix A form a generating system of the 412 kernel (I). 413\end{fcode} 414 415\begin{fcode}{bigint_matrix}{kernel}{const bigint_matrix & $B$} 416 stores a basis of the kernel of the homomorphism defined by matrix $B$ to $A$ (see 417 \cite{Mueller_Thesis:1994}), i.e. the columns of the matrix A form a generating system of the 418 kernel (I). 419\end{fcode} 420 421\begin{cfcode}{bigint}{$A$.latticedet}{} 422\end{cfcode} 423 424\begin{fcode}{bigint}{latticedet}{const bigint_matrix & $A$} 425 returns a positive multiple of the determinant of the lattice generated by the columns of $A$ 426 (see \cite{Duellmann_Thesis:1991}) (I). 427\end{fcode} 428 429\begin{cfcode}{void}{$A$.latticedet}{bigint & $x$} 430 $x \assign \code{latticedet($A$)}$ (I). 431\end{cfcode} 432 433\begin{cfcode}{lidia_size_t *}{$A$.lininc}{} 434\end{cfcode} 435 436\begin{fcode}{lidia_size_t *}{lininc}{const bigint_matrix & $A$} 437 returns an array of type \code{lidia_size_t} with the rank of $A$ (at position zero) followed 438 by the indices of the linearly independent columns of $A$. 439\end{fcode} 440 441\begin{cfcode}{void}{$A$.lininc}{base_vector< lidia_size_t > & $v$} 442\end{cfcode} 443 444\begin{fcode}{void}{lininc}{base_vector< lidia_size_t > & $v$, const bigint_matrix & $A$} 445 stores the rank of $A$ (at position zero) in \code{base_vector} $v$ followed by the indices of 446 the linearly independent columns of $A$. Note that the size of vector $v$ will be adapted if 447 necessary. 448\end{fcode} 449 450\begin{cfcode}{lidia_size_t *}{$A$.lininr}{} 451\end{cfcode} 452 453\begin{fcode}{lidia_size_t *}{lininr}{const bigint_matrix & $A$} 454 returns an array of type \code{lidia_size_t} with the rank of $A$ (at position zero) followed 455 by the indices of the linearly independent rows of $A$ (see \cite{Mueller_Thesis:1994}). 456\end{fcode} 457 458\begin{cfcode}{void}{$A$.lininr}{base_matrix< lidia_size_t > & $v$} 459\end{cfcode} 460 461\begin{fcode}{void}{lininr}{base_matrix< lidia_size_t> & $v$, const bigint_matrix & $A$} 462 stores the rank of $A$ (at position zero) in \code{base_vector} $v$ followed by the indices of 463 the linearly independent rows of $A$. Note that the size of vector $v$ will be adapted if 464 necessary. 465\end{fcode} 466 467\begin{cfcode}{lidia_size_t}{$A$.rank}{} 468\end{cfcode} 469 470\begin{fcode}{lidia_size_t}{rank}{const bigint_matrix & $A$} 471 returns the rank of matrix $A$ (see \cite{Mueller_Thesis:1994}). 472\end{fcode} 473 474\begin{fcode}{void}{$A$.reginvimage}{const bigint_matrix & $B$, const bigint_matrix & $C$} 475 solves the equation systems $B \cdot X = C$ in the following sense: 476 477 The function calculates \code{bigint} multipliers $g_0, \dots, g_{m-1}$, where $m = 478 \code{$C$.columns}$ and a matrix $X$, such that 479 \begin{displaymath} 480 B \cdot X = C \cdot \begin{pmatrix} 481 g_0 & \dots & 0 \\ 482 \vdots & \ddots & \vdots \\ 483 0& \dots & g_{m-1} 484 \end{pmatrix} 485 \end{displaymath} 486 and sets the matrix 487 \begin{displaymath} 488 A \assign \begin{pmatrix} 489 X \\ 490 g_0 \dots g_{m-1} 491 \end{pmatrix} 492 \end{displaymath} 493 if $B$ is regular. Otherwise the \LEH will be invoked. 494\end{fcode} 495 496\begin{fcode}{bigint_matrix}{reginvimage}{const bigint_matrix & $B$, const bigint_matrix & $C$} 497 solves the equation systems $B \cdot X = C$ in the following sense: 498 499 The function calculates \code{bigint} multipliers $g_0$, \dots, $g_{m-1}$, where $m = 500 \code{$C$.columns}$ and a matrix $X$, such that 501 \begin{displaymath} 502 B \cdot X = C \cdot \begin{pmatrix} 503 g_0 & \dots & 0 \\ 504 \vdots & \ddots & \vdots \\ 505 0& \dots & g_{m-1} 506 \end{pmatrix} 507 \end{displaymath} 508 and returns the matrix 509 \begin{displaymath} 510 \begin{pmatrix} 511 X \\ 512 g_0 \dots g_{m-1} 513 \end{pmatrix} 514 \end{displaymath} 515 if $B$ is regular. Otherwise the \LEH will be invoked. 516\end{fcode} 517 518\begin{fcode}{void}{$A$.solve}{const bigint_matrix & $B$, const bigint * $v$} 519 stores the solutions of the linear equation $B \cdot x = v$ to matrix $A$. The last column of 520 matrix $A$ is a solution $x$ of the system and the other columns form a generating system of 521 the kernel of the homomorphism corresponding to matrix $B$. If there is no solution, matrix 522 $A$ has only one column of zeros. If no memory is allocated for the array $v$, the \LEH will 523 be invoked. The behaviour of this function is undefined if $v$ has less than \code{$B$.rows} 524 elements. 525\end{fcode} 526 527\begin{fcode}{bigint_matrix}{solve}{const bigint_matrix & $B$, const bigint * $v$} 528 returns a \code{bigint_matrix} $A$ with the following properties: The last column of matrix 529 $A$ is a solution $x$ of the system $B \cdot x = v$ and the other columns form a generating 530 system of the kernel of the homomorphism corresponding to matrix $B$. If there is no 531 solution, matrix $A$ has only one column of zeros. If no memory is allocated for the array 532 $v$, the \LEH will be invoked. The behaviour of this function is undefined if $v$ has less 533 than \code{$B$.rows} elements. 534\end{fcode} 535 536\begin{fcode}{void}{$A$.solve}{const bigint_matrix & $B$, const math_vector< bigint > & $v$} 537 stores the solutions of the linear equation $B \cdot x = v$ to matrix $A$. The last column of 538 matrix $A$ is a solution $x$ of the system and the other columns form a generating system of 539 the kernel of the homomorphism corresponding to matrix $B$. If there is no solution, matrix 540 $A$ has only one column of zeros. If $\code{$v$.size} \neq \code{$B$.rows}$, the \LEH will be 541 invoked. 542\end{fcode} 543 544\begin{fcode}{bigint_matrix}{solve}{const bigint_matrix & $B$, const math_vector< bigint > & $v$} 545 returns a \code{bigint_matrix} $A$ with the following properties: The last column of matrix 546 $A$ is a solution $x$ of the system $B \cdot x = v$ and the other columns form a generating 547 system of the kernel of the homomorphism corresponding to matrix $B$. If there is no 548 solution, matrix $A$ has only one column of zeros. If $\code{$v$.size} \neq \code{$B$.rows}$, 549 the \LEH will be invoked. 550\end{fcode} 551 552\begin{fcode}{void}{$A$.snf}{} 553 transforms $A$ to Smith Normal Form (I). 554\end{fcode} 555 556\begin{fcode}{bigint_matrix}{snf}{const bigint_matrix & $A$} 557 returns the Smith Normal Form of $A$(I). 558\end{fcode} 559 560\begin{fcode}{void}{$A$.snf}{bigint_matrix & $B$, bigint_matrix & $C$} 561 transforms $A$ in Smith Normal Form and sets $B$, $C$ to the corresponding transformation 562 matrices with $\SNF(A) = B \cdot A \cdot C$ (I). 563\end{fcode} 564 565\begin{fcode}{bigint_matrix}{snf}{const bigint_matrix & $A$, bigint_matrix & $B$, bigint_matrix & $C$} 566 returns the Smith Normal Form of $A$ and sets $B$, $C$ to the corresponding transformation 567 matrices with $\SNF(A) = B \cdot A \cdot C$ (I). 568\end{fcode} 569 570 571%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 572 573\STITLE{Special functions} 574 575 576%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 577 578\SSTITLE{Multiple of the lattice determinant} 579 580\begin{enumerate} 581\item Method: 582 583 \begin{cfcode}{bigint}{$A$.latticedet1}{} 584 \end{cfcode} 585 \begin{fcode}{bigint}{latticedet1}{const bigint_matrix & $A$} 586 returns a positive multiple of the determinant of the lattice generated by the columns of $A$ 587 (see \cite{Duellmann_Thesis:1991}). 588 \end{fcode} 589 590 \begin{cfcode}{void}{$A$.latticedet1}{bigint & $x$} 591 $x \assign \code{latticedet1($A$)}$. 592 \end{cfcode} 593 594\item Method: 595 596 \begin{cfcode}{bigint}{$A$.latticedet2}{} 597 \end{cfcode} 598 \begin{fcode}{bigint}{latticedet2}{const bigint_matrix & $A$} 599 returns a positive multiple of the determinant of the lattice generated by the columns of 600 $A$. First this functions computes two regular submatrices with full rank. Then it 601 computes the determinants $\mathit{DET}_1$ and $\mathit{DET}_2$ of these matrices. Finally 602 it returns the greates common divisor of $\mathit{DET}_1$ and $\mathit{DET}_2$. 603 \end{fcode} 604 605 \begin{cfcode}{void}{$A$.latticedet2}{bigint & $x$} 606 $x \assign \code{latticedet2($A$)}$ 607 \end{cfcode} 608\item Method: 609 610 \begin{cfcode}{bigint}{$A$.latticedet3}{} 611 \end{cfcode} 612 613 \begin{fcode}{bigint}{latticedet3}{const bigint_matrix & $A$} 614 returns a positive multiple of the determinant of the lattice generated by the columns of 615 $A$. In the first step the columns of matrix $A$ are sorted by the euclidian norm. Next it 616 computes a regular submatrix with full rank generated by columns with norm as small as 617 possible. Finally it returns the determinant of this builded matrix. 618 \end{fcode} 619 620 \begin{cfcode}{void}{$A$.latticedet3}{bigint & $x$} 621 $x \assign \code{latticedet3($A$)}$ 622 \end{cfcode} 623\end{enumerate} 624 625 626%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 627 628\SSTITLE{Kernel} 629 630\begin{enumerate} 631\item Method: 632 633 \begin{fcode}{void}{$A$.kernel1}{const bigint_matrix & $B$} 634 stores a basis of the kernel of the homomorphism generated by matrix $B$ to $A$. 635 \end{fcode} 636 637 \begin{fcode}{bigint_matrix}{kernel1}{const bigint_matrix & $B$} 638 returns a matrix where the columns form a base of the kernel of the homomorphism generated 639 by matrix $B$. 640 \end{fcode} 641 The underlying algorithm of these two functions is described in \cite{Mueller_Thesis:1994}. 642 643\item Method: 644 645 \begin{fcode}{void}{$A$.kernel2}{const bigint_matrix & $B$} 646 stores a basis of the kernel of the homomorphism with matrix $B$ to $A$. 647 \end{fcode} 648 649 \begin{fcode}{bigint_matrix}{kernel2}{const bigint_matrix & $B$} 650 returns a matrix where the columns form a base of the kernel of the homomorphism generated 651 by matrix $B$. 652 \end{fcode} 653 654 The underlying algorithm of these two functions works as follow: 655 656 In a first step the algorithm computes the Hermite Normal Form of matrix $B$ and the 657 corresponding transformation matrix $T\!R$ by using \code{B.hnf_havas()} (Description of this 658 algorithm follows later.) Then it counts the number of leading zero columns in the normal 659 form, say $l$ is this number. Finally the leading $l$ columns of the matrix $T\!R$ build the 660 searched basis. 661\end{enumerate} 662The differences in the results of these functions are that on the one hand \code{kernel1} 663usually creates a basis with smaller entries than \code{kernel2} but on the other hand the 664kernel2 functions are faster. 665 666 667%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 668 669\SSTITLE{Hermite Normal Form} 670 671The following functions transform the given matrix in Hermite Normal Form (HNF). A matrix $A$ 672in HNF is an upper triangular matrix with: 673\begin{displaymath} 674 a_{i, \code{$A$.columns}-\code{$A$.rows}+i} > a_{i,j}\geq 0 \quad \forall j > 675 (\code{$A$.columns}-\code{$A$.rows}+i) 676\end{displaymath} 677In these functions we assume that for the given matrices the rank is equal to the number of 678rows. If this condition is not satisfied, the functions using modular methods for the 679computation (i.e. the functions, whose names start with \code{hnfmod}) invoke the \LEH, whereas 680the other functions terminate at the position, where this is detected, returning a partially HNF 681reduced matrix. 682\begin{enumerate} 683\item Method: 684 685 \begin{fcode}{bigint_matrix}{hnf}{const bigint_matrix& $A$} 686 Equivalent to \code{bigint_matrix $B$ = $A$; $B$.hnf_havas(); return $B$;} 687 \end{fcode} 688 689 \begin{fcode}{bigint_matrix}{hnf_gls_solver}{const bigint_matrix& $A$, bigint_matrix& $T$} 690 Equivalent to \code{bigint_matrix $B$ = $A$; $B$.hnf_havas($T$); return $B$;} 691 \end{fcode} 692 693 694\item Method: 695 696 \begin{fcode}{void}{$A$.hnf_cg}{(const matrix< long >& $B$, 697 long Bound1, const bigint& Bound2, int $n$} 698 \end{fcode} 699 700 \begin{fcode}{void}{$A$.hnf_cg}{(const matrix< long >& $B$, bigint_matrix& $T$, 701 long Bound1, const bigint& Bound2, int $n$} 702 \end{fcode} 703 704\item Method: 705 706 \begin{fcode}{void}{$A$.hnf_ref}{} 707 \end{fcode} 708 709\item Method: 710 711 \begin{fcode}{void}{$A$.hnf_gls_solver}{} 712 \end{fcode} 713 714 \begin{fcode}{void}{$A$.hnf_gls_solver}{bigint_matrix& $T$} 715 \end{fcode} 716 717\item Method: 718 719 \begin{fcode}{void}{$A$.hnf_havas}{lidia_size_t KernAlgo $= 0$, lidia_size_t mgcdModul $= 5$, lidia_size_t normalizeModul $= 1$} 720 Algorithm by Havas. 721 \end{fcode} 722 723 \begin{fcode}{void}{$A$.hnf_havas}{bigint_matrix& $T$, lidia_size_t KernAlgo $= 0$, lidia_size_t mgcdModul $= 5$, lidia_size_t normalizeModul $= 1$} 724 Algorithm by Havas. 725 \end{fcode} 726 727\item Method: 728 729 \begin{fcode}{void}{$A$.hnf_kannan}{lidia_size_t $S = 0$} 730 Algorithm by Kannan. 731 \end{fcode} 732 733 \begin{fcode}{void}{$A$.hnf_kannan}{bigint_matrix& $T$, lidia_size_t $S = 0$} 734 Algorithm by Kannan. 735 \end{fcode} 736 737\item Method: 738 739 \begin{fcode}{void}{$A$.hnf_storjohann}{} 740 Algorithm by Storjohann. 741 \end{fcode} 742 743 \begin{fcode}{void}{$A$.hnf_storjohann}{bigint_matrix& $T$, bigint_matrix& $C$, bigint_matrix & $Q$} 744 Algorithm by Storjohann. 745 \end{fcode} 746 747\item Method: 748 749 \begin{fcode}{void}{$A$.hnfmod_dkt}{const bigint& $d$} 750 Algortithm by Domich Kannan, and Trotter. 751 \end{fcode} 752 753 \begin{fcode}{void}{$A$.hnfmod_dkt}{bigint& $T$, const bigint& $d$} 754 Algortithm by Domich Kannan, and Trotter. 755 \end{fcode} 756 757 \begin{fcode}{void}{hnfmod_dkt}{} 758 Equivalent to \code{$A$.hnfmod_dkt($A$.latticedet())}. 759 \end{fcode} 760 761 \begin{fcode}{void}{hnfmod_dkt}{bigint& $T$, const bigint& $d$} 762 Equivalent to \code{$A$.hnfmod_dkt($T$, $A$.latticedet())}. 763 \end{fcode} 764 765\item Method: 766 767 \begin{fcode}{void}{$A$.hnf_cohen}{} 768 Equivalent to \code{$A$.hnf_cohen($A$.latticedet())}. 769 \end{fcode} 770 771 \begin{fcode}{void}{hnf_cohen}{const bigint& $d$} 772 Algorithm from \cite{Cohen:1995}. 773 \end{fcode} 774 775\item Method: 776 777 \begin{fcode}{void}{$A$.hnfmod_mueller}{bigint_matrix& $T$} 778 Algorithm by M\"uller \cite{Mueller_Thesis:1994}. 779 \end{fcode} 780 781\end{enumerate} 782 783A description of these algorithms and references to the original papers are 784contained in \cite{Theobald:2000}. 785 786%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 787 788\SSTITLE{Smith Normal Form} 789 790The following functions tranform the given matrix into Smith Normal Form (SNF). A matrix in SNF 791is a diagonal matrix $A = (a_{i,j})$ ($0 \leq i \leq n$, $0 \leq j \leq n$) such that for all $0 792\leq i < n$: 793\begin{align*} 794 a_{i,i} & \geq 0 \\ 795 a_{n,n} & \geq 0 \\ 796 a_{i,i} & \mid a_{i+1,i+1} 797\end{align*} 798\begin{enumerate} 799\item Method: 800 801 \begin{fcode}{void}{$A$.snf_simple}{} 802 transforms $A$ to Smith Normal Form using a variant of Gau\ss-Jordan elimination. 803 \end{fcode} 804 805 \begin{fcode}{bigint_matrix}{snf_simple}{const bigint_matrix & $A$} 806 returns the Smith Normal Form of $A$ using a variant of Gau\ss-Jordan elimination. 807 \end{fcode} 808 809 \begin{fcode}{void}{$A$.snf_simple}{bigint_matrix & $C$, bigint_matrix & $B$} 810 transforms $A$ in Smith Normal Form and sets $B$ and $C$ to the corresponding transformation 811 matrices (i.e. $\SNF(A) = C \cdot A \cdot B$) using a variant of Gau\ss-Jordan elimination. 812 \end{fcode} 813 814 \begin{fcode}{bigint_matrix}{snf_simple}{const bigint_matrix & $A$, bigint_matrix & $C$, bigint_matrix & $B$} 815 returns the Smith Normal Form of $A$ and sets $B$ and $C$ to the corresponding 816 transformation matrices (i.e. $\SNF(A) = C \cdot A \cdot B$) using a variant of 817 Gau\ss-Jordan elimination. 818 \end{fcode} 819 820\item Method: 821 822 \begin{fcode}{void}{$A$.snf_hartley}{} 823 transforms $A$ to Smith Normal Form using a variant of the algorithm of Hartley and Hawkes. 824 \end{fcode} 825 826 \begin{fcode}{bigint_matrix}{snf_hartley}{const bigint_matrix & $A$} 827 returns the Smith Normal Form of $A$ using a variant of the algorithm of Hartley and Hawkes. 828 \end{fcode} 829 830 \begin{fcode}{void}{$A$.snf_hartley}{bigint_matrix & $C$, bigint_matrix & $B$} 831 transforms $A$ in Smith Normal Form and sets $B$ and $C$ to the corresponding transformation 832 matrices (i.e. $\SNF(A) = C \cdot A\cdot B$) using a variant of the algorithm of Hartley and 833 Hawkes. 834 \end{fcode} 835 836 \begin{fcode}{bigint_matrix}{snf_hartley}{const bigint_matrix & $A$, bigint_matrix & $C$, bigint_matrix & $B$} 837 returns the Smith Normal Form of $A$ and sets $B$ and $C$ to the corresponding 838 transformation matrices (i.e. $\SNF(A) = C \cdot A\cdot B$) using a variant of the algorithm 839 of Hartley and Hawkes. 840 \end{fcode} 841 842\item Method: 843 844 \begin{fcode}{void}{$A$.snf_havas}{} 845 transforms $A$ to Smith Normal Form using results of \cite{Havas/Holt/Rees:1993} 846 \cite{Havas/Majewski:1997} and \cite{Havas/Sterling:1979}. 847 \end{fcode} 848 849 \begin{fcode}{bigint_matrix}{snf_havas}{const bigint_matrix & $A$} 850 returns the Smith Normal Form of $A$ using results of \cite{Havas/Holt/Rees:1993} 851 \cite{Havas/Majewski:1997} and \cite{Havas/Sterling:1979}. 852 \end{fcode} 853 854 \begin{fcode}{void}{$A$.snf_havas}{bigint_matrix & $C$, bigint_matrix & $B$} 855 transforms $A$ in Smith Normal Form and sets $B$ and $C$ to the corresponding transformation 856 matrices (i.e. $\SNF(A) = C \cdot A \cdot B$) using results of \cite{Havas/Holt/Rees:1993} 857 \cite{Havas/Majewski:1997} \cite{Havas/Sterling:1979}. 858 \end{fcode} 859 860 \begin{fcode}{bigint_matrix}{snf_havas}{const bigint_matrix & $A$, bigint_matrix & $C$, bigint_matrix & $B$} 861 returns the Smith Normal Form of $A$ and sets $B$ and $C$ to the corresponding 862 transformation matrices (i.e. $\SNF(A) = C \cdot A \cdot B$) using results of 863 \cite{Havas/Holt/Rees:1993} \cite{Havas/Majewski:1997} \cite{Havas/Sterling:1979}. 864 \end{fcode} 865\end{enumerate} 866The following functions are based on results of \cite{Havas/Holt/Rees:1993}, 867\cite{Havas/Majewski:1997} and \cite{Havas/Sterling:1979}. The extensions \code{add}, 868\code{mult}, \code{new} specify how column norms and row norms are combined for choosing the 869pivot strategy and the paramter $k$ is used to select the $L_k$-norm which is used as described 870in these papers (default: $k = 1$). If $k < 0$ the behaviour of the functions is undefined. 871 872Member functions transform the given (member) matrix in Smith Normal Form. Functions return the 873Smith Normal Form of the first argument. 874 875All functions with more then two arguments compute also the corresponding transformation 876matrices $B$ and $C$ with $\SNF(A) = C \cdot A \cdot B$: 877 878\begin{fcode}{void}{$A$.snf_mult}{lidia_size_t $k$ =1} 879\end{fcode} 880 881\begin{fcode}{bigint_matrix}{snf_mult}{const bigint_matrix & $A$, lidia_size_t $k$ = 1} 882\end{fcode} 883 884\begin{fcode}{void}{$A$.snf_mult}{bigint_matrix & $C$, bigint_matrix & $B$, lidia_size_t $k$ =1} 885\end{fcode} 886 887\begin{fcode}{bigint_matrix}{snf_mult}{const bigint_matrix & $A$, bigint_matrix & $C$, 888 bigint_matrix & $B$, lidia_size_t $k$ = 1}% 889\end{fcode} 890 891\begin{fcode}{void}{$A$.snf_add}{lidia_size_t $k$ = 1} 892\end{fcode} 893 894\begin{fcode}{bigint_matrix}{snf_add}{const bigint_matrix & $A$, lidia_size_t $k$ = 1} 895\end{fcode} 896 897\begin{fcode}{void}{$A$.snf_add}{bigint_matrix & $C$, bigint_matrix & $B$, lidia_size_t $k$ = 1} 898\end{fcode} 899 900\begin{fcode}{bigint_matrix}{snf_add}{const bigint_matrix & $A$, bigint_matrix & $C$, 901 bigint_matrix & $B$, lidia_size_t $k$ = 1}% 902\end{fcode} 903 904\begin{fcode}{void}{$A$.snf_new}{lidia_size_t $k$ = 1} 905\end{fcode} 906 907\begin{fcode}{bigint_matrix}{snf_new}{const bigint_matrix & $A$, lidia_size_t $k$ = 1} 908\end{fcode} 909 910\begin{fcode}{void}{$A$.snf_new}{bigint_matrix & $C$, bigint_matrix & $B$, lidia_size_t $k$ = 1} 911\end{fcode} 912 913\begin{fcode}{bigint_matrix}{snf_new}{const bigint_matrix & $A$, bigint_matrix & $C$, 914 bigint_matrix & $B$, lidia_size_t $k$ = 1}% 915\end{fcode} 916 917The following functions use modular algorithms, which are based on \cite{Cohen:1995} and 918\cite{Domich:1989}. 919 920\begin{enumerate} 921\item Method: 922 923 \begin{fcode}{void}{$A$.snfmod_dkt}{} 924 transforms $A$ to Smith Normal Form \cite{Domich:1989}. 925 \end{fcode} 926 927 \begin{fcode}{bigint_matrix}{snfmod_dkt}{const bigint_matrix & $A$} 928 returns the Smith Normal Form of $A$ \cite{Domich:1989}. 929 \end{fcode} 930 931 \begin{fcode}{void}{$A$.snfmod_dkt}{const bigint & $x$} 932 transforms $A$ to Smith Normal Form assuming that $x$ is a multiple of the lattice 933 determinant \cite{Domich:1989}. 934 \end{fcode} 935 936 \begin{fcode}{bigint_matrix}{snfmod_dkt}{const bigint_matrix & $A$, const bigint & $x$} 937 returns the Smith Normal Form of $A$ assuming that $x$ is a multiple of the lattice 938 determinant \cite{Domich:1989}. 939 \end{fcode} 940 941\item Method: 942 943 \begin{fcode}{void}{$A$.snfmod_cohen}{} 944 transforms $A$ to Smith Normal Form \cite{Cohen:1995}. 945 \end{fcode} 946 947 \begin{fcode}{bigint_matrix}{snfmod_cohen}{const bigint_matrix & $A$} 948 returns the Smith Normal Form of $A$ \cite{Cohen:1995}. 949 \end{fcode} 950 951 \begin{fcode}{void}{$A$.snfmod_cohen}{const bigint & $x$} 952 transforms $A$ to Smith Normal Form assuming that $x$ is a multiple of the lattice 953 determinant \cite{Cohen:1995}. 954 \end{fcode} 955 956 \begin{fcode}{bigint_matrix}{snfmod_cohen}{const bigint_matrix & $A$, const bigint & $x$} 957 returns the Smith Normal Form of $A$ assuming that $x$ is a multiple of the lattice 958 determinant \cite{Cohen:1995}. 959 \end{fcode} 960\end{enumerate} 961 962 963%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 964 965\SEEALSO 966 967\SEE{base_matrix}, \SEE{math_matrix}, 968\SEE{base_vector}, \SEE{math_vector} 969 970 971%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 972 973\NOTES 974 975By inspection of the file \code{LiDIA/bigint_matrix.h} you will discover additional routines for 976computing normal forms, the kernel, \dots. These versions are not yet completely tested, but 977should be faster than the well tested functions, that are documented. In the next release these 978functions should be included. So, if you feel a bit adventurous you might try them and help us 979to debug them. 980 981 982%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 983 984\EXAMPLES 985 986\begin{quote} 987\begin{verbatim} 988#include <LiDIA/bigint_matrix.h> 989 990int main() 991{ 992 lidia_size_t c = 7, d = 5; 993 994 bigint_matrix A(c,c); 995 A.randomize((bigint)10); 996 997 bigint *tmp = A.row(5); 998 A.sto_row(tmp,7,3); 999 1000 bigint_matrix B, C; 1001 1002 B = A; 1003 A.hnf_simple(); 1004 cout << "hnf_simple" << A << flush; 1005 1006 B = A; 1007 A.hnf_havas(); 1008 cout << "hnf_havas" << A << flush; 1009 1010 B = A; 1011 A.hnf_havas_cont(); 1012 cout << "hnf_havas_cont" << A << flush; 1013 1014 B = A; 1015 A.hnf_havas_cont(C); 1016 cout << A << B*C << flush; 1017 1018 return 0; 1019} 1020\end{verbatim} 1021\end{quote} 1022 1023For further examples please refer to \path{LiDIA/src/simple_classes/bigint_matrix_appl.cc}. 1024 1025%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1026 1027\AUTHOR 1028 1029Stefan Neis, Patrick Theobald 1030