~logan/ubuntu/trusty/suitesparse/4.2.1-3ubuntu1

« back to all changes in this revision

Viewing changes to CXSparse/MATLAB/CSparse/cs_print_mex.c

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2007-05-29 09:36:29 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529093629-zowquo0b7slkk6nc
Tags: 3.0.0-2
* suitesparse builds properly twice in a row
* Bug fix: "suitesparse - FTBFS: Broken build depens: libgfortran1-dev",
  thanks to Bastian Blank (Closes: #426349).
* Bug fix: "suitesparse_3.0.0-1: FTBFS: build-depends on
  libgfortran1-dev", thanks to Steve Langasek (Closes: #426354).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "cs_mex.h"
 
2
/* cs_print: print the contents of a sparse matrix. */
 
3
void mexFunction
 
4
(
 
5
    int nargout,
 
6
    mxArray *pargout [ ],
 
7
    int nargin,
 
8
    const mxArray *pargin [ ]
 
9
)
 
10
{
 
11
    CS_INT brief ;
 
12
    if (nargout > 0 || nargin < 1 || nargin > 2)
 
13
    {
 
14
        mexErrMsgTxt ("Usage: cs_print(A,brief)") ;
 
15
    }
 
16
    brief = (nargin < 2) ? 0 : mxGetScalar (pargin [1]) ;   /* get brief */
 
17
    if (mxIsComplex (pargin [0]))
 
18
    {
 
19
#ifndef NCOMPLEX
 
20
        cs_cl Amatrix, *A ;
 
21
        A = cs_cl_mex_get_sparse (&Amatrix, 0, pargin [0]) ;    /* get A */
 
22
        cs_cl_print (A, brief) ;                            /* print A */
 
23
        cs_free (A->x) ;
 
24
#else
 
25
        mexErrMsgTxt ("complex matrices not supported") ;
 
26
#endif
 
27
    }
 
28
    else
 
29
    {
 
30
        cs_dl Amatrix, *A ;
 
31
        A = cs_dl_mex_get_sparse (&Amatrix, 0, 1, pargin [0]) ;/* get A */
 
32
        cs_print (A, brief) ;                               /* print A */
 
33
    }
 
34
}