Patterns in static

Apophenia

Macros | Functions
apop_linear_algebra.c File Reference

Macros

#define Checkgsl(...)   if (__VA_ARGS__) {goto done;}
 
#define Check_gsl_with_out(...)   if (__VA_ARGS__) {out->error='m'; goto done;}
 
#define Check_gsl_with_outmp(...)   if (__VA_ARGS__) {gsl_matrix_free(*out); *out=NULL; goto done;}
 
#define Set_gsl_handler   gsl_error_handler_t *prior_handler = gsl_set_error_handler(apop_gsl_error);
 
#define Unset_gsl_handler   gsl_set_error_handler(prior_handler);
 
#define Check_gslv(...)   if (__VA_ARGS__) {gsl_vector_free(out); out=NULL;}
 
#define Dimcheck(lr, lc, rr, rc)
 

Functions

void apop_gsl_error (const char *reason, const char *file, int line, int gsl_errno)
 
double apop_det_and_inv (const gsl_matrix *in, gsl_matrix **out, int calc_det, int calc_inv)
 
gsl_matrix * apop_matrix_inverse (const gsl_matrix *in)
 
double apop_matrix_determinant (const gsl_matrix *in)
 
apop_dataapop_matrix_pca (gsl_matrix *data, int const dimensions_we_want)
 
void apop_vector_log10 (gsl_vector *v)
 
void apop_vector_log (gsl_vector *v)
 
void apop_vector_exp (gsl_vector *v)
 
gsl_vector * apop_vector_stack (gsl_vector *v1, gsl_vector *v2, char inplace)
 
gsl_matrix * apop_matrix_stack (gsl_matrix *m1, gsl_matrix *m2, char posn, char inplace)
 
gsl_matrix * apop_matrix_rm_columns (gsl_matrix *in, int *drop)
 
int apop_vector_bounded (const gsl_vector *in, long double max)
 
apop_dataapop_dot (const apop_data *d1, const apop_data *d2, char form1, char form2)
 

Detailed Description

Assorted things to do with matrices, such as take determinants or do singular value decompositions. Includes many convenience functions that don't actually do math but add/delete columns, check bounds, et cetera.

Macro Definition Documentation

#define Dimcheck (   lr,
  lc,
  rr,
  rc 
)
Value:
Apop_stopif((lc)!=(rr), out->error='d'; goto done,\
0, "mismatched dimensions: %zuX%zu dot %zuX%zu. %s", (lr), (lc), (rr), (rc),\
((lr)==(rr)) ? " Maybe transpose the first?" \
: ((rc)==(lc)) ? " Maybe transpose the second?" : "");
#define Apop_stopif(test, onfail, level,...)
Definition: apop.h:1004

Function Documentation

gsl_matrix* apop_matrix_rm_columns ( gsl_matrix *  in,
int *  drop 
)

Delete columns from a matrix.

This is done via copying, so if you have an exceptionally large data set, you're better off producing the matrix in the perfect form directly.

Parameters
inthe gsl_matrix to be subsetted
Returns
a gsl_matrix with the specified columns removed. If you ask me to remove no columns, I'll return a copy of the original. If you ask me to remove all columns, I'll return NULL.
Parameters
dropan array of ints. If use[7]==1, then column seven will be cut from the output.

Autogenerated by doxygen on Sun Oct 26 2014 (Debian 0.999b+ds3-2).