Commit e8d576de authored by bbguimaraes's avatar bbguimaraes
Browse files

21st_century_c: eleventh chapter

Corretions.
parent 8f227f95
......@@ -2,7 +2,9 @@ CFLAGS = `pkg-config --cflags gsl` `pkg-config --cflags glib-2.0` -I../9
CFLAGS += -Wall -g -std=c11 -fms-extensions
LDLIBS = `pkg-config --libs gsl` `pkg-config --libs glib-2.0`
OBJECTS = dict.a simple_cplx seamlessone seamlesstwo dict_use cetology groupabm
OBJECTS = \
dict.a simple_cplx seamlessone seamlesstwo dict_use cetology \
groupabm groupabm.pdf groups.pdf
all: $(OBJECTS)
dict.a: keyval.o dict.o
......@@ -18,10 +20,16 @@ moby:
cetology: fstr.o ../9/string_utilities.o
../9/string_utilities.o:
make -C ../9/string_utilities.o
make -C ../9 string_utilities.o
groupabm: groupabm.c groups.o apop.c
groupabm.pdf: groupabm.tex
pdftex $^
groups.pdf: groups.tex
pdftex $^
test: moby
./simple_cplx
./seamlessone
......@@ -32,4 +40,6 @@ test: moby
clean:
rm -f \
$(OBJECTS) keyval.o dict.o complex.o fstr.o moby \
../9/string_utilities.o groupabm.c groups.c groups.o
../9/string_utilities.o \
groupabm{,.c,.idx,.log,.pdf,.scn,.tex,.toc} \
groups{.c,.idx,.log,.o,.pdf,.scn,.tex,.toc}
......@@ -67,8 +67,8 @@ void group_exit(group_s * leaveme, gsl_vector * position) {
distance to the groups. In the end, I wound up using the $L_3$ norm. The
standard distance is the $L_2$ norm, aka Euclidean distance, meaning that the
distance between $(x_1, y_1)$ and $(x_2, y_2)$ is
$\sqrt{(x_1-x_2)^2+(y_1-y_2^2}$. This is $L_3$,
${\sqrt[3]{(x_1-x_2)^3+(y_1-y_2)^3}$. This and the call to |apop_copy| above are
$\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$. This is $L_3$,
$\sqrt[3]{(x_1-x_2)^3+(y_1-y_2)^3}$. This and the call to |apop_copy| above are
the only calls to the Apophenia library; you could write around them if you
don't have that library on hand.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment