Changeset 12507 for issm/trunk-jpl/src/c/shared/Elements/elements.h
- Timestamp:
- 06/22/12 10:28:55 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/c/shared/Elements/elements.h ΒΆ
r12475 r12507 30 30 31 31 inline void printarray(IssmDouble* array,int lines,int cols=1){ 32 printf("\n");32 _printLine_(""); 33 33 for(int i=0;i<lines;i++){ 34 printf(" [ ");35 for(int j=0;j<cols;j++) printf(" %12.7g ",array[i*cols+j]);36 printf(" ]\n");34 _printString_(" [ "); 35 for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]); 36 _printLine_(" ]"); 37 37 } 38 printf("\n");38 _printLine_(""); 39 39 } 40 40 inline void printarray(int* array,int lines,int cols=1){ 41 printf("\n");41 _printLine_(""); 42 42 for(int i=0;i<lines;i++){ 43 printf(" [ ");44 for(int j=0;j<cols;j++) printf(" %6i",array[i*cols+j]);45 printf(" ]\n");43 _printString_(" [ "); 44 for(int j=0;j<cols;j++) _printString_( " " << setw(11) << setprecision (5) << array[i*cols+j]); 45 _printLine_(" ]"); 46 46 } 47 printf("\n");47 _printLine_(""); 48 48 } 49 49 inline void printbinary(int n) { 50 50 unsigned int i=1L<<(sizeof(n)*8-1); 51 52 51 while (i>0) { 53 52 if (n&i) 54 printf("1");53 _printString_("1"); 55 54 else 56 printf("0");55 _printString_("0"); 57 56 i>>=1; 58 57 }
Note:
See TracChangeset
for help on using the changeset viewer.