Graphviz 13.0.0~dev.20241220.2304
|
#include <neatogen/matrix_ops.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <util/alloc.h>
Go to the source code of this file.
Macros | |
#define | RANGE 500 |
Functions | |
bool | power_iteration (double **square_mat, int n, int neigs, double **eigs, double *evals) |
void | mult_dense_mat (double **A, float **B, int dim1, int dim2, int dim3, float ***CC) |
void | mult_dense_mat_d (double **A, float **B, int dim1, int dim2, int dim3, double ***CC) |
void | mult_sparse_dense_mat_transpose (vtx_data *A, double **B, int dim1, int dim2, float ***CC) |
void | scadd (double *vec1, int end, double fac, double *vec2) |
double | norm (double *vec, int end) |
void | orthog1 (int n, double *vec) |
void | init_vec_orth1 (int n, double *vec) |
void | right_mult_with_vector (vtx_data *matrix, int n, double *vector, double *result) |
void | right_mult_with_vector_f (float **matrix, int n, double *vector, double *result) |
void | vectors_subtraction (int n, double *vector1, double *vector2, double *result) |
void | vectors_addition (int n, double *vector1, double *vector2, double *result) |
void | vectors_scalar_mult (int n, const double *vector, double alpha, double *result) |
void | copy_vector (int n, const double *source, double *dest) |
double | vectors_inner_product (int n, const double *vector1, const double *vector2) |
double | max_abs (int n, double *vector) |
void | right_mult_with_vector_transpose (double **matrix, int dim1, int dim2, double *vector, double *result) |
void | right_mult_with_vector_d (double **matrix, int dim1, int dim2, double *vector, double *result) |
void | orthog1f (int n, float *vec) |
void | right_mult_with_vector_ff (float *packed_matrix, int n, float *vector, float *result) |
void | vectors_subtractionf (int n, float *vector1, float *vector2, float *result) |
void | vectors_additionf (int n, float *vector1, float *vector2, float *result) |
void | vectors_mult_additionf (int n, float *vector1, float alpha, float *vector2) |
void | copy_vectorf (int n, float *source, float *dest) |
double | vectors_inner_productf (int n, float *vector1, float *vector2) |
void | set_vector_val (int n, double val, double *result) |
void | set_vector_valf (int n, float val, float *result) |
double | max_absf (int n, float *vector) |
void | square_vec (int n, float *vec) |
void | invert_vec (int n, float *vec) |
void | sqrt_vecf (int n, float *source, float *target) |
void | invert_sqrt_vec (int n, float *vec) |
Variables | |
static double | p_iteration_threshold = 1e-3 |
#define RANGE 500 |
Definition at line 252 of file matrix_ops.c.
void copy_vector | ( | int | n, |
const double * | source, | ||
double * | dest | ||
) |
Definition at line 322 of file matrix_ops.c.
Referenced by conjugate_gradient(), conjugate_gradient_f(), power_iteration(), rescale_layout_polar(), and rescale_layout_polarFocus().
void copy_vectorf | ( | int | n, |
float * | source, | ||
float * | dest | ||
) |
Definition at line 459 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel(), and stress_majorization_kD_mkernel().
void init_vec_orth1 | ( | int | n, |
double * | vec | ||
) |
Definition at line 254 of file matrix_ops.c.
References orthog1(), and RANGE.
void invert_sqrt_vec | ( | int | n, |
float * | vec | ||
) |
Definition at line 529 of file matrix_ops.c.
Referenced by stress_majorization_kD_mkernel().
void invert_vec | ( | int | n, |
float * | vec | ||
) |
Definition at line 509 of file matrix_ops.c.
Referenced by stress_majorization_kD_mkernel().
double max_abs | ( | int | n, |
double * | vector | ||
) |
Definition at line 339 of file matrix_ops.c.
Referenced by conjugate_gradient(), and conjugate_gradient_f().
double max_absf | ( | int | n, |
float * | vector | ||
) |
Definition at line 491 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel().
void mult_dense_mat | ( | double ** | A, |
float ** | B, | ||
int | dim1, | ||
int | dim2, | ||
int | dim3, | ||
float *** | CC | ||
) |
Definition at line 133 of file matrix_ops.c.
References A, B, C, CC, and gv_calloc().
Referenced by sparse_stress_subspace_majorization_kD().
void mult_dense_mat_d | ( | double ** | A, |
float ** | B, | ||
int | dim1, | ||
int | dim2, | ||
int | dim3, | ||
double *** | CC | ||
) |
Definition at line 160 of file matrix_ops.c.
References A, B, C, CC, and gv_calloc().
Referenced by iterativePCA_1D().
void mult_sparse_dense_mat_transpose | ( | vtx_data * | A, |
double ** | B, | ||
int | dim1, | ||
int | dim2, | ||
float *** | CC | ||
) |
Definition at line 188 of file matrix_ops.c.
References A, B, C, CC, gv_calloc(), and nedges.
Referenced by iterativePCA_1D(), and sparse_stress_subspace_majorization_kD().
double norm | ( | double * | vec, |
int | end | ||
) |
Definition at line 229 of file matrix_ops.c.
References vectors_inner_product().
Referenced by power_iteration().
void orthog1 | ( | int | n, |
double * | vec | ||
) |
Definition at line 233 of file matrix_ops.c.
Referenced by conjugate_gradient(), conjugate_gradient_f(), init_vec_orth1(), initLayout(), and stress_majorization_kD_mkernel().
void orthog1f | ( | int | n, |
float * | vec | ||
) |
Definition at line 390 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel().
bool power_iteration | ( | double ** | square_mat, |
int | n, | ||
int | neigs, | ||
double ** | eigs, | ||
double * | evals | ||
) |
Definition at line 20 of file matrix_ops.c.
References alpha, copy_vector(), free(), gv_calloc(), len(), norm(), p_iteration_threshold, right_mult_with_vector_d(), scadd(), tol, vectors_inner_product(), and vectors_scalar_mult().
Referenced by iterativePCA_1D(), and PCA_alloc().
void right_mult_with_vector | ( | vtx_data * | matrix, |
int | n, | ||
double * | vector, | ||
double * | result | ||
) |
Definition at line 266 of file matrix_ops.c.
References vtx_data::nedges.
Referenced by conjugate_gradient().
void right_mult_with_vector_d | ( | double ** | matrix, |
int | dim1, | ||
int | dim2, | ||
double * | vector, | ||
double * | result | ||
) |
Definition at line 368 of file matrix_ops.c.
Referenced by power_iteration(), and sparse_stress_subspace_majorization_kD().
void right_mult_with_vector_f | ( | float ** | matrix, |
int | n, | ||
double * | vector, | ||
double * | result | ||
) |
Definition at line 281 of file matrix_ops.c.
Referenced by conjugate_gradient_f().
void right_mult_with_vector_ff | ( | float * | packed_matrix, |
int | n, | ||
float * | vector, | ||
float * | result | ||
) |
Definition at line 408 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel(), and stress_majorization_kD_mkernel().
void right_mult_with_vector_transpose | ( | double ** | matrix, |
int | dim1, | ||
int | dim2, | ||
double * | vector, | ||
double * | result | ||
) |
Definition at line 350 of file matrix_ops.c.
Referenced by sparse_stress_subspace_majorization_kD().
void scadd | ( | double * | vec1, |
int | end, | ||
double | fac, | ||
double * | vec2 | ||
) |
Definition at line 220 of file matrix_ops.c.
Referenced by power_iteration(), and rescale_layout_polar().
void set_vector_val | ( | int | n, |
double | val, | ||
double * | result | ||
) |
Definition at line 477 of file matrix_ops.c.
void set_vector_valf | ( | int | n, |
float | val, | ||
float * | result | ||
) |
Definition at line 484 of file matrix_ops.c.
Referenced by stress_majorization_kD_mkernel().
void sqrt_vecf | ( | int | n, |
float * | source, | ||
float * | target | ||
) |
Definition at line 519 of file matrix_ops.c.
Referenced by stress_majorization_kD_mkernel().
void square_vec | ( | int | n, |
float * | vec | ||
) |
Definition at line 501 of file matrix_ops.c.
Referenced by stress_majorization_kD_mkernel().
void vectors_addition | ( | int | n, |
double * | vector1, | ||
double * | vector2, | ||
double * | result | ||
) |
Definition at line 306 of file matrix_ops.c.
Referenced by conjugate_gradient(), and conjugate_gradient_f().
void vectors_additionf | ( | int | n, |
float * | vector1, | ||
float * | vector2, | ||
float * | result | ||
) |
Definition at line 442 of file matrix_ops.c.
double vectors_inner_product | ( | int | n, |
const double * | vector1, | ||
const double * | vector2 | ||
) |
Definition at line 328 of file matrix_ops.c.
Referenced by conjugate_gradient(), conjugate_gradient_f(), norm(), and power_iteration().
double vectors_inner_productf | ( | int | n, |
float * | vector1, | ||
float * | vector2 | ||
) |
Definition at line 466 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel(), and stress_majorization_kD_mkernel().
void vectors_mult_additionf | ( | int | n, |
float * | vector1, | ||
float | alpha, | ||
float * | vector2 | ||
) |
Definition at line 451 of file matrix_ops.c.
References alpha.
Referenced by conjugate_gradient_mkernel().
void vectors_scalar_mult | ( | int | n, |
const double * | vector, | ||
double | alpha, | ||
double * | result | ||
) |
Definition at line 314 of file matrix_ops.c.
References alpha.
Referenced by conjugate_gradient(), conjugate_gradient_f(), and power_iteration().
void vectors_subtraction | ( | int | n, |
double * | vector1, | ||
double * | vector2, | ||
double * | result | ||
) |
Definition at line 296 of file matrix_ops.c.
Referenced by conjugate_gradient(), and conjugate_gradient_f().
void vectors_subtractionf | ( | int | n, |
float * | vector1, | ||
float * | vector2, | ||
float * | result | ||
) |
Definition at line 433 of file matrix_ops.c.
Referenced by conjugate_gradient_mkernel().
|
static |
Definition at line 18 of file matrix_ops.c.
Referenced by power_iteration().