assert(SparseMatrix_is_symmetric(A, false));
assert(A->type == MATRIX_TYPE_REAL);
- a = (double*) A->a;
+ a = A->a;
if (!randomize){
for (i = 0; i < m; i++){
first = TRUE;
*ncluster = 0;
(*clusterp)[0] = 0;
nz = 0;
- a = (double*) A->a;
+ a = A->a;
if (!randomize){
for (i = 0; i < m; i++){
if (matched[i] == MATCHED || node_degree(i) != 1) continue;
*ncluster = 0;
(*clusterp)[0] = 0;
nz = 0;
- a = (double*) A->a;
+ a = A->a;
for (i = 0; i < nsuper; i++){
if (superp[i+1] - superp[i] <= 1) continue;
}
static int scomp(const void *s1, const void *s2){
- const double *ss1, *ss2;
- ss1 = (const double*) s1;
- ss2 = (const double*) s2;
+ const double *ss1 = s1;
+ const double *ss2 = s2;
if ((ss1)[1] > (ss2)[1]){
return -1;
*ncluster = 0;
(*clusterp)[0] = 0;
nz = 0;
- a = (double*) A->a;
+ a = A->a;
p = random_permutation(m);
for (ii = 0; ii < m; ii++){
assert(SparseMatrix_is_symmetric(A, false));
assert(A->type == MATRIX_TYPE_REAL);
- a = (double*) A->a;
+ a = A->a;
if (!randomize){
for (i = 0; i < m; i++){
first = TRUE;
}
}
assert(nzc == n);
- *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL, sizeof(double));
+ *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, val,
+ MATRIX_TYPE_REAL, sizeof(double));
*R = SparseMatrix_transpose(*P);
*cD = DistanceMatrix_restrict_cluster(ncluster, clusterp, cluster, *P, *R, D);
}
assert(nc == nmatch);
assert(nzc == n);
- *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL, sizeof(double));
+ *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, val,
+ MATRIX_TYPE_REAL, sizeof(double));
*R = SparseMatrix_transpose(*P);
*cA = SparseMatrix_multiply3(*R, A, *P);
/*
}
}
- *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, (void *) val, MATRIX_TYPE_REAL, sizeof(double));
+ *P = SparseMatrix_from_coordinate_arrays(nzc, n, nc, irn, jcn, val,
+ MATRIX_TYPE_REAL, sizeof(double));
*R = SparseMatrix_transpose(*P);
*cA = SparseMatrix_multiply3(*R, A, *P);
if (!*cA) goto RETURN;
*gain = gain_max = q->gain_max;
(q->count)--;
l = (q->buckets)[gain_max];
- data = (int*) DoubleLinkedList_get_data(l);
+ data = DoubleLinkedList_get_data(l);
*i = data[0];
DoubleLinkedList_delete_element(l, free, &((q->buckets)[gain_max]));
D->type = MATRIX_TYPE_REAL;
D->a = N_GNEW(D->nz,double);
}
- d = (double*) D->a;
+ d = D->a;
mask = N_GNEW(D->m,int);
for (i = 0; i < D->m; i++) mask[i] = -1;
iw = sm->Lw->ia; jw = sm->Lw->ja;
- w = (double*) sm->Lw->a; d = (double*) sm->Lwd->a;
+ w = sm->Lw->a;
+ d = sm->Lwd->a;
id = sm->Lwd->ia; jd = sm->Lwd->ja;
iw[0] = id[0] = 0;
ia = A->ia;
ja = A->ja;
- a = (double*) A->a;
+ a = A->a;
sm = MALLOC(sizeof(struct StressMajorizationSmoother_struct));
iw = sm->Lw->ia; jw = sm->Lw->ja;
id = sm->Lwd->ia; jd = sm->Lwd->ja;
- w = (double*) sm->Lw->a; d = (double*) sm->Lwd->a;
+ w = sm->Lw->a;
+ d = sm->Lwd->a;
iw[0] = id[0] = 0;
nz = 0;
if (!y) goto RETURN;
id = Lwd->ia; jd = Lwd->ja;
- d = (double*) Lwd->a;
- dd = (double*) Lwdd->a;
- w = (double*) Lw->a;
+ d = Lwd->a;
+ dd = Lwdd->a;
+ w = Lw->a;
iw = Lw->ia; jw = Lw->ja;
#ifdef DEBUG_PRINT
iw = sm->Lw->ia; jw = sm->Lw->ja;
- w = (double*) sm->Lw->a; d = (double*) sm->Lwd->a;
+ w = sm->Lw->a;
+ d = sm->Lwd->a;
for (i = 0; i < m; i++){
diag_d = diag_w = 0;
assert(SparseMatrix_is_symmetric(A, false));
ID = ideal_distance_matrix(A, dim, x);
- dd = (double*) ID->a;
+ dd = ID->a;
sm = N_GNEW(1,struct SpringSmoother_struct);
mask = N_GNEW(m,int);
}
id = sm->D->ia; jd = sm->D->ja;
- d = (double*) sm->D->a;
+ d = sm->D->a;
id[0] = 0;
nz = 0;
static double* Operator_diag_precon_apply(Operator o, double *x, double *y){
int i, m;
- double *diag = (double*) o->data;
+ double *diag = o->data;
m = (int) diag[0];
diag++;
for (i = 0; i < m; i++) y[i] = x[i]*diag[i];
Operator o;
double *diag;
int i, j, m = A->m, *ia = A->ia, *ja = A->ja;
- double *a = (double*) A->a;
+ double *a = A->a;
assert(A->type == MATRIX_TYPE_REAL);
o = MALLOC(sizeof(struct Operator_struct));
o->data = MALLOC(sizeof(double)*(m + 1));
- diag = (double*) o->data;
+ diag = o->data;
diag[0] = m;
diag++;
Operator o;
double *diag;
int i, j, m = A->m, *ia = A->ia, *ja = A->ja;
- double *a = (double*) A->a;
+ double *a = A->a;
assert(A->type == MATRIX_TYPE_REAL);
o = N_GNEW(1,struct Operator_struct);
o->data = N_GNEW((A->m + 1),double);
- diag = (double*) o->data;
+ diag = o->data;
diag[0] = m;
diag++;
y = MALLOC(sizeof(double)*n);
b = MALLOC(sizeof(double)*n);
assert(A->type == MATRIX_TYPE_REAL);
- ia = A->ia; ja = A->ja; a = (double*) A->a;
+ ia = A->ia;
+ ja = A->ja;
+ a = A->a;
for (k = 0; k < dim; k++){
for (i = 0; i < n; i++) {
}
static int comp_real(const void *x, const void *y){
- const double *xx = (const double*) x;
- const double *yy = (const double*) y;
+ const double *xx = x;
+ const double *yy = y;
if (*xx > *yy){
return 1;
ja = A->ja;
id = D->ia;
jd = D->ja;
- d = (double*) D->a;
+ d = D->a;
if (ctrl->random_start){
srand(ctrl->random_seed);
UniformStressSmoother sm;
int i, j, k, m = A->m, *ia = A->ia, *ja = A->ja, *iw, *jw, *id, *jd;
int nz;
- double *d, *w, *a = (double*) A->a;
+ double *d, *w, *a = A->a;
double diag_d, diag_w, dist, epsilon = 0.01;
assert(SparseMatrix_is_symmetric(A, false));
iw = sm->Lw->ia; jw = sm->Lw->ja;
id = sm->Lwd->ia; jd = sm->Lwd->ja;
- w = (double*) sm->Lw->a; d = (double*) sm->Lwd->a;
+ w = sm->Lw->a;
+ d = sm->Lwd->a;
iw[0] = id[0] = 0;
nz = 0;
} else {
B = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
}
- val = (double*) B->a;
+ val = B->a;
if (scaling != 1) for (i = 0; i < B->nz; i++) val[i] *= scaling;
return B;
}