Outputs a big and very sparse matrix.let C be the cyclic shift matrix with 1 on the 1,n position and along the first subdiagonal.
This matrix is . It has 2 nonzero entries per row and per column. It is an matrix whose determinant is considerably less than the Hadamard bound (but is large – 3^n +- 2^n).
#include <iostream>
#include <cstdlib>
using namespace std;
int main(int argc, char* argv[])
{
if (argc != 2 ) {
cerr << "Usage: bigmat <n>, where <n> is the size you like." << endl;
return -1;
}
int n = atoi(argv[1]);
cout << n << " " << n << " M" << endl;
cout << "1 1 3" << endl;
cout << "1 " << n << " 2" << endl;
for (int i = 2; i <=n; ++i)
{
cout << i << " " << i-1 << " " << 2 << endl;
cout << i << " " << i << " " << 3 << endl;
}
cout << "0 0 0" << endl;
return 0 ;
}