
#include "./elements.h"
#include "../../include/macros.h"
using namespace std;

void printarray(IssmPDouble* array,int lines,int cols){
	_printLine_("");
	for(int i=0;i<lines;i++){  
		_printString_("   [ ");
		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
		_printLine_(" ]");
	}  
	_printLine_("");
}
void printsparsity(IssmPDouble* array,int lines,int cols){
	int count;
	_printLine_("");
	for(int i=0;i<lines;i++){  
		_printString_("   [ ");
		count = 0;
		for(int j=0;j<cols;j++){
			if(array[i*cols+j]!=0.0){
				_printString_( " X"); count++;
			}
			else
			 _printString_( " .");
		}
		_printLine_(" ] "<<i<<" => "<<count);
	}  
	_printLine_("");
}
void printarray(int* array,int lines,int cols){
	_printLine_("");
	for(int i=0;i<lines;i++){  
		_printString_("   [ ");
		for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]);
		_printLine_(" ]");
	}  
	_printLine_("");
}
void printbinary(int n){
	unsigned int i=1L<<(sizeof(n)*8-1);
	while (i>0) {
		if (n&i)
		 _printString_("1");
		else
		 _printString_("0");
		i>>=1;
	}
}
