Add import of data from file
The universe can now be created from data in a text file. Added the files_utils who contains methods to open a file, count the number of lines and remove trailing newline. Added methods to create an empty kmeans universe and to initialize empty clusters array and points array. Added a method who create a point from a line in the text file. Fixed a memory leak caused by non freed point value.
Showing
- files_utils.c 46 additions, 0 deletionsfiles_utils.c
- files_utils.h 22 additions, 0 deletionsfiles_utils.h
- kmeans.c 123 additions, 10 deletionskmeans.c
- kmeans.h 10 additions, 0 deletionskmeans.h
- main.c 3 additions, 11 deletionsmain.c
- makefile 3 additions, 1 deletionmakefile
- source_data.txt 7 additions, 0 deletionssource_data.txt
files_utils.c
0 → 100644
files_utils.h
0 → 100644
source_data.txt
0 → 100644
Please register or sign in to comment