Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F61389575
double_buffer.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 6, 08:58
Size
1 KB
Mime Type
text/x-c
Expires
Wed, May 8, 08:58 (2 d)
Engine
blob
Format
Raw Data
Handle
17505345
Attached To
rSCINTROPARALLEL Poisson code for introduction to parallelism
double_buffer.cc
View Options
/* -------------------------------------------------------------------------- */
#include "double_buffer.hh"
#include "grid.hh"
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
DoubleBuffer
::
DoubleBuffer
(
int
m
,
int
n
)
:
m_current
(
new
Grid
(
m
,
n
)),
m_old
(
new
Grid
(
m
,
n
))
{}
/* -------------------------------------------------------------------------- */
Grid
&
DoubleBuffer
::
current
()
{
return
*
m_current
;
}
/* -------------------------------------------------------------------------- */
Grid
&
DoubleBuffer
::
old
()
{
return
*
m_old
;
}
/* -------------------------------------------------------------------------- */
const
Grid
&
DoubleBuffer
::
current
()
const
{
return
*
m_current
;
}
/* -------------------------------------------------------------------------- */
const
Grid
&
DoubleBuffer
::
old
()
const
{
return
*
m_old
;
}
/* -------------------------------------------------------------------------- */
void
DoubleBuffer
::
swap
()
{
m_current
.
swap
(
m_old
);
}
/* -------------------------------------------------------------------------- */
void
DoubleBuffer
::
resize
(
int
m
,
int
n
)
{
m_current
->
resize
(
m
,
n
);
m_old
->
resize
(
m
,
n
);
}
Event Timeline
Log In to Comment