Functions
utils.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <unistd.h>
#include <float.h>
#include <limits.h>
#include "utils.h"
Include dependency graph for utils.c:

Go to the source code of this file.

Functions

int alphanum_to_int (char c)
char * basecfg (char *cfgfile)
float constrain (float min, float max, float a)
int constrain_int (int a, int min, int max)
char * copy_string (char *s)
int count_fields (char *line)
void del_arg (int argc, char **argv, int index)
float dist_array (float *a, float *b, int n, int sub)
void error (const char *s)
char * fgetl (FILE *fp)
void file_error (char *s)
int find_arg (int argc, char *argv[], char *arg)
char * find_char_arg (int argc, char **argv, char *arg, char *def)
float find_float_arg (int argc, char **argv, char *arg, float def)
int find_int_arg (int argc, char **argv, char *arg, int def)
void find_replace (char *str, char *orig, char *rep, char *output)
void free_ptrs (void **ptrs, int n)
char int_to_alphanum (int i)
float mag_array (float *a, int n)
void malloc_error ()
int max_index (float *a, int n)
float mean_array (float *a, int n)
void mean_arrays (float **a, int n, int els, float *avg)
float mse_array (float *a, int n)
void normalize_array (float *a, int n)
float ** one_hot_encode (float *a, int n, int k)
listparse_csv_line (char *line)
float * parse_fields (char *line, int n)
void pm (int M, int N, float *A)
void print_statistics (float *a, int n)
int rand_int (int min, int max)
float rand_normal ()
float rand_scale (float s)
size_t rand_size_t ()
float rand_uniform (float min, float max)
void read_all (int fd, char *buffer, size_t bytes)
int read_all_fail (int fd, char *buffer, size_t bytes)
int read_int (int fd)
int * read_map (char *filename)
int sample_array (float *a, int n)
void scale_array (float *a, int n, float s)
float sec (clock_t clocks)
void shuffle (void *arr, size_t n, size_t size)
void sorta_shuffle (void *arr, size_t n, size_t size, size_t sections)
listsplit_str (char *s, char delim)
void strip (char *s)
void strip_char (char *s, char bad)
float sum_array (float *a, int n)
void top_k (float *a, int n, int k, int *index)
void translate_array (float *a, int n, float s)
float variance_array (float *a, int n)
void write_all (int fd, char *buffer, size_t bytes)
int write_all_fail (int fd, char *buffer, size_t bytes)
void write_int (int fd, int n)

Function Documentation

int alphanum_to_int ( char  c)

Definition at line 130 of file utils.c.

char* basecfg ( char *  cfgfile)

Definition at line 116 of file utils.c.

float constrain ( float  min,
float  max,
float  a 
)

Definition at line 453 of file utils.c.

int constrain_int ( int  a,
int  min,
int  max 
)

Definition at line 446 of file utils.c.

char* copy_string ( char *  s)

Definition at line 345 of file utils.c.

int count_fields ( char *  line)

Definition at line 369 of file utils.c.

void del_arg ( int  argc,
char **  argv,
int  index 
)

Definition at line 50 of file utils.c.

float dist_array ( float *  a,
float *  b,
int  n,
int  sub 
)

Definition at line 460 of file utils.c.

void error ( const char *  s)

Definition at line 190 of file utils.c.

char* fgetl ( FILE *  fp)

Definition at line 257 of file utils.c.

void file_error ( char *  s)

Definition at line 203 of file utils.c.

int find_arg ( int  argc,
char *  argv[],
char *  arg 
)

Definition at line 57 of file utils.c.

char* find_char_arg ( int  argc,
char **  argv,
char *  arg,
char *  def 
)

Definition at line 100 of file utils.c.

float find_float_arg ( int  argc,
char **  argv,
char *  arg,
float  def 
)

Definition at line 85 of file utils.c.

int find_int_arg ( int  argc,
char **  argv,
char *  arg,
int  def 
)

