22int main(
int argc,
char** argv)
28 cout <<
"Input and/or output filenames are missing!\n";
29 cout <<
"Usage: convert inputFileName outputFileName \n";
32 char * ifname = argv[1];
41 inf.open(ifname, ios::in);
42 FILE* outf = fopen(
ofname,
"wb");
47 size_t found1, found2, found3;
49 found1 = s.find(
"pattern");
50 if (found1 != string::npos)
54 found1 = s.find(
"symmetric");
55 found2 = s.find(
"hermitian");
56 found3 = s.find(
"skew-symmetric");
57 if (found1 != string::npos || found2 != string::npos || found3 != string::npos)
61 while(inf.peek()==
'%')
71 cout << count << endl;
79 fwrite(&i,
sizeof(
long), 1, outf);
80 fwrite(space,
sizeof(space), 1, outf);
81 fwrite(&j,
sizeof(
long), 1, outf);
82 fwrite(space,
sizeof(space), 1, outf);
91 fprintf(outf,
"%ld %ld ", j-1 , numRow+i-1);
94 fwrite(&i1,
sizeof(
long), 1, outf);
95 fwrite(space,
sizeof(space), 1, outf);
96 fwrite(&j1,
sizeof(
long), 1, outf);
97 fwrite(space,
sizeof(space), 1, outf);
107 printf(
"file can not be opened \n");
int main(int argc, char **argv)