Graphviz  2.29.20120524.0446
lib/neatogen/matrix_ops.h
Go to the documentation of this file.
00001 /* $Id$ $Revision$ */
00002 /* vim:set shiftwidth=4 ts=8: */
00003 
00004 /*************************************************************************
00005  * Copyright (c) 2011 AT&T Intellectual Property 
00006  * All rights reserved. This program and the accompanying materials
00007  * are made available under the terms of the Eclipse Public License v1.0
00008  * which accompanies this distribution, and is available at
00009  * http://www.eclipse.org/legal/epl-v10.html
00010  *
00011  * Contributors: See CVS logs. Details at http://www.graphviz.org/
00012  *************************************************************************/
00013 
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017 
00018 
00019 
00020 #ifndef _MATRIX_OPS_H_
00021 #define _MATRIX_OPS_H_
00022 
00023 #include "sparsegraph.h"
00024 
00025     extern void cpvec(double *, int, int, double *);
00026     extern double dot(double *, int, int, double *);
00027     extern void scadd(double *, int, int, double, double *);
00028     extern void vecscale(double *, int, int, double, double *);
00029     extern double norm(double *, int, int);
00030 
00031     extern void orthog1(int n, double *vec);
00032     extern void init_vec_orth1(int n, double *vec);
00033     extern void right_mult_with_vector(vtx_data *, int, double *,
00034                                        double *);
00035     extern void right_mult_with_vector_f(float **, int, double *,
00036                                          double *);
00037     extern void vectors_subtraction(int, double *, double *, double *);
00038     extern void vectors_addition(int, double *, double *, double *);
00039     extern void vectors_scalar_mult(int, double *, double, double *);
00040     extern void copy_vector(int n, double *source, double *dest);
00041     extern double vectors_inner_product(int n, double *vector1,
00042                                         double *vector2);
00043     extern double max_abs(int n, double *vector);
00044 #ifdef UNUSED
00045     extern void vectors_mult_addition(int, double *, double, double *);
00046     extern void orthogvec(int, double *, double *);
00047 #endif
00048 
00049     /* sparse matrix extensions: */
00050 
00051 #ifdef UNUSED
00052     extern void mat_mult_vec(vtx_data * L, int n, double *vec,
00053                              double *result);
00054 #endif
00055     extern void right_mult_with_vector_transpose
00056         (double **, int, int, double *, double *);
00057     extern void right_mult_with_vector_d(double **, int, int, double *,
00058                                          double *);
00059     extern void mult_dense_mat(double **, float **, int, int, int,
00060                                float ***C);
00061     extern void mult_dense_mat_d(double **, float **, int, int, int,
00062                                  double ***CC);
00063     extern void mult_sparse_dense_mat_transpose(vtx_data *, double **, int,
00064                                                 int, float ***);
00065     extern int power_iteration(double **, int, int, double **, double *, int);
00066 
00067 
00068 /*****************************
00069 ** Single precision (float) **
00070 ** version                  **
00071 *****************************/
00072 
00073     extern void orthog1f(int n, float *vec);
00074 #ifdef UNUSED
00075     extern void right_mult_with_vectorf(vtx_data *, int, float *, float *);
00076     extern void right_mult_with_vector_fd(float **, int, float *,
00077                                           double *);
00078 #endif
00079     extern void right_mult_with_vector_ff(float *, int, float *, float *);
00080     extern void vectors_substractionf(int, float *, float *, float *);
00081     extern void vectors_additionf(int n, float *vector1, float *vector2,
00082                                   float *result);
00083     extern void vectors_mult_additionf(int n, float *vector1, float alpha,
00084                                        float *vector2);
00085     extern void vectors_scalar_multf(int n, float *vector, float alpha,
00086                                      float *result);
00087     extern void copy_vectorf(int n, float *source, float *dest);
00088     extern double vectors_inner_productf(int n, float *vector1,
00089                                          float *vector2);
00090     extern void set_vector_val(int n, double val, double *result);
00091     extern void set_vector_valf(int n, float val, float * result);
00092     extern double max_absf(int n, float *vector);
00093     extern void square_vec(int n, float *vec);
00094     extern void invert_vec(int n, float *vec);
00095     extern void sqrt_vec(int n, float *vec);
00096     extern void sqrt_vecf(int n, float *source, float *target);
00097     extern void invert_sqrt_vec(int n, float *vec);
00098 #ifdef UNUSED
00099     extern void init_vec_orth1f(int n, float *vec);
00100     extern void mat_mult_vecf(vtx_data * L, int n, float *vec,
00101                               float *result);
00102 #endif
00103 
00104 #endif
00105 
00106 #ifdef __cplusplus
00107 }
00108 #endif