6#ifndef _TNMTLIO_H_INCLUDED_
7#define _TNMTLIO_H_INCLUDED_
68 for(
int y=0;y<
mtr.m_height-1;y++)
71 for(
int x=0;x<
mtr.m_width-1;x++)
73 s<< int(
mtr[y][x]) <<
", ";
75 s<< int(
mtr[y][
mtr.m_width-1]) <<
" },\n";
79 for(
int x=0;x<
mtr.m_width-1;x++)
81 s<< int(
mtr[
mtr.m_height-1][x]) <<
", ";
83 s<<int(
mtr[
mtr.m_height-1][
mtr.m_width-1]) <<
" }\n};\n";
92 for(
int y=0;y<
mtr.m_height-1;y++)
95 for(
int x=0;x<
mtr.m_width-1;x++)
99 s<<
mtr[y][x] <<
", ";
103 s<<
mtr[y][
mtr.m_width-1] <<
" },\n";
107 for(
int x=0;x<
mtr.m_width-1;x++)
109 s<<
mtr[
mtr.m_height-1][x] <<
", ";
111 s<<
mtr[
mtr.m_height-1][
mtr.m_width-1] <<
" }\n};\n";
116__INLINE__ ostream&
operator<< (ostream& s,
const __int64& y)
122 s<<
"0x" << setw(8) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << hi
123 << setw(8) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << lo ;
132 for(
int y=0;y<
mtr.m_height-1;y++)
135 for(
int x=0;x<
mtr.m_width-1;x++)
139 s<<
mtr[y][x] <<
", ";
143 s<<
mtr[y][
mtr.m_width-1] <<
" },\n";
147 for(
int x=0;x<
mtr.m_width-1;x++)
149 s<<
mtr[
mtr.m_height-1][x] <<
", ";
151 s<<
mtr[
mtr.m_height-1][
mtr.m_width-1] <<
" }\n};\n";
162 for(
int y=0;y<
mtr.m_height-1;y++)
165 for(
int x=0;x<
mtr.m_width-1;x++)
167 sprintf(dbl,
"%20.20f",
mtr[y][x]);
170 sprintf(dbl,
"%20.20f",
mtr[y][
mtr.m_width-1]);
175 for(
int x=0;x<
mtr.m_width-1;x++)
177 sprintf(dbl,
"%20.20f",
mtr[
mtr.m_height-1][x]);
180 sprintf(dbl,
"%20.20f",
mtr[
mtr.m_height-1][
mtr.m_width-1]);
181 s<< dbl <<
" }\n};\n";
203__INLINE__ ostream&
operator<< (ostream& s,
const nmint<__int64>& y)
207 hi=int(y.m_value>>32);
209 s<<
"0x" << setw(8) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << hi
210 << setw(8) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << lo ;
214__INLINE__ ostream&
operator<< (ostream& s,
const nmint<int>& y)
216 unsigned int x=(__int32)y.m_value;
217 s<<
"0x" << setw(8) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << setiosflags(ios::uppercase) << x;
221__INLINE__ ostream&
operator<< (ostream& s,
const nmint<short>& y)
223 unsigned __int16 x=(__int16)y.m_value;
224 s<<
"0x" << setw(4) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << x ;
228__INLINE__ ostream&
operator<< (ostream& s,
const nmint<char>& y)
230 unsigned __int8 x=y.m_value;
231 s<<
"0x" << setw(2) << setiosflags(ios::hex|ios::uppercase|ios::internal) << setfill(
'0') << x ;
244 for(
int y=0;y<
mtr.m_height-1;y++)
247 for(
int x=0;x<
mtr.m_width-1;x++)
249 s<< (
mtr[y][x]) <<
", ";
251 s << (
mtr[y][
mtr.m_width-1]) <<
" },\n";
255 for(
int x=0;x<
mtr.m_width-1;x++)
257 s<< (
mtr[
mtr.m_height-1][x]) <<
", ";
259 s << (
mtr[
mtr.m_height-1][
mtr.m_width-1]) <<
" }\n";
266__INLINE__ ostream& AsmArray (ostream& s,
nmmtr64s&
mtr)
268 s <<
" long[" << dec <<
mtr.m_width <<
"*" <<
mtr.m_height <<
"]=(\n";
269 for(
int y=0;y<
mtr.m_height-1;y++)
271 for(
int x=0;x<
mtr.m_width;x++)
275 hi=int(
mtr[y][x].m_value>>32);
276 lo=int(
mtr[y][x].m_value);
278 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << hi <<
"_"
279 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << lo <<
"hl,";
284 for(
int x=0;x<
mtr.m_width-1;x++)
287 hi=int(
mtr[
mtr.m_height-1][x].m_value>>32);
288 lo=int(
mtr[
mtr.m_height-1][x].m_value);
290 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << hi <<
"_"
291 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << lo <<
"hl,";
296 hi=int(
mtr[
mtr.m_height-1][
mtr.m_width-1].m_value>>32);
297 lo=int(
mtr[
mtr.m_height-1][
mtr.m_width-1].m_value);
299 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << hi <<
"_"
300 << hex << setw(8) << setfill(
'0') << setiosflags(ios::uppercase) << lo <<
"hl";
307__INLINE__ ostream& AsmArray (ostream& s,
nmmtr8s&
mtr)
309 _ASSERTE(
mtr.m_width%8==0);
317 for(
int y=0; y< mSrcMtr1.m_height; y++)
318 for(
int x=0; x<mSrcMtr1.m_width; x++)
320 nmint<T2> res=mSrcMtr1[y][x]*mSrcMtr2[y][x];
325 template<
class T1,
class T2>
void GetSum(
nmmtr<T1>& mSrcMtr1, nmint<T2>& nResSum)
328 for(
int y=0; y< mSrcMtr1.m_height; y++)
329 for(
int x=0; x<mSrcMtr1.m_width; x++)
330 nResSum+=nmint<T2> (mSrcMtr1[y][x].m_value);
__INLINE__ ostream & operator<<(ostream &s, mtr< unsigned char > &mtr)
Definition: nmtlio.h:64