Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hqr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
solverstack
hqr
Commits
c05aef89
Commit
c05aef89
authored
5 years ago
by
Mathieu Faverge
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the code fro fibonacci 1p
parent
cd9e458f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/high_fibonacci.c
+13
-39
13 additions, 39 deletions
src/high_fibonacci.c
with
13 additions
and
39 deletions
src/high_fibonacci.c
+
13
−
39
View file @
c05aef89
...
...
@@ -122,52 +122,26 @@ void hqr_high_greedy1p_init(hqr_subpiv_t *arg){
ipiv
=
arg
->
ipiv
;
{
int
minMN
=
1
;
int
j
,
k
,
height
,
start
,
end
,
firstk
=
0
;
int
*
nT
=
(
int
*
)
calloc
(
minMN
,
sizeof
(
int
));
int
*
nZ
=
(
int
*
)
calloc
(
minMN
,
sizeof
(
int
));
nT
[
0
]
=
mt
;
nZ
[
0
]
=
libhqr_imax
(
mt
-
p
,
0
);
for
(
k
=
1
;
k
<
minMN
;
k
++
)
{
height
=
libhqr_imax
(
mt
-
k
-
p
,
0
);
nT
[
k
]
=
height
;
nZ
[
k
]
=
height
;
}
k
=
0
;
while
(
(
!
(
(
nT
[
minMN
-
1
]
==
mt
-
(
minMN
-
1
)
)
&&
(
nZ
[
minMN
-
1
]
+
1
==
nT
[
minMN
-
1
]
)
)
)
&&
(
firstk
<
minMN
)
)
{
height
=
(
nT
[
k
]
-
nZ
[
k
])
/
2
;
int
j
,
height
,
start
,
end
;
int
nT
,
nZ
;
nT
=
mt
;
nZ
=
libhqr_imax
(
mt
-
p
,
0
);
while
(
!
(
(
nT
==
mt
)
&&
(
nT
==
nZ
+
1
)
)
)
{
height
=
(
nT
-
nZ
)
/
2
;
if
(
height
==
0
)
{
while
(
(
firstk
<
minMN
)
&&
(
nT
[
firstk
]
==
mt
-
firstk
)
&&
(
nZ
[
firstk
]
+
1
==
nT
[
firstk
]
)
)
{
firstk
++
;
}
k
=
firstk
;
continue
;
break
;
}
start
=
mt
-
nZ
[
k
]
-
1
;
start
=
mt
-
nZ
-
1
;
end
=
start
-
height
;
nZ
[
k
]
+=
height
;
if
(
k
<
minMN
-
1
)
{
nT
[
k
+
1
]
=
nZ
[
k
];
}
nZ
+=
height
;
for
(
j
=
start
;
j
>
end
;
j
--
)
{
ipiv
[
k
*
p
+
j
-
k
]
=
(
j
-
height
);
}
k
++
;
if
(
k
>
minMN
-
1
)
{
k
=
firstk
;
ipiv
[
j
]
=
(
j
-
height
);
}
}
free
(
nT
);
free
(
nZ
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment