Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bbguimaraes
books
Commits
e8d576de
Commit
e8d576de
authored
Aug 15, 2014
by
bbguimaraes
Browse files
21st_century_c: eleventh chapter
Corretions.
parent
8f227f95
Changes
2
Hide whitespace changes
Inline
Side-by-side
21st_century_c/11/Makefile
View file @
e8d576de
...
...
@@ -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
}
21st_century_c/11/groups.w
View file @
e8d576de
...
...
@@ -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
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment