| 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 |
| 55 | extern void right_mult_with_vector_transpose |
| 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 |
| 109 | |