annotate DL/RLS-DLA/private/myblas.h @ 65:55faa9b5d1ac

(none)
author idamnjanovic
date Wed, 16 Mar 2011 13:41:02 +0000
parents ad36f80e2ccf
children
rev   line source
idamnjanovic@60 1 /**************************************************************************
idamnjanovic@60 2 *
idamnjanovic@60 3 * File name: myblas.h
idamnjanovic@60 4 *
idamnjanovic@60 5 * Ron Rubinstein
idamnjanovic@60 6 * Computer Science Department
idamnjanovic@60 7 * Technion, Haifa 32000 Israel
idamnjanovic@60 8 * ronrubin@cs
idamnjanovic@60 9 *
idamnjanovic@60 10 * Version: 1.1
idamnjanovic@60 11 * Last updated: 17.8.2009
idamnjanovic@60 12 *
idamnjanovic@60 13 * A collection of basic linear algebra functions, in the spirit of the
idamnjanovic@60 14 * BLAS/LAPACK libraries.
idamnjanovic@60 15 *
idamnjanovic@60 16 *************************************************************************/
idamnjanovic@60 17
idamnjanovic@60 18
idamnjanovic@60 19
idamnjanovic@60 20 #ifndef __MY_BLAS_H__
idamnjanovic@60 21 #define __MY_BLAS_H__
idamnjanovic@60 22
idamnjanovic@60 23
idamnjanovic@60 24 #include "mex.h"
idamnjanovic@60 25 #include <math.h>
idamnjanovic@60 26
idamnjanovic@60 27
idamnjanovic@60 28
idamnjanovic@60 29 /**************************************************************************
idamnjanovic@60 30 * Squared value.
idamnjanovic@60 31 **************************************************************************/
idamnjanovic@60 32 #define SQR(X) ((X)*(X))
idamnjanovic@60 33
idamnjanovic@60 34
idamnjanovic@60 35
idamnjanovic@60 36 /**************************************************************************
idamnjanovic@60 37 * Matrix-vector multiplication.
idamnjanovic@60 38 *
idamnjanovic@60 39 * Computes an operation of the form:
idamnjanovic@60 40 *
idamnjanovic@60 41 * y := alpha*A*x
idamnjanovic@60 42 *
idamnjanovic@60 43 * Parameters:
idamnjanovic@60 44 * A - matrix of size n X m
idamnjanovic@60 45 * x - vector of length m
idamnjanovic@60 46 * y - output vector of length n
idamnjanovic@60 47 * alpha - real constant
idamnjanovic@60 48 * n, m - dimensions of A
idamnjanovic@60 49 *
idamnjanovic@60 50 * Note: This function re-writes the contents of y.
idamnjanovic@60 51 *
idamnjanovic@60 52 **************************************************************************/
idamnjanovic@60 53 void mat_vec(double alpha, double A[], double x[], double y[], mwSize n, mwSize m);
idamnjanovic@60 54
idamnjanovic@60 55
idamnjanovic@60 56
idamnjanovic@60 57 /**************************************************************************
idamnjanovic@60 58 * Matrix-transpose-vector multiplication.
idamnjanovic@60 59 *
idamnjanovic@60 60 * Computes an operation of the form:
idamnjanovic@60 61 *
idamnjanovic@60 62 * y := alpha*A'*x
idamnjanovic@60 63 *
idamnjanovic@60 64 * Parameters:
idamnjanovic@60 65 * A - matrix of size n X m
idamnjanovic@60 66 * x - vector of length n
idamnjanovic@60 67 * y - output vector of length m
idamnjanovic@60 68 * alpha - real constant
idamnjanovic@60 69 * n, m - dimensions of A
idamnjanovic@60 70 *
idamnjanovic@60 71 * Note: This function re-writes the contents of y.
idamnjanovic@60 72 *
idamnjanovic@60 73 **************************************************************************/
idamnjanovic@60 74 void matT_vec(double alpha, double A[], double x[], double y[], mwSize n, mwSize m);
idamnjanovic@60 75
idamnjanovic@60 76
idamnjanovic@60 77
idamnjanovic@60 78 /**************************************************************************
idamnjanovic@60 79 * Sparse-matrix-vector multiplication.
idamnjanovic@60 80 *
idamnjanovic@60 81 * Computes an operation of the form:
idamnjanovic@60 82 *
idamnjanovic@60 83 * y := alpha*A*x
idamnjanovic@60 84 *
idamnjanovic@60 85 * where A is a sparse matrix.
idamnjanovic@60 86 *
idamnjanovic@60 87 * Parameters:
idamnjanovic@60 88 * pr,ir,jc - sparse representation of the matrix A, of size n x m
idamnjanovic@60 89 * x - vector of length m
idamnjanovic@60 90 * y - output vector of length n
idamnjanovic@60 91 * alpha - real constant
idamnjanovic@60 92 * n, m - dimensions of A
idamnjanovic@60 93 *
idamnjanovic@60 94 * Note: This function re-writes the contents of y.
idamnjanovic@60 95 *
idamnjanovic@60 96 **************************************************************************/
idamnjanovic@60 97 void mat_sp_vec(double alpha, double pr[], mwIndex ir[], mwIndex jc[], double x[], double y[], mwSize n, mwSize m);
idamnjanovic@60 98
idamnjanovic@60 99
idamnjanovic@60 100
idamnjanovic@60 101 /**************************************************************************
idamnjanovic@60 102 * Sparse-matrix-transpose-vector multiplication.
idamnjanovic@60 103 *
idamnjanovic@60 104 * Computes an operation of the form:
idamnjanovic@60 105 *
idamnjanovic@60 106 * y := alpha*A'*x
idamnjanovic@60 107 *
idamnjanovic@60 108 * where A is a sparse matrix.
idamnjanovic@60 109 *
idamnjanovic@60 110 * Parameters:
idamnjanovic@60 111 * pr,ir,jc - sparse representation of the matrix A, of size n x m
idamnjanovic@60 112 * x - vector of length m
idamnjanovic@60 113 * y - output vector of length n
idamnjanovic@60 114 * alpha - real constant
idamnjanovic@60 115 * n, m - dimensions of A
idamnjanovic@60 116 *
idamnjanovic@60 117 * Note: This function re-writes the contents of y.
idamnjanovic@60 118 *
idamnjanovic@60 119 **************************************************************************/
idamnjanovic@60 120 void matT_sp_vec(double alpha, double pr[], mwIndex ir[], mwIndex jc[], double x[], double y[], mwSize n, mwSize m);
idamnjanovic@60 121
idamnjanovic@60 122
idamnjanovic@60 123
idamnjanovic@60 124 /**************************************************************************
idamnjanovic@60 125 * Matrix-sparse-vector multiplication.
idamnjanovic@60 126 *
idamnjanovic@60 127 * Computes an operation of the form:
idamnjanovic@60 128 *
idamnjanovic@60 129 * y := alpha*A*x
idamnjanovic@60 130 *
idamnjanovic@60 131 * where A is a matrix and x is a sparse vector.
idamnjanovic@60 132 *
idamnjanovic@60 133 * Parameters:
idamnjanovic@60 134 * A - matrix of size n X m
idamnjanovic@60 135 * pr,ir,jc - sparse representation of the vector x, of length m
idamnjanovic@60 136 * y - output vector of length n
idamnjanovic@60 137 * alpha - real constant
idamnjanovic@60 138 * n, m - dimensions of A
idamnjanovic@60 139 *
idamnjanovic@60 140 * Note: This function re-writes the contents of y.
idamnjanovic@60 141 *
idamnjanovic@60 142 **************************************************************************/
idamnjanovic@60 143 void mat_vec_sp(double alpha, double A[], double pr[], mwIndex ir[], mwIndex jc[], double y[], mwSize n, mwSize m);
idamnjanovic@60 144
idamnjanovic@60 145
idamnjanovic@60 146
idamnjanovic@60 147 /**************************************************************************
idamnjanovic@60 148 * Matrix-transpose-sparse-vector multiplication.
idamnjanovic@60 149 *
idamnjanovic@60 150 * Computes an operation of the form:
idamnjanovic@60 151 *
idamnjanovic@60 152 * y := alpha*A'*x
idamnjanovic@60 153 *
idamnjanovic@60 154 * where A is a matrix and x is a sparse vector.
idamnjanovic@60 155 *
idamnjanovic@60 156 * Parameters:
idamnjanovic@60 157 * A - matrix of size n X m
idamnjanovic@60 158 * pr,ir,jc - sparse representation of the vector x, of length n
idamnjanovic@60 159 * y - output vector of length m
idamnjanovic@60 160 * alpha - real constant
idamnjanovic@60 161 * n, m - dimensions of A
idamnjanovic@60 162 *
idamnjanovic@60 163 * Note: This function re-writes the contents of y.
idamnjanovic@60 164 *
idamnjanovic@60 165 **************************************************************************/
idamnjanovic@60 166 void matT_vec_sp(double alpha, double A[], double pr[], mwIndex ir[], mwIndex jc[], double y[], mwSize n, mwSize m);
idamnjanovic@60 167
idamnjanovic@60 168
idamnjanovic@60 169
idamnjanovic@60 170 /**************************************************************************
idamnjanovic@60 171 * Sparse-matrix-sparse-vector multiplication.
idamnjanovic@60 172 *
idamnjanovic@60 173 * Computes an operation of the form:
idamnjanovic@60 174 *
idamnjanovic@60 175 * y := alpha*A*x
idamnjanovic@60 176 *
idamnjanovic@60 177 * where A is a sparse matrix and x is a sparse vector.
idamnjanovic@60 178 *
idamnjanovic@60 179 * Parameters:
idamnjanovic@60 180 * pr,ir,jc - sparse representation of the matrix A, of size n x m
idamnjanovic@60 181 * prx,irx,jcx - sparse representation of the vector x (of length m)
idamnjanovic@60 182 * y - output vector of length n
idamnjanovic@60 183 * alpha - real constant
idamnjanovic@60 184 * n, m - dimensions of A
idamnjanovic@60 185 *
idamnjanovic@60 186 * Note: This function re-writes the contents of y.
idamnjanovic@60 187 *
idamnjanovic@60 188 **************************************************************************/
idamnjanovic@60 189 void mat_sp_vec_sp(double alpha, double pr[], mwIndex ir[], mwIndex jc[], double prx[], mwIndex irx[], mwIndex jcx[], double y[], mwSize n, mwSize m);
idamnjanovic@60 190
idamnjanovic@60 191
idamnjanovic@60 192
idamnjanovic@60 193 /**************************************************************************
idamnjanovic@60 194 * Sparse-matrix-transpose-sparse-vector multiplication.
idamnjanovic@60 195 *
idamnjanovic@60 196 * Computes an operation of the form:
idamnjanovic@60 197 *
idamnjanovic@60 198 * y := alpha*A'*x
idamnjanovic@60 199 *
idamnjanovic@60 200 * where A is a sparse matrix and x is a sparse vector.
idamnjanovic@60 201 *
idamnjanovic@60 202 * Importnant note: this function is provided for completeness, but is NOT efficient.
idamnjanovic@60 203 * If possible, convert x to non-sparse representation and use matT_vec_sp instead.
idamnjanovic@60 204 *
idamnjanovic@60 205 * Parameters:
idamnjanovic@60 206 * pr,ir,jc - sparse representation of the matrix A, of size n x m
idamnjanovic@60 207 * prx,irx,jcx - sparse representation of the vector x (of length n)
idamnjanovic@60 208 * y - output vector of length n
idamnjanovic@60 209 * alpha - real constant
idamnjanovic@60 210 * n, m - dimensions of A
idamnjanovic@60 211 *
idamnjanovic@60 212 * Note: This function re-writes the contents of y.
idamnjanovic@60 213 *
idamnjanovic@60 214 **************************************************************************/
idamnjanovic@60 215 void matT_sp_vec_sp(double alpha, double pr[], mwIndex ir[], mwIndex jc[], double prx[], mwIndex irx[], mwIndex jcx[], double y[], mwSize n, mwSize m);
idamnjanovic@60 216
idamnjanovic@60 217
idamnjanovic@60 218
idamnjanovic@60 219 /**************************************************************************
idamnjanovic@60 220 * Matrix-matrix multiplication.
idamnjanovic@60 221 *
idamnjanovic@60 222 * Computes an operation of the form:
idamnjanovic@60 223 *
idamnjanovic@60 224 * X := alpha*A*B
idamnjanovic@60 225 *
idamnjanovic@60 226 * Parameters:
idamnjanovic@60 227 * A - matrix of size n X m
idamnjanovic@60 228 * B - matrix of size m X k
idamnjanovic@60 229 * X - output matrix of size n X k
idamnjanovic@60 230 * alpha - real constant
idamnjanovic@60 231 * n, m, k - dimensions of A, B
idamnjanovic@60 232 *
idamnjanovic@60 233 * Note: This function re-writes the contents of X.
idamnjanovic@60 234 *
idamnjanovic@60 235 **************************************************************************/
idamnjanovic@60 236 void mat_mat(double alpha, double A[], double B[], double X[], mwSize n, mwSize m, mwSize k);
idamnjanovic@60 237
idamnjanovic@60 238
idamnjanovic@60 239
idamnjanovic@60 240 /**************************************************************************
idamnjanovic@60 241 * Matrix-transpose-matrix multiplication.
idamnjanovic@60 242 *
idamnjanovic@60 243 * Computes an operation of the form:
idamnjanovic@60 244 *
idamnjanovic@60 245 * X := alpha*A*B
idamnjanovic@60 246 *
idamnjanovic@60 247 * Parameters:
idamnjanovic@60 248 * A - matrix of size n X m
idamnjanovic@60 249 * B - matrix of size m X k
idamnjanovic@60 250 * X - output matrix of size n X k
idamnjanovic@60 251 * alpha - real constant
idamnjanovic@60 252 * n, m, k - dimensions of A, B
idamnjanovic@60 253 *
idamnjanovic@60 254 * Note: This function re-writes the contents of X.
idamnjanovic@60 255 *
idamnjanovic@60 256 **************************************************************************/
idamnjanovic@60 257 void matT_mat(double alpha, double A[], double B[], double X[], mwSize n, mwSize m, mwSize k);
idamnjanovic@60 258
idamnjanovic@60 259
idamnjanovic@60 260
idamnjanovic@60 261 /**************************************************************************
idamnjanovic@60 262 * Tensor-matrix multiplication.
idamnjanovic@60 263 *
idamnjanovic@60 264 * This function accepts a 3-D tensor A of size n X m X k
idamnjanovic@60 265 * and a 2-D matrix B of size l X k.
idamnjanovic@60 266 * The function computes the 3-D tensor X of size n X m X l, where
idamnjanovic@60 267 *
idamnjanovic@60 268 * X(i,j,:) = B*A(i,j,:)
idamnjanovic@60 269 *
idamnjanovic@60 270 * for all i,j.
idamnjanovic@60 271 *
idamnjanovic@60 272 * Parameters:
idamnjanovic@60 273 * A - tensor of size n X m X k
idamnjanovic@60 274 * B - matrix of size l X k
idamnjanovic@60 275 * X - output tensor of size n X m X l
idamnjanovic@60 276 * alpha - real constant
idamnjanovic@60 277 * n, m, k, l - dimensions of A, B
idamnjanovic@60 278 *
idamnjanovic@60 279 * Note: This function re-writes the contents of X.
idamnjanovic@60 280 *
idamnjanovic@60 281 **************************************************************************/
idamnjanovic@60 282 void tens_mat(double alpha, double A[], double B[], double X[], mwSize n, mwSize m, mwSize k, mwSize l);
idamnjanovic@60 283
idamnjanovic@60 284
idamnjanovic@60 285
idamnjanovic@60 286 /**************************************************************************
idamnjanovic@60 287 * Tensor-matrix-transpose multiplication.
idamnjanovic@60 288 *
idamnjanovic@60 289 * This function accepts a 3-D tensor A of size n X m X k
idamnjanovic@60 290 * and a 2-D matrix B of size k X l.
idamnjanovic@60 291 * The function computes the 3-D tensor X of size n X m X l, where
idamnjanovic@60 292 *
idamnjanovic@60 293 * X(i,j,:) = B'*A(i,j,:)
idamnjanovic@60 294 *
idamnjanovic@60 295 * for all i,j.
idamnjanovic@60 296 *
idamnjanovic@60 297 * Parameters:
idamnjanovic@60 298 * A - tensor of size n X m X k
idamnjanovic@60 299 * B - matrix of size k X l
idamnjanovic@60 300 * X - output tensor of size n X m X l
idamnjanovic@60 301 * alpha - real constant
idamnjanovic@60 302 * n, m, k, l - dimensions of A, B
idamnjanovic@60 303 *
idamnjanovic@60 304 * Note: This function re-writes the contents of X.
idamnjanovic@60 305 *
idamnjanovic@60 306 **************************************************************************/
idamnjanovic@60 307 void tens_matT(double alpha, double A[], double B[], double X[], mwSize n, mwSize m, mwSize k, mwSize l);
idamnjanovic@60 308
idamnjanovic@60 309
idamnjanovic@60 310
idamnjanovic@60 311 /**************************************************************************
idamnjanovic@60 312 * Vector-vector sum.
idamnjanovic@60 313 *
idamnjanovic@60 314 * Computes an operation of the form:
idamnjanovic@60 315 *
idamnjanovic@60 316 * y := alpha*x + y
idamnjanovic@60 317 *
idamnjanovic@60 318 * Parameters:
idamnjanovic@60 319 * x - vector of length n
idamnjanovic@60 320 * y - output vector of length n
idamnjanovic@60 321 * alpha - real constant
idamnjanovic@60 322 * n - length of x,y
idamnjanovic@60 323 *
idamnjanovic@60 324 * Note: This function re-writes the contents of y.
idamnjanovic@60 325 *
idamnjanovic@60 326 **************************************************************************/
idamnjanovic@60 327 void vec_sum(double alpha, double x[], double y[], mwSize n);
idamnjanovic@60 328
idamnjanovic@60 329
idamnjanovic@60 330
idamnjanovic@60 331 /**************************************************************************
idamnjanovic@60 332 * Triangular back substitution.
idamnjanovic@60 333 *
idamnjanovic@60 334 * Solve the set of linear equations
idamnjanovic@60 335 *
idamnjanovic@60 336 * T*x = b
idamnjanovic@60 337 *
idamnjanovic@60 338 * where T is lower or upper triangular.
idamnjanovic@60 339 *
idamnjanovic@60 340 * Parameters:
idamnjanovic@60 341 * ul - 'U' for upper triangular, 'L' for lower triangular
idamnjanovic@60 342 * A - matrix of size n x m containing T
idamnjanovic@60 343 * b - vector of length k
idamnjanovic@60 344 * x - output vector of length k
idamnjanovic@60 345 * n - size of first dimension of A
idamnjanovic@60 346 * k - the size of the equation set, k<=n,m
idamnjanovic@60 347 *
idamnjanovic@60 348 * Note:
idamnjanovic@60 349 * The matrix A can be of any size n X m, as long as n,m >= k.
idamnjanovic@60 350 * Only the lower/upper triangle of the submatrix A(1:k,1:k) defines the
idamnjanovic@60 351 * matrix T (depending on the parameter ul).
idamnjanovic@60 352 *
idamnjanovic@60 353 **************************************************************************/
idamnjanovic@60 354 void backsubst(char ul, double A[], double b[], double x[], mwSize n, mwSize k);
idamnjanovic@60 355
idamnjanovic@60 356
idamnjanovic@60 357
idamnjanovic@60 358 /**************************************************************************
idamnjanovic@60 359 * Solve a set of equations using a Cholesky decomposition.
idamnjanovic@60 360 *
idamnjanovic@60 361 * Solve the set of linear equations
idamnjanovic@60 362 *
idamnjanovic@60 363 * M*x = b
idamnjanovic@60 364 *
idamnjanovic@60 365 * where M is positive definite with a known Cholesky decomposition:
idamnjanovic@60 366 * either M=L*L' (L lower triangular) or M=U'*U (U upper triangular).
idamnjanovic@60 367 *
idamnjanovic@60 368 * Parameters:
idamnjanovic@60 369 * ul - 'U' for upper triangular, 'L' for lower triangular decomposition
idamnjanovic@60 370 * A - matrix of size n x m with the Cholesky decomposition of M
idamnjanovic@60 371 * b - vector of length k
idamnjanovic@60 372 * x - output vector of length k
idamnjanovic@60 373 * n - size of first dimension of A
idamnjanovic@60 374 * k - the size of the equation set, k<=n,m
idamnjanovic@60 375 *
idamnjanovic@60 376 * Note:
idamnjanovic@60 377 * The matrix A can be of any size n X m, as long as n,m >= k.
idamnjanovic@60 378 * Only the lower/upper triangle of the submatrix A(1:k,1:k) is used as
idamnjanovic@60 379 * the Cholesky decomposition of M (depending on the parameter ul).
idamnjanovic@60 380 *
idamnjanovic@60 381 **************************************************************************/
idamnjanovic@60 382 void cholsolve(char ul, double A[], double b[], double x[], mwSize n, mwSize k);
idamnjanovic@60 383
idamnjanovic@60 384
idamnjanovic@60 385
idamnjanovic@60 386 /**************************************************************************
idamnjanovic@60 387 * Maximum absolute value.
idamnjanovic@60 388 *
idamnjanovic@60 389 * Returns the index of the coefficient with maximal absolute value in a vector.
idamnjanovic@60 390 *
idamnjanovic@60 391 * Parameters:
idamnjanovic@60 392 * x - vector of length n
idamnjanovic@60 393 * n - length of x
idamnjanovic@60 394 *
idamnjanovic@60 395 **************************************************************************/
idamnjanovic@60 396 mwIndex maxabs(double x[], mwSize n);
idamnjanovic@60 397
idamnjanovic@60 398
idamnjanovic@60 399
idamnjanovic@60 400 /**************************************************************************
idamnjanovic@60 401 * Maximum vector element.
idamnjanovic@60 402 *
idamnjanovic@60 403 * Returns the index of the maximal coefficient in a vector.
idamnjanovic@60 404 *
idamnjanovic@60 405 * Parameters:
idamnjanovic@60 406 * x - vector of length n
idamnjanovic@60 407 * n - length of x
idamnjanovic@60 408 *
idamnjanovic@60 409 **************************************************************************/
idamnjanovic@60 410 mwIndex maxpos(double x[], mwSize n);
idamnjanovic@60 411
idamnjanovic@60 412
idamnjanovic@60 413
idamnjanovic@60 414 /**************************************************************************
idamnjanovic@60 415 * Vector-vector dot product.
idamnjanovic@60 416 *
idamnjanovic@60 417 * Computes an operation of the form:
idamnjanovic@60 418 *
idamnjanovic@60 419 * c = a'*b
idamnjanovic@60 420 *
idamnjanovic@60 421 * Parameters:
idamnjanovic@60 422 * a, b - vectors of length n
idamnjanovic@60 423 * n - length of a,b
idamnjanovic@60 424 *
idamnjanovic@60 425 * Returns: The dot product c.
idamnjanovic@60 426 *
idamnjanovic@60 427 **************************************************************************/
idamnjanovic@60 428 double dotprod(double a[], double b[], mwSize n);
idamnjanovic@60 429
idamnjanovic@60 430
idamnjanovic@60 431
idamnjanovic@60 432 /**************************************************************************
idamnjanovic@60 433 * Indexed vector assignment.
idamnjanovic@60 434 *
idamnjanovic@60 435 * Perform a permutation assignment of the form
idamnjanovic@60 436 *
idamnjanovic@60 437 * y = x(ind)
idamnjanovic@60 438 *
idamnjanovic@60 439 * where ind is an array of indices to x.
idamnjanovic@60 440 *
idamnjanovic@60 441 * Parameters:
idamnjanovic@60 442 * y - output vector of length k
idamnjanovic@60 443 * x - input vector of arbitrary length
idamnjanovic@60 444 * ind - array of indices into x (indices begin at 0)
idamnjanovic@60 445 * k - length of the array ind
idamnjanovic@60 446 *
idamnjanovic@60 447 **************************************************************************/
idamnjanovic@60 448 void vec_assign(double y[], double x[], mwIndex ind[], mwSize k);
idamnjanovic@60 449
idamnjanovic@60 450
idamnjanovic@60 451
idamnjanovic@60 452 /**************************************************************************
idamnjanovic@60 453 * Matrix transpose.
idamnjanovic@60 454 *
idamnjanovic@60 455 * Computes Y := X'
idamnjanovic@60 456 *
idamnjanovic@60 457 * Parameters:
idamnjanovic@60 458 * X - input matrix of size n X m
idamnjanovic@60 459 * Y - output matrix of size m X n
idamnjanovic@60 460 * n, m - dimensions of X
idamnjanovic@60 461 *
idamnjanovic@60 462 **************************************************************************/
idamnjanovic@60 463 void transpose(double X[], double Y[], mwSize n, mwSize m);
idamnjanovic@60 464
idamnjanovic@60 465
idamnjanovic@60 466
idamnjanovic@60 467 /**************************************************************************
idamnjanovic@60 468 * Print a matrix.
idamnjanovic@60 469 *
idamnjanovic@60 470 * Parameters:
idamnjanovic@60 471 * A - matrix of size n X m
idamnjanovic@60 472 * n, m - dimensions of A
idamnjanovic@60 473 * matname - name of matrix to display
idamnjanovic@60 474 *
idamnjanovic@60 475 **************************************************************************/
idamnjanovic@60 476 void printmat(double A[], int n, int m, char* matname);
idamnjanovic@60 477
idamnjanovic@60 478
idamnjanovic@60 479
idamnjanovic@60 480 /**************************************************************************
idamnjanovic@60 481 * Print a sparse matrix.
idamnjanovic@60 482 *
idamnjanovic@60 483 * Parameters:
idamnjanovic@60 484 * A - sparse matrix of type double
idamnjanovic@60 485 * matname - name of matrix to display
idamnjanovic@60 486 *
idamnjanovic@60 487 **************************************************************************/
idamnjanovic@60 488 void printspmat(mxArray *A, char* matname);
idamnjanovic@60 489
idamnjanovic@60 490
idamnjanovic@60 491 #endif
idamnjanovic@60 492