| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#include <stdbool.h> |
| 14 |
#include <util/api.h> |
| 15 |
|
| 16 |
#ifdef __cplusplus |
| 17 |
extern "C" { |
| 18 |
#endif |
| 19 |
|
| 20 |
#include <neatogen/sparsegraph.h> |
| 21 |
|
| 22 |
PRIVATE void scadd(double *, int, double, double *); |
| 23 |
PRIVATE double norm(double *, int); |
| 24 |
|
| 25 |
PRIVATE void orthog1(int n, double *vec); |
| 26 |
PRIVATE void init_vec_orth1(int n, double *vec); |
| 27 |
PRIVATE void right_mult_with_vector(vtx_data *, int, double *, |
| 28 |
double *); |
| 29 |
PRIVATE void right_mult_with_vector_f(float **, int, double *, |
| 30 |
double *); |
| 31 |
PRIVATE void vectors_subtraction(int, double *, double *, double *); |
| 32 |
PRIVATE void vectors_addition(int, double *, double *, double *); |
| 33 |
PRIVATE void vectors_scalar_mult(int, const double *, double, double *); |
| 34 |
PRIVATE void copy_vector(int n, const double *restrict source, |
| 35 |
double *restrict dest); |
| 36 |
PRIVATE double vectors_inner_product(int n, const double *vector1, |
| 37 |
const double *vector2); |
| 38 |
PRIVATE double max_abs(int n, double *vector); |
| 39 |
|
| 40 |
/* sparse matrix extensions: */ |
| 41 |
|
| 42 |
PRIVATE void right_mult_with_vector_transpose |
| 43 |
(double **, int, int, double *, double *); |
| 44 |
PRIVATE void right_mult_with_vector_d(double *const *, int, int, double *, |
| 45 |
double *); |
| 46 |
PRIVATE void mult_dense_mat(double **, float **, int, int, int, |
| 47 |
float ***C); |
| 48 |
PRIVATE void mult_dense_mat_d(double **, float **, int, int, int, |
| 49 |
double ***CC); |
| 50 |
PRIVATE void mult_sparse_dense_mat_transpose(vtx_data *, double **, int, |
| 51 |
int, float ***); |
| 52 |
PRIVATE bool power_iteration(double *const *, int, int, double **); |
| 53 |
|
| 54 |
/***************************** |
| 55 |
** Single precision (float) ** |
| 56 |
** version ** |
| 57 |
*****************************/ |
| 58 |
|
| 59 |
PRIVATE void orthog1f(int n, float *vec); |
| 60 |
PRIVATE void right_mult_with_vector_ff(float *, int, float *, float *); |
| 61 |
PRIVATE void vectors_subtractionf(int, float *, float *, float *); |
| 62 |
PRIVATE void vectors_additionf(int n, float *vector1, float *vector2, |
| 63 |
float *result); |
| 64 |
PRIVATE void vectors_mult_additionf(int n, float *vector1, float alpha, |
| 65 |
float *vector2); |
| 66 |
PRIVATE void copy_vectorf(int n, float *source, float *dest); |
| 67 |
PRIVATE double vectors_inner_productf(int n, float *vector1, |
| 68 |
float *vector2); |
| 69 |
PRIVATE void set_vector_val(int n, double val, double *result); |
| 70 |
PRIVATE void set_vector_valf(int n, float val, float * result); |
| 71 |
PRIVATE double max_absf(int n, float *vector); |
| 72 |
PRIVATE void square_vec(int n, float *vec); |
| 73 |
PRIVATE void invert_vec(int n, float *vec); |
| 74 |
PRIVATE void sqrt_vecf(int n, float *source, float *target); |
| 75 |
PRIVATE void invert_sqrt_vec(int n, float *vec); |
| 76 |
|
| 77 |
#ifdef __cplusplus |
| 78 |
} |
| 79 |
#endif |