30 for (i = 0; i < dim*m; i++) (*x)[
i] =
drand();
33 if (edge_len_weighted){
49 for (i = 0; i < dim*m; i++) {
63 struct stress_model_data {
67 int edge_len_weighted;
73 void stress_model_gv(
void*
data){
74 struct stress_model_data* d;
76 d = (
struct stress_model_data*) data;
77 return stress_model_core(d->dim, d->D, d->x, d->edge_len_weighted, d->maxit_sm, d->tol, d->flag);
80 struct stress_model_data
data = {dim, D, x, edge_len_weighted, maxit_sm, tol, flag};
85 if (!Gviewer)
return stress_model_core(dim, D, x, edge_len_weighted, maxit_sm, tol, flag);
87 argvv = malloc(
sizeof(
char*)*argcc);
88 argvv[0] = malloc(
sizeof(
char));
91 gviewer_set_edge_color_scheme(COLOR_SCHEME_NO);
92 gviewer_toggle_bgcolor();
93 gviewer_init(&argcc, argvv, 0.1, 20, 60, 720, 720, A, dim, *x, &(data), stress_model_gv);
void stress_model(int dim, SparseMatrix A, SparseMatrix D, real **x, int edge_len_weighted, int maxit_sm, real tol, int *flag)
SparseMatrix SparseMatrix_remove_diagonal(SparseMatrix A)
StressMajorizationSmoother SparseStressMajorizationSmoother_new(SparseMatrix A, int dim, real lambda0, real *x, int weighting_scheme, int scale_initial_coord)
int SparseMatrix_is_symmetric(SparseMatrix A, int test_pattern_symmetry_only)
void stress_model_core(int dim, SparseMatrix B, real **x, int edge_len_weighted, int maxit_sm, real tol, int *flag)
void SparseStressMajorizationSmoother_delete(SparseStressMajorizationSmoother sm)
SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized(SparseMatrix A)
SparseMatrix SparseMatrix_symmetrize(SparseMatrix A, int pattern_symmetric_only)
void SparseMatrix_delete(SparseMatrix A)
real SparseStressMajorizationSmoother_smooth(SparseStressMajorizationSmoother sm, int dim, real *x, int maxit_sm, real tol)