This code compiles but refuses to run. NONE of the cout statements appear, as if the program is in an infinite loop except that its not.
#include "matrixOpsLibrary.h"
#include <iostream>
using namespace MattsMatrixSpace;
using std::cout; using std::endl;
Mat pattern( unsigned K ){
cout<<"5";
Mat alpha; //this becomes our A variable which we use throughout the rest of the program
cout<<"4";
for( unsigned k=1; k<=K; ++k ){
cout<<"k:"<<k<<" ";
Vec temp;
Vec base = zeros( 2^(K-k) ) | ones( 2^(K-k) );
for( unsigned l=0; l<2^(K-1); ++l ) temp = temp | base;
alpha = concat( alpha, temp );
}
alpha = concat( alpha, sumr(alpha) );
Vec temp = zeros(2^K);
for( unsigned k=0; k<K; ++k ) {
cout<<"k:"<<k<<" ";
temp = temp - 10^(K-k-1)*getCol( alpha, k );
}
cout<<"1";
alpha = concat( alpha, temp );
alpha = sortbyc( alpha, concat( K, K+1 ) );
cout<<"2";
alpha = chop( alpha, 0, K-1 );
cout<<"3";
return alpha;
}
int main(){
cout<<"7";
unsigned K = 20;
cout<<"6";
Mat A = pattern( K );
cout<< A.size() << " rows and " << A[0].size() << " columns." <<endl;
return 0;
}