Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nifty_gridder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ift
nifty_gridder
Commits
c6b28459
Commit
c6b28459
authored
Oct 09, 2019
by
Martin Reinecke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove another over-optimization
parent
632fa522
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
gridder_cxx.h
gridder_cxx.h
+13
-13
No files found.
gridder_cxx.h
View file @
c6b28459
...
...
@@ -1290,12 +1290,12 @@ template<typename Serv> void wminmax(const GridderConfig &gconf,
}
}
template
<
typename
T
>
void
update_idx
(
vector
<
T
>
&
v
,
vector
<
T
>
&
vol
d
,
const
vector
<
T
>
&
add
,
const
vector
<
T
>
&
del
)
template
<
typename
T
>
void
update_idx
(
vector
<
T
>
&
v
,
const
vector
<
T
>
&
ad
d
,
const
vector
<
T
>
&
del
)
{
myassert
(
v
.
size
()
>=
del
.
size
(),
"must not happen"
);
v
old
.
resize
(
0
)
;
vold
.
reserve
((
v
.
size
()
+
add
.
size
())
-
del
.
size
());
v
ector
<
T
>
res
;
res
.
reserve
((
v
.
size
()
+
add
.
size
())
-
del
.
size
());
auto
iin
=
v
.
begin
(),
ein
=
v
.
end
();
auto
iadd
=
add
.
begin
(),
eadd
=
add
.
end
();
auto
irem
=
del
.
begin
(),
erem
=
del
.
end
();
...
...
@@ -1305,15 +1305,15 @@ template<typename T> void update_idx(vector<T> &v, vector<T> &vold,
if
((
irem
!=
erem
)
&&
(
*
iin
==*
irem
))
{
++
irem
;
++
iin
;
}
// skip removed entry
else
if
((
iadd
!=
eadd
)
&&
(
*
iadd
<*
iin
))
vold
.
push_back
(
*
(
iadd
++
));
// add new entry
res
.
push_back
(
*
(
iadd
++
));
// add new entry
else
vold
.
push_back
(
*
(
iin
++
));
res
.
push_back
(
*
(
iin
++
));
}
myassert
(
irem
==
erem
,
"must not happen"
);
while
(
iadd
!=
eadd
)
vold
.
push_back
(
*
(
iadd
++
));
myassert
(
vold
.
size
()
==
(
v
.
size
()
+
add
.
size
())
-
del
.
size
(),
"must not happen"
);
v
.
swap
(
vold
);
res
.
push_back
(
*
(
iadd
++
));
myassert
(
res
.
size
()
==
(
v
.
size
()
+
add
.
size
())
-
del
.
size
(),
"must not happen"
);
v
.
swap
(
res
);
}
template
<
typename
Serv
>
void
wstack_common
(
...
...
@@ -1403,14 +1403,14 @@ template<typename T, typename Serv> void x2dirty(
if
(
verbosity
>
0
)
cout
<<
"Gridding using improved w-stacking"
<<
endl
;
wstack_common
(
gconf
,
srv
,
wmin
,
dw
,
nplanes
,
minplane
,
verbosity
);
dirty
.
fill
(
0
);
vector
<
idx_t
>
subidx
,
subidx_old
;
vector
<
idx_t
>
subidx
;
tmpStorage
<
complex
<
T
>
,
2
>
grid_
({
gconf
.
Nu
(),
gconf
.
Nv
()});
auto
grid
=
grid_
.
getMav
();
tmpStorage
<
complex
<
T
>
,
2
>
tdirty_
(
dirty
.
shape
());
auto
tdirty
=
tdirty_
.
getMav
();
for
(
size_t
iw
=
0
;
iw
<
nplanes
;
++
iw
)
{
update_idx
(
subidx
,
subidx_old
,
minplane
[
iw
],
iw
>=
supp
?
minplane
[
iw
-
supp
]
:
vector
<
idx_t
>
());
update_idx
(
subidx
,
minplane
[
iw
],
iw
>=
supp
?
minplane
[
iw
-
supp
]
:
vector
<
idx_t
>
());
if
(
subidx
.
size
()
==
0
)
continue
;
if
(
verbosity
>
1
)
cout
<<
"Working on plane "
<<
iw
<<
" containing "
<<
subidx
.
size
()
...
...
@@ -1482,14 +1482,14 @@ template<typename T, typename Serv> void dirty2x(
// correct for w gridding
apply_wcorr
(
gconf
,
tdirty
,
ES_Kernel
(
supp
,
nthreads
),
dw
);
vector
<
idx_t
>
subidx
,
subidx_old
;
vector
<
idx_t
>
subidx
;
tmpStorage
<
complex
<
T
>
,
2
>
grid_
({
gconf
.
Nu
(),
gconf
.
Nv
()});
auto
grid
=
grid_
.
getMav
();
tmpStorage
<
complex
<
T
>
,
2
>
tdirty2_
({
nx_dirty
,
ny_dirty
});
auto
tdirty2
=
tdirty2_
.
getMav
();
for
(
size_t
iw
=
0
;
iw
<
nplanes
;
++
iw
)
{
update_idx
(
subidx
,
subidx_old
,
minplane
[
iw
],
iw
>=
supp
?
minplane
[
iw
-
supp
]
:
vector
<
idx_t
>
());
update_idx
(
subidx
,
minplane
[
iw
],
iw
>=
supp
?
minplane
[
iw
-
supp
]
:
vector
<
idx_t
>
());
if
(
subidx
.
size
()
==
0
)
continue
;
if
(
verbosity
>
1
)
cout
<<
"Working on plane "
<<
iw
<<
" containing "
<<
subidx
.
size
()
...
...
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