Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
GNOME
GIMP
Commits
37307dcb
Commit
37307dcb
authored
Aug 07, 2005
by
Sven Neumann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more micro optimizations
parent
f4893406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
18 deletions
+17
-18
app/base/siox.c
app/base/siox.c
+17
-18
No files found.
app/base/siox.c
View file @
37307dcb
...
...
@@ -324,8 +324,8 @@ stagetwo (lab *points,
{
gint
curdim
=
depth
%
dims
;
gfloat
min
,
max
;
gint
i
,
countsm
,
countgr
,
smallc
,
bigc
;
gfloat
pivotvalue
,
curval
;
gint
i
,
countsm
,
countgr
,
smallc
,
bigc
;
gint
sum
;
lab
*
point
;
lab
*
smallerpoints
;
...
...
@@ -405,9 +405,7 @@ stagetwo (lab *points,
sum
=
0
;
for
(
i
=
0
;
i
<
length
;
i
++
)
{
sum
+=
points
[
i
].
cardinality
;
}
sum
+=
points
[
i
].
cardinality
;
if
(((
sum
*
100
.
0
)
/
total
)
>=
threshold
)
{
...
...
@@ -462,14 +460,13 @@ create_signature (lab *input,
const
gfloat
*
limits
,
gint
*
returnlength
)
{
ArrayList
*
clusters1
;
ArrayList
*
clusters2
;
ArrayList
*
clusters
;
ArrayList
*
curelem
;
lab
*
centroids
;
lab
*
cluster
;
lab
*
rval
;
gint
k
,
i
;
gint
clusters1
size
;
gint
size
;
if
(
length
<
1
)
{
...
...
@@ -477,12 +474,12 @@ create_signature (lab *input,
return
NULL
;
}
clusters
1
=
list_new
();
clusters
=
list_new
();
stageone
(
input
,
SIOX_DIMS
,
0
,
clusters
1
,
limits
,
length
);
clusters1
size
=
list_size
(
clusters
1
);
centroids
=
g_new
(
lab
,
clusters1
size
);
curelem
=
clusters
1
;
stageone
(
input
,
SIOX_DIMS
,
0
,
clusters
,
limits
,
length
);
size
=
list_size
(
clusters
);
centroids
=
g_new
(
lab
,
size
);
curelem
=
clusters
;
i
=
0
;
while
(
curelem
->
array
)
...
...
@@ -503,6 +500,7 @@ create_signature (lab *input,
centroids
[
i
].
l
=
l
/
curelem
->
arraylength
;
centroids
[
i
].
a
=
a
/
curelem
->
arraylength
;
centroids
[
i
].
b
=
b
/
curelem
->
arraylength
;
centroids
[
i
].
cardinality
=
curelem
->
arraylength
;
i
++
;
...
...
@@ -510,19 +508,20 @@ create_signature (lab *input,
}
#ifdef DEBUG
g_printerr
(
"step #1 -> %d clusters
\n
"
,
clusters1
size
);
g_printerr
(
"step #1 -> %d clusters
\n
"
,
size
);
#endif
clusters2
=
list_new
();
free_list
(
clusters
);
clusters
=
list_new
();
stagetwo
(
centroids
,
SIOX_DIMS
,
0
,
clusters
2
,
limits
,
clusters1
size
,
length
,
SIOX_DIMS
,
0
,
clusters
,
limits
,
size
,
length
,
0
.
1
/* magic constant, see paper by tomasi */
);
rval
=
list_to_array
(
clusters
2
,
returnlength
);
rval
=
list_to_array
(
clusters
,
returnlength
);
free_list
(
clusters2
);
free_list
(
clusters1
);
free_list
(
clusters
);
#ifdef DEBUG
g_printerr
(
"step #2 -> %d clusters
\n
"
,
returnlength
[
0
]);
...
...
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