Patterns in static

Apophenia

conversions.h

Go to the documentation of this file.
00001 
00006 /*   Copyright (c) 2005--2009 by Ben Klemens.  Licensed under the modified GNU GPL v2; see COPYING and COPYING2.  */
00007 
00008 #ifndef APOP_CONVERSIONS_H
00009 #define APOP_CONVERSIONS_H
00010 
00011 #include "db.h"
00012 #include "variadic.h"
00013 #include <regex.h>
00014 #include <string.h>
00015 #include <stdarg.h>
00016 #include <gsl/gsl_matrix.h>
00017 
00018 #ifdef    __cplusplus
00019 extern "C" {
00020 #endif
00021 
00022 //From vector
00023 gsl_vector *apop_vector_copy(const gsl_vector *in);
00024 double * apop_vector_to_array(const gsl_vector *in);
00025 #ifdef APOP_NO_VARIADIC
00026  gsl_matrix * apop_vector_to_matrix(const gsl_vector *in, char row_col);
00027 #else
00028  gsl_matrix * apop_vector_to_matrix_base(const gsl_vector *in, char row_col);
00029  apop_varad_declare(gsl_matrix *, apop_vector_to_matrix, const gsl_vector *in; char row_col);
00030 #define apop_vector_to_matrix(...) apop_varad_link(apop_vector_to_matrix, __VA_ARGS__)
00031 #endif
00032 
00033 //From matrix
00034 gsl_matrix *apop_matrix_copy(const gsl_matrix *in);
00035 apop_data  *apop_db_to_crosstab(char *tabname, char *r1, char *r2, char *datacol);
00036 
00037 //From array
00038 #ifdef APOP_NO_VARIADIC
00039  gsl_vector * apop_array_to_vector(double *in, int size);
00040 #else
00041  gsl_vector * apop_array_to_vector_base(double *in, int size);
00042  apop_varad_declare(gsl_vector *, apop_array_to_vector, double *in; int size);
00043 #define apop_array_to_vector(...) apop_varad_link(apop_array_to_vector, __VA_ARGS__)
00044 #endif
00045 #define apop_line_to_vector apop_array_to_vector
00046 gsl_matrix * apop_array_to_matrix(const double **in, const int rows, const int cols);
00047 apop_data * apop_array_to_data(const double **in, const int rows, const int cols);
00048 
00049 //From line
00050 gsl_matrix * apop_line_to_matrix(double *line, int rows, int cols);
00051 apop_data * apop_line_to_data(double *in, int vsize, int rows, int cols);
00052 
00053 //From text
00054 #ifdef APOP_NO_VARIADIC
00055  apop_data * apop_text_to_data(char *text_file, int has_row_names, int has_col_names);
00056 #else
00057  apop_data * apop_text_to_data_base(char *text_file, int has_row_names, int has_col_names);
00058  apop_varad_declare(apop_data *, apop_text_to_data, char *text_file; int has_row_names; int has_col_names);
00059 #define apop_text_to_data(...) apop_varad_link(apop_text_to_data, __VA_ARGS__)
00060 #endif
00061 #ifdef APOP_NO_VARIADIC
00062  int apop_text_to_db(char *text_file, char *tabname, int has_row_names, int has_col_names, char **field_names);
00063 #else
00064  int apop_text_to_db_base(char *text_file, char *tabname, int has_row_names, int has_col_names, char **field_names);
00065  apop_varad_declare(int, apop_text_to_db, char *text_file; char *tabname; int has_row_names; int has_col_names; char **field_names);
00066 #define apop_text_to_db(...) apop_varad_link(apop_text_to_db, __VA_ARGS__)
00067 #endif
00068 
00069 //From crosstabs
00070 void apop_crosstab_to_db(apop_data *in, char *tabname, char *row_col_name, 
00071                               char *col_col_name, char *data_col_name);
00072 
00073 //packing data into a vector
00074 #ifdef APOP_NO_VARIADIC
00075  gsl_vector * apop_data_pack(const apop_data *in, gsl_vector *out);
00076 #else
00077  gsl_vector * apop_data_pack_base(const apop_data *in, gsl_vector *out);
00078  apop_varad_declare(gsl_vector *, apop_data_pack, const apop_data *in; gsl_vector *out);
00079 #define apop_data_pack(...) apop_varad_link(apop_data_pack, __VA_ARGS__)
00080 #endif
00081 void apop_data_unpack(const gsl_vector *in, apop_data *d);
00082 
00083 char * apop_strip_dots(char *in, char strip_type);
00084 
00085 #define apop_vector_fill(in, ...) apop_vector_fill_base((in), (double []) {__VA_ARGS__})
00086 #define apop_data_fill(in, ...) apop_data_fill_base((in), (double []) {__VA_ARGS__})
00087 #define apop_matrix_fill(in, ...) apop_matrix_fill_base((in), (double []) {__VA_ARGS__})
00088 apop_data *apop_data_fill_base(apop_data *in, double []);
00089 gsl_vector *apop_vector_fill_base(gsl_vector *in, double []);
00090 gsl_matrix *apop_matrix_fill_base(gsl_matrix *in, double []);
00091 
00092 #ifdef    __cplusplus
00093 }
00094 #endif
00095 #endif

SourceForge.net Logo

Autogenerated by doxygen on 28 Sep 2009.