Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
e9d96319
Commit
e9d96319
authored
May 13, 2020
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use memset to zero arrays in BasisMapping
parent
90f6ddce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
19 deletions
+12
-19
BasisMapping.C
src/BasisMapping.C
+12
-19
No files found.
src/BasisMapping.C
View file @
e9d96319
...
@@ -442,18 +442,11 @@ void BasisMapping::transpose_bwd(const complex<double> *zvec,
...
@@ -442,18 +442,11 @@ void BasisMapping::transpose_bwd(const complex<double> *zvec,
rbuf
=
sbuf
;
rbuf
=
sbuf
;
#endif
#endif
// copy from rbuf to ct
// clear ct
// scatter index array iunpack
memset
((
void
*
)
ct
,
0
,
np012loc_
*
sizeof
(
complex
<
double
>
));
{
const
int
len
=
np012loc_
;
double
*
const
pv
=
(
double
*
)
ct
;
for
(
int
i
=
0
;
i
<
len
;
i
++
)
{
pv
[
2
*
i
]
=
0
.
0
;
pv
[
2
*
i
+
1
]
=
0
.
0
;
}
}
// copy from rbuf to ct
// using scatter index array iunpack
#if USE_GATHER_SCATTER
#if USE_GATHER_SCATTER
// zsctr(n,x,indx,y): y(indx(i)) = x(i)
// zsctr(n,x,indx,y): y(indx(i)) = x(i)
{
{
...
@@ -553,15 +546,12 @@ void BasisMapping::transpose_fwd(const complex<double> *ct,
...
@@ -553,15 +546,12 @@ void BasisMapping::transpose_fwd(const complex<double> *ct,
void
BasisMapping
::
vector_to_zvec
(
const
complex
<
double
>
*
c
,
void
BasisMapping
::
vector_to_zvec
(
const
complex
<
double
>
*
c
,
complex
<
double
>
*
zvec
)
const
complex
<
double
>
*
zvec
)
const
{
{
// clear zvec
memset
((
void
*
)
&
zvec
[
0
],
0
,
zvec_size
()
*
sizeof
(
complex
<
double
>
));
// map coefficients from the basis order to a zvec
// map coefficients from the basis order to a zvec
const
int
ng
=
basis_
.
localsize
();
const
int
len
=
zvec_size
();
double
*
const
pz
=
(
double
*
)
zvec
;
double
*
const
pz
=
(
double
*
)
zvec
;
for
(
int
i
=
0
;
i
<
len
;
i
++
)
const
int
ng
=
basis_
.
localsize
();
{
pz
[
2
*
i
]
=
0
.
0
;
pz
[
2
*
i
+
1
]
=
0
.
0
;
}
const
double
*
const
pc
=
(
const
double
*
)
c
;
const
double
*
const
pc
=
(
const
double
*
)
c
;
if
(
basis_
.
real
()
)
if
(
basis_
.
real
()
)
{
{
...
@@ -595,9 +585,12 @@ void BasisMapping::vector_to_zvec(const complex<double> *c,
...
@@ -595,9 +585,12 @@ void BasisMapping::vector_to_zvec(const complex<double> *c,
void
BasisMapping
::
doublevector_to_zvec
(
const
complex
<
double
>
*
c1
,
void
BasisMapping
::
doublevector_to_zvec
(
const
complex
<
double
>
*
c1
,
const
complex
<
double
>
*
c2
,
complex
<
double
>
*
zvec
)
const
const
complex
<
double
>
*
c2
,
complex
<
double
>
*
zvec
)
const
{
{
// map two real functions to zvec
assert
(
basis_
.
real
());
assert
(
basis_
.
real
());
// clear zvec
memset
((
void
*
)
&
zvec
[
0
],
0
,
zvec_size
()
*
sizeof
(
complex
<
double
>
));
memset
((
void
*
)
&
zvec
[
0
],
0
,
zvec_size
()
*
sizeof
(
complex
<
double
>
));
// map two real functions to zvec
double
*
const
pz
=
(
double
*
)
&
zvec
[
0
];
double
*
const
pz
=
(
double
*
)
&
zvec
[
0
];
const
int
ng
=
basis_
.
localsize
();
const
int
ng
=
basis_
.
localsize
();
const
double
*
const
pc1
=
(
double
*
)
&
c1
[
0
];
const
double
*
const
pc1
=
(
double
*
)
&
c1
[
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