Definition at line 70 of file utils.c.

void find_replace ( char *  str,
char *  orig,
char *  rep,
char *  output 
)

Definition at line 153 of file utils.c.

void free_ptrs ( void **  ptrs,
int  n 
)

Definition at line 250 of file utils.c.

char int_to_alphanum ( int  i)

Definition at line 134 of file utils.c.

float mag_array ( float *  a,
int  n 
)

Definition at line 496 of file utils.c.

void malloc_error ( )

Definition at line 197 of file utils.c.

int max_index ( float *  a,
int  n 
)

Definition at line 527 of file utils.c.

float mean_array ( float *  a,
int  n 
)

Definition at line 409 of file utils.c.

void mean_arrays ( float **  a,
int  n,
int  els,
float *  avg 
)

Definition at line 414 of file utils.c.

float mse_array ( float *  a,
int  n 
)

Definition at line 468 of file utils.c.

void normalize_array ( float *  a,
int  n 
)

Definition at line 476 of file utils.c.

float** one_hot_encode ( float *  a,
int  n,
int  k 
)

Definition at line 614 of file utils.c.

list* parse_csv_line ( char *  line)

Definition at line 352 of file utils.c.

float* parse_fields ( char *  line,
int  n 
)

Definition at line 381 of file utils.c.

void pm ( int  M,
int  N,
float *  A 
)

Definition at line 140 of file utils.c.

void print_statistics ( float *  a,
int  n 
)

Definition at line 429 of file utils.c.

int rand_int ( int  min,
int  max 
)

Definition at line 541 of file utils.c.

float rand_normal ( )

Definition at line 553 of file utils.c.

float rand_scale ( float  s)

Definition at line 607 of file utils.c.

size_t rand_size_t ( )

Definition at line 585 of file utils.c.

float rand_uniform ( float  min,
float  max 
)

Definition at line 597 of file utils.c.

void read_all ( int  fd,
char *  buffer,
size_t  bytes 
)

Definition at line 324 of file utils.c.

int read_all_fail ( int  fd,
char *  buffer,
size_t  bytes 
)

Definition at line 302 of file utils.c.

int read_int ( int  fd)

Definition at line 288 of file utils.c.

int* read_map ( char *  filename)

Definition at line 12 of file utils.c.

int sample_array ( float *  a,
int  n 
)

Definition at line 514 of file utils.c.

void scale_array ( float *  a,
int  n,
float  s 
)

Definition at line 506 of file utils.c.

float sec ( clock_t  clocks)

Definition at line 169 of file utils.c.

void shuffle ( void *  arr,
size_t  n,
size_t  size 
)

Definition at line 38 of file utils.c.

void sorta_shuffle ( void *  arr,
size_t  n,
size_t  size,
size_t  sections 
)

Definition at line 27 of file utils.c.

list* split_str ( char *  s,
char  delim 
)

Definition at line 209 of file utils.c.

void strip ( char *  s)

Definition at line 224 of file utils.c.

void strip_char ( char *  s,
char  bad 
)

Definition at line 237 of file utils.c.

float sum_array ( float *  a,
int  n 
)

Definition at line 401 of file utils.c.

void top_k ( float *  a,
int  n,
int  k,
int *  index 
)

Definition at line 174 of file utils.c.

void translate_array ( float *  a,
int  n,
float  s 
)

Definition at line 488 of file utils.c.

float variance_array ( float *  a,
int  n 
)

Definition at line 436 of file utils.c.

void write_all ( int  fd,
char *  buffer,
size_t  bytes 
)

Definition at line 334 of file utils.c.

int write_all_fail ( int  fd,
char *  buffer,
size_t  bytes 
)

Definition at line 313 of file utils.c.

void write_int ( int  fd,
int  n 
)

Definition at line 296 of file utils.c.



rail_object_detector
Author(s):
autogenerated on Sat Jun 8 2019 20:26:31