Graphviz  2.41.20171026.1811
matrix_ops.h
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 
19 
20 #ifndef _MATRIX_OPS_H_
21 #define _MATRIX_OPS_H_
22 
23 #include "sparsegraph.h"
24 
25  extern void cpvec(double *, int, int, double *);
26  extern double dot(double *, int, int, double *);
27  extern void scadd(double *, int, int, double, double *);
28  extern void vecscale(double *, int, int, double, double *);
29  extern double norm(double *, int, int);
30 
31  extern void orthog1(int n, double *vec);
32  extern void init_vec_orth1(int n, double *vec);
33  extern void right_mult_with_vector(vtx_data *, int, double *,
34  double *);
35  extern void right_mult_with_vector_f(float **, int, double *,
36  double *);
37  extern void vectors_subtraction(int, double *, double *, double *);
38  extern void vectors_addition(int, double *, double *, double *);
39  extern void vectors_scalar_mult(int, double *, double, double *);
40  extern void copy_vector(int n, double *source, double *dest);
41  extern double vectors_inner_product(int n, double *vector1,
42  double *vector2);
43  extern double max_abs(int n, double *vector);
44 #ifdef UNUSED
45  extern void vectors_mult_addition(int, double *, double, double *);
46  extern void orthogvec(int, double *, double *);
47 #endif
48 
49  /* sparse matrix extensions: */
50 
51 #ifdef UNUSED
52  extern void mat_mult_vec(vtx_data * L, int n, double *vec,
53  double *result);
54 #endif
56  (double **, int, int, double *, double *);
57  extern void right_mult_with_vector_d(double **, int, int, double *,
58  double *);
59  extern void mult_dense_mat(double **, float **, int, int, int,
60  float ***C);
61  extern void mult_dense_mat_d(double **, float **, int, int, int,
62  double ***CC);
63  extern void mult_sparse_dense_mat_transpose(vtx_data *, double **, int,
64  int, float ***);
65  extern int power_iteration(double **, int, int, double **, double *, int);
66 
67 
68 /*****************************
69 ** Single precision (float) **
70 ** version **
71 *****************************/
72 
73  extern void orthog1f(int n, float *vec);
74 #ifdef UNUSED
75  extern void right_mult_with_vectorf(vtx_data *, int, float *, float *);
76  extern void right_mult_with_vector_fd(float **, int, float *,
77  double *);
78 #endif
79  extern void right_mult_with_vector_ff(float *, int, float *, float *);
80  extern void vectors_substractionf(int, float *, float *, float *);
81  extern void vectors_additionf(int n, float *vector1, float *vector2,
82  float *result);
83  extern void vectors_mult_additionf(int n, float *vector1, float alpha,
84  float *vector2);
85  extern void vectors_scalar_multf(int n, float *vector, float alpha,
86  float *result);
87  extern void copy_vectorf(int n, float *source, float *dest);
88  extern double vectors_inner_productf(int n, float *vector1,
89  float *vector2);
90  extern void set_vector_val(int n, double val, double *result);
91  extern void set_vector_valf(int n, float val, float * result);
92  extern double max_absf(int n, float *vector);
93  extern void square_vec(int n, float *vec);
94  extern void invert_vec(int n, float *vec);
95  extern void sqrt_vec(int n, float *vec);
96  extern void sqrt_vecf(int n, float *source, float *target);
97  extern void invert_sqrt_vec(int n, float *vec);
98 #ifdef UNUSED
99  extern void init_vec_orth1f(int n, float *vec);
100  extern void mat_mult_vecf(vtx_data * L, int n, float *vec,
101  float *result);
102 #endif
103 
104 #endif
105 
106 #ifdef __cplusplus
107 }
108 #endif
void vectors_additionf(int n, float *vector1, float *vector2, float *result)
Definition: matrix_ops.c:629
void invert_sqrt_vec(int n, float *vec)
Definition: matrix_ops.c:752
void sqrt_vec(int n, float *vec)
Definition: matrix_ops.c:725
void orthog1(int n, double *vec)
Definition: matrix_ops.c:319
void vecscale(double *vec1, int beg, int end, double alpha, double *vec2)
Definition: matrix_ops.c:298
void invert_vec(int n, float *vec)
Definition: matrix_ops.c:714
void set_vector_val(int n, double val, double *result)
Definition: matrix_ops.c:677
int power_iteration(double **square_mat, int n, int neigs, double **eigs, double *evals, int initialize)
Definition: matrix_ops.c:24
void copy_vectorf(int n, float *source, float *dest)
Definition: matrix_ops.c:657
void cpvec(double *copy, int beg, int end, double *vec)
Definition: matrix_ops.c:258
void set_vector_valf(int n, float val, float *result)
Definition: matrix_ops.c:685
#define C
Definition: pack.c:29
void vectors_addition(int n, double *vector1, double *vector2, double *result)
Definition: matrix_ops.c:399
void copy_vector(int n, double *source, double *dest)
Definition: matrix_ops.c:431
void mult_dense_mat(double **A, float **B, int dim1, int dim2, int dim3, float ***CC)
Definition: matrix_ops.c:142
void right_mult_with_vector_transpose(double **matrix, int dim1, int dim2, double *vector, double *result)
Definition: matrix_ops.c:503
void square_vec(int n, float *vec)
Definition: matrix_ops.c:705
double max_absf(int n, float *vector)
Definition: matrix_ops.c:693
void vectors_mult_additionf(int n, float *vector1, float alpha, float *vector2)
Definition: matrix_ops.c:639
void right_mult_with_vector_f(float **matrix, int n, double *vector, double *result)
Definition: matrix_ops.c:371
void vectors_scalar_multf(int n, float *vector, float alpha, float *result)
Definition: matrix_ops.c:648
#define dot(v, w)
Definition: geom.c:400
double vectors_inner_productf(int n, float *vector1, float *vector2)
Definition: matrix_ops.c:665
void mult_sparse_dense_mat_transpose(vtx_data *A, double **B, int dim1, int dim2, float ***CC)
Definition: matrix_ops.c:214
void sqrt_vecf(int n, float *source, float *target)
Definition: matrix_ops.c:737
void mult_dense_mat_d(double **A, float **B, int dim1, int dim2, int dim3, double ***CC)
Definition: matrix_ops.c:178
double vectors_inner_product(int n, double *vector1, double *vector2)
Definition: matrix_ops.c:439
void init_vec_orth1(int n, double *vec)
Definition: matrix_ops.c:341
double max_abs(int n, double *vector)
Definition: matrix_ops.c:451
#define alpha
Definition: shapes.c:3902
void orthog1f(int n, float *vec)
Definition: matrix_ops.c:544
void vectors_substractionf(int n, float *vector1, float *vector2, float *result)
Definition: matrix_ops.c:619
double norm(double *vec, int beg, int end)
Definition: matrix_ops.c:310
void vectors_subtraction(int n, double *vector1, double *vector2, double *result)
Definition: matrix_ops.c:388
void right_mult_with_vector_ff(float *packed_matrix, int n, float *vector, float *result)
Definition: matrix_ops.c:594
void scadd(double *vec1, int beg, int end, double fac, double *vec2)
Definition: matrix_ops.c:286
void vectors_scalar_mult(int n, double *vector, double alpha, double *result)
Definition: matrix_ops.c:422
void right_mult_with_vector_d(double **matrix, int dim1, int dim2, double *vector, double *result)
Definition: matrix_ops.c:521
void right_mult_with_vector(vtx_data *matrix, int n, double *vector, double *result)
Definition: matrix_ops.c:354