Commit f84f3c86 authored by mjg226's avatar mjg226
Browse files

.

parent 8698635a
......@@ -39,9 +39,9 @@ namespace CA {
/// ----- Static variables ----- ///
template<>
std::vector<Real> CellBuff<Real>::mem_io = std::vector<Real>();
//template<>
//std::vector<Real> CellBuff<Real>::mem_io = std::vector<Real>();
template<>
std::vector<State> CellBuff<State>::mem_io = std::vector<State>();
//template<>
//std::vector<State> CellBuff<State>::mem_io = std::vector<State>();
}
......@@ -356,7 +356,7 @@ namespace CA {
cl::Kernel _kernel_copy1DBuffToPLCellBuffState;
//! Buffer used for direct I/O.
static std::vector<T> mem_io;
std::vector<T> mem_io;
};
......@@ -380,7 +380,9 @@ namespace CA {
_kernel_copyPLCellBuffRealTo1DBuff(),
_kernel_copyPLCellBuffStateTo1DBuff(),
_kernel_copy1DBuffToPLCellBuffReal(),
_kernel_copy1DBuffToPLCellBuffState()
_kernel_copy1DBuffToPLCellBuffState(),
mem_io()
{
// Create the buffer in the device memory of GRID context. The x
// size of the buffer is the stride in order to keep the memory
......
......@@ -39,9 +39,9 @@ namespace CA {
/// ----- Static variables ----- ///
template<>
std::vector<Real> EdgeBuff<Real>::mem_io = std::vector<Real>();
//template<>
//std::vector<Real> EdgeBuff<Real>::mem_io = std::vector<Real>();
template<>
std::vector<State> EdgeBuff<State>::mem_io = std::vector<State>();
//template<>
//std::vector<State> EdgeBuff<State>::mem_io = std::vector<State>();
}
......@@ -260,7 +260,7 @@ namespace CA {
cl::Kernel _kernel_setValueEdgeBuffState;
//! Buffer used for direct I/O.
static std::vector<T> mem_io;
std::vector<T> mem_io;
};
......@@ -278,7 +278,8 @@ namespace CA {
_buff(),
_event(),
_kernel_setValueEdgeBuffReal(),
_kernel_setValueEdgeBuffState()
_kernel_setValueEdgeBuffState(),
mem_io()
{
// Create the buffer in the device memory of GRID context. The
// buffer is the sum of the two sub-buffers. The x size of the
......
......@@ -55,6 +55,12 @@ namespace CA {
//};
//! Read token and value pair from a line of the header of an ARC/INFO
//! ASCII GRID file.
template<typename A>
......@@ -85,6 +91,10 @@ namespace CA {
// Get starting time.
//Clock total_timer;
//std::cout << "READING DATA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
// Open file
std::ifstream infile(filename.c_str());
......@@ -881,6 +891,50 @@ namespace CA {
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
//std::ostream & operator<<(std::ostream & Str, ESRI_ASCIIGrid<CA::Real> const & value) {
inline std::string getString(){
// print something from v to str, e.g: Str << v.getX();
std::ostringstream Str;
std::string output;
Str << "n cols: " << ncols << std::endl;
Str << "n rows: " << nrows << std::endl;
Str << "xllcorner: " << xllcorner << std::endl;
Str << "yllcorner: " << yllcorner << std::endl;
Str << "no_data: " << nodata << std::endl;
output = Str.str();
//return Str;
return output;
}
//--------------------------------------------------------------------------------------------------------------
inline void copyData(ESRI_ASCIIGrid inGrid)
{
AsciiGridGeneral<T>::ncols = inGrid.ncols;
AsciiGridGeneral<T>::nrows = inGrid.nrows;
AsciiGridGeneral<T>::xllcorner = inGrid.xllcorner;
AsciiGridGeneral<T>::yllcorner = inGrid.yllcorner;
AsciiGridGeneral<T>::cellsize = inGrid.cellsize;
AsciiGridGeneral<T>::nodata = inGrid.nodata;
AsciiGridGeneral<T>::data.resize(inGrid.data.size());
for(int counter = 0; counter < inGrid.data.size(); ++counter){
AsciiGridGeneral<T>::data[counter] = inGrid.data[counter];
}
}
};// end of class
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment