Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91672075
grid.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
Wed, Nov 13, 07:55
Size
995 B
Mime Type
text/x-c
Expires
Fri, Nov 15, 07:55 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22304877
Attached To
R7871 phys-743-exercises
grid.cc
View Options
/* -------------------------------------------------------------------------- */
#include "grid.hh"
/* -------------------------------------------------------------------------- */
#include <algorithm>
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
Grid::Grid(int m, int n) : m_m(m), m_n(n), m_storage(m * n) { clear(); }
/* -------------------------------------------------------------------------- */
void Grid::clear() { std::fill(m_storage.begin(), m_storage.end(), 0.); }
/* -------------------------------------------------------------------------- */
void Grid::resize(int m, int n) {
m_m = m;
m_n = n;
m_storage.resize(m*n);
}
/* -------------------------------------------------------------------------- */
int Grid::m() const { return m_m; }
int Grid::n() const { return m_n; }
/* -------------------------------------------------------------------------- */
Event Timeline
Log In to Comment