diff --git a/ftp/libft/Makefile b/ftp/libft/Makefile index ca318403..daa73493 100644 --- a/ftp/libft/Makefile +++ b/ftp/libft/Makefile @@ -144,7 +144,6 @@ printing/ft_putendl.c\ printing/ft_putnbr.c\ printing/ft_putstr.c\ printing/hexdump.c\ -rs/rs.c\ sstr/ft_sstradd.c\ sstr/ft_sstrcat.c\ sstr/ft_sstrdel.c\ diff --git a/ftp/libft/includes/libft.h b/ftp/libft/includes/libft.h index 1b4b5402..5bf96e9f 100644 --- a/ftp/libft/includes/libft.h +++ b/ftp/libft/includes/libft.h @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/07 13:49:04 by jhalford #+# #+# */ -/* Updated: 2017/10/07 18:07:31 by jhalford ### ########.fr */ +/* Updated: 2017/11/20 12:41:50 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,7 +26,6 @@ # include "error.h" # include "color.h" # include "cliopts.h" -# include "rs.h" # include "lst.h" # include "dlst.h" diff --git a/ftp/libft/includes/rs.h b/ftp/libft/includes/rs.h deleted file mode 100644 index 279ba4e8..00000000 --- a/ftp/libft/includes/rs.h +++ /dev/null @@ -1,34 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* rs.h :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2017/10/07 18:05:30 by jhalford #+# #+# */ -/* Updated: 2017/10/07 18:18:16 by jhalford ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#ifndef LIBFT_RS_H -# define LIBFT_RS_H - -# include -# include -# include - -extern struct s_stats { - int count; - double min; - double max; - double avg; - double m; - double stdev; - double var; -} g_rs; - -void rs_clear(); -void rs_push(double n); -void rs_calcmore(); - -#endif diff --git a/ftp/libft/srcs/rs/rs.c b/ftp/libft/srcs/rs/rs.c deleted file mode 100644 index 7e83bdff..00000000 --- a/ftp/libft/srcs/rs/rs.c +++ /dev/null @@ -1,62 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* rs.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: jhalford +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2017/10/07 17:57:54 by jhalford #+# #+# */ -/* Updated: 2017/10/07 18:19:47 by jhalford ### ########.fr */ -/* */ -/* ************************************************************************** */ - -#include "libft.h" -#include - -struct s_stats g_rs = {0, 0, 0, 0, 0, 0, 0}; - -double sqrt(double x); - -void rs_clear(void) -{ - g_rs.count = 0; - g_rs.min = DBL_MAX; - g_rs.max = -DBL_MAX; -} - -void rs_push(double n) -{ - double delta; - - g_rs.count++; - n < g_rs.min ? g_rs.min = n : (0); - n > g_rs.max ? g_rs.max = n : (0); - if (g_rs.count == 1) - { - g_rs.avg = n; - g_rs.m = 0; - } - else - { - delta = n - g_rs.avg; - g_rs.avg += delta / g_rs.count; - g_rs.m += delta * (n - g_rs.avg); - } -} - -void rs_calcmore(void) -{ - if (g_rs.count == 0) - { - g_rs.min = 0; - g_rs.max = 0; - } - if (g_rs.count < 2) - { - g_rs.var = 0; - g_rs.stdev = 0; - return ; - } - g_rs.var = g_rs.m / (g_rs.count - 1); - g_rs.stdev = sqrt(g_rs.var); -}