Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

suitesparse wrapper: fix C99 error and whitespace issues.

  • Loading branch information...
commit d03634396c6cb1e8ae1f5aa83c51be0c62e241e7 1 parent 011782e
@StefanKarpinski StefanKarpinski authored
Showing with 19 additions and 19 deletions.
  1. +19 −19 deps/SuiteSparse_wrapper.c
View
38 deps/SuiteSparse_wrapper.c
@@ -39,7 +39,7 @@ jl_cholmod_dense_copy_out(cholmod_dense *cd,
)
{
size_t elsize = (cd->xtype == CHOLMOD_COMPLEX ? 2 : 1) *
- (cd->dtype == CHOLMOD_DOUBLE ? sizeof(double) : sizeof(float));
+ (cd->dtype == CHOLMOD_DOUBLE ? sizeof(double) : sizeof(float));
memcpy(p, cd->x, cd->nzmax*elsize);
}
@@ -48,7 +48,7 @@ extern void
jl_cholmod_sparse( void **cs, /* Store return value in here */
size_t nrow, /* # of rows of A */
size_t ncol, /* # of columns of A */
- size_t nzmax, /* max # of nonzeros of A */
+ size_t nzmax, /* max # of nonzeros of A */
void *p, /* p [0..ncol], the column pointers */
void *i, /* i [0..nzmax-1], the row indices */
void *nz, /* nz [0..ncol-1], the # of nonzeros in each col if unpacked */
@@ -89,36 +89,36 @@ jl_cholmod_sparse( void **cs, /* Store return value in here */
}
extern int
-jl_cholmod_sparse_copy_out(cholmod_sparse *cs,
- void *cp, /* column pointers */
- void *ri, /* row indices */
- void *nzp,
- cholmod_common *cm) /* non-zero values */
+jl_cholmod_sparse_copy_out(cholmod_sparse *cs,
+ void *cp, /* column pointers */
+ void *ri, /* row indices */
+ void *nzp,
+ cholmod_common *cm) /* non-zero values */
{
- /* error return if cs is not packed */
- if (!cs->packed) return 1; /* FIXME: If non-packed becomes a problem, write code to do packing */
- if (!cs->sorted) /* sort it */
- if (!cholmod_sort(cs, cm)) return 2;
+ /* error return if cs is not packed */
+ if (!cs->packed) return 1; /* FIXME: If non-packed becomes a problem, write code to do packing */
+ if (!cs->sorted) /* sort it */
+ if (!cholmod_sort(cs, cm)) return 2;
size_t isize;
switch(cs->itype) {
case CHOLMOD_INT:
case CHOLMOD_INTLONG:
- isize = sizeof(int); break;
+ isize = sizeof(int); break;
case CHOLMOD_LONG:
- isize = sizeof(SuiteSparse_long); break;
+ isize = sizeof(SuiteSparse_long); break;
default:
- return 3;
+ return 3;
}
size_t elsize = (cs->xtype == CHOLMOD_COMPLEX ? 2 : 1) *
- (cs->dtype == CHOLMOD_DOUBLE ? sizeof(double) : sizeof(float));
+ (cs->dtype == CHOLMOD_DOUBLE ? sizeof(double) : sizeof(float));
if (cs->itype == CHOLMOD_INTLONG) {
- int *dpt = (int *) cp;
- SuiteSparse_long *spt = (SuiteSparse_long *) cs->p;
- for (int i = 0; i <= cs->ncol; ++i) dpt[i] = spt[i];
+ int i, *dpt = (int *) cp;
+ SuiteSparse_long *spt = (SuiteSparse_long *) cs->p;
+ for (i = 0; i <= cs->ncol; ++i) dpt[i] = spt[i];
} else {
- memcpy(cp, cs->p, (cs->ncol + 1) * isize);
+ memcpy(cp, cs->p, (cs->ncol + 1) * isize);
}
memcpy(ri, cs->i, cs->nzmax * isize);

1 comment on commit d036343

@dmbates
Collaborator

Sorry about the indentation issues. I edit in emacs and need to remove tab-stop settings or remember to run untabify on the buffer before committing.

Please sign in to comment.
Something went wrong with that request. Please try again.