00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "barray2d.cpp"
00027
00028 namespace PLib {
00029
00030 template <>
00031 inline void initMemory<unsigned char>(unsigned char* pointer, int size){
00032 initMemoryWithMemset(pointer,size);
00033 }
00034
00035
00036 ostream&
00037 Basic2DArray<unsigned char>::print(ostream& os) const
00038 {
00039 int i, j;
00040 const int r = rows() ;
00041 const int c = cols();
00042
00043 if ( by_columns )
00044 for (j = 0; j < c; j++)
00045 {
00046 for (i = 0; i < r; i++) {
00047 os << setw(width) << (int)elem(i,j) << ' ';
00048 }
00049 os << '\n';
00050 }
00051 else
00052 for (i = 0; i < r; i++)
00053 {
00054 for (j = 0; j < c; j++){
00055 os << setw(width) << (int)elem(i,j) << ' ';
00056 }
00057 os << '\n';
00058 }
00059
00060 return os;
00061 }
00062
00063
00064
00065 #ifdef NO_IMPLICIT_TEMPLATES
00066
00067 template class Basic2DArray<unsigned char> ;
00068 template void initBasic2DArray<unsigned char>(Basic2DArray<unsigned char>&,const int,const int) ;
00069 template void resizeKeepBasic2DArray<unsigned char>(Basic2DArray<unsigned char>&,const int,const int) ;
00070 template istream& operator>>(istream& is, Basic2DArray<unsigned char>& ary);
00071 template ostream& operator<<(ostream& os, const Basic2DArray<unsigned char>& ary);
00072
00073
00074 #endif
00075
00076 }