/[escript]/branches/arrayview_from_1695_trunk/escript/src/DataArrayView.cpp
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/escript/src/DataArrayView.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC
# Line 1  Line 1 
 // $Id$  
1    
2  /*  /* $Id$ */
3   ************************************************************  
4   *          Copyright 2006 by ACcESS MNRF                   *  /*******************************************************
5   *                                                          *   *
6   *              http://www.access.edu.au                    *   *           Copyright 2003-2007 by ACceSS MNRF
7   *       Primary Business: Queensland, Australia            *   *       Copyright 2007 by University of Queensland
8   *  Licensed under the Open Software License version 3.0    *   *
9   *     http://www.opensource.org/licenses/osl-3.0.php       *   *                http://esscc.uq.edu.au
10   *                                                          *   *        Primary Business: Queensland, Australia
11   ************************************************************   *  Licensed under the Open Software License version 3.0
12  */   *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  #include "DataArrayView.h"  #include "DataArrayView.h"
17  #include "DataException.h"  #include "DataException.h"
# Line 661  DataArrayView::toString(const string& su Line 662  DataArrayView::toString(const string& su
662        break;        break;
663      case 1:      case 1:
664        for (int i=0;i<getShape()[0];i++) {        for (int i=0;i<getShape()[0];i++) {
665      temp << "(" << i << ") " << finalSuffix << (*this)(i);      temp << finalSuffix << "(" << i << ") " << (*this)(i);
666      if (i!=(getShape()[0]-1)) {      if (i!=(getShape()[0]-1)) {
667        temp << endl;        temp << endl;
668      }      }
# Line 670  DataArrayView::toString(const string& su Line 671  DataArrayView::toString(const string& su
671      case 2:      case 2:
672        for (int i=0;i<getShape()[0];i++) {        for (int i=0;i<getShape()[0];i++) {
673      for (int j=0;j<getShape()[1];j++) {      for (int j=0;j<getShape()[1];j++) {
674        temp << "(" << i << "," << j << ") " << finalSuffix << (*this)(i,j);        temp << finalSuffix << "(" << i << "," << j << ") " << (*this)(i,j);
675        if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1))) {        if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1))) {
676          temp << endl;          temp << endl;
677        }        }
# Line 681  DataArrayView::toString(const string& su Line 682  DataArrayView::toString(const string& su
682        for (int i=0;i<getShape()[0];i++) {        for (int i=0;i<getShape()[0];i++) {
683      for (int j=0;j<getShape()[1];j++) {      for (int j=0;j<getShape()[1];j++) {
684        for (int k=0;k<getShape()[2];k++) {        for (int k=0;k<getShape()[2];k++) {
685          temp << "(" << i << "," << j << "," << k << ") " << finalSuffix << (*this)(i,j,k);          temp << finalSuffix << "(" << i << "," << j << "," << k << ") " << (*this)(i,j,k);
686          if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1) && k==(getShape()[2]-1))) {          if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1) && k==(getShape()[2]-1))) {
687            temp << endl;            temp << endl;
688          }          }
# Line 694  DataArrayView::toString(const string& su Line 695  DataArrayView::toString(const string& su
695      for (int j=0;j<getShape()[1];j++) {      for (int j=0;j<getShape()[1];j++) {
696        for (int k=0;k<getShape()[2];k++) {        for (int k=0;k<getShape()[2];k++) {
697          for (int l=0;l<getShape()[3];l++) {          for (int l=0;l<getShape()[3];l++) {
698            temp << "(" << i << "," << j << "," << k << "," << l << ") " << finalSuffix << (*this)(i,j,k,l);            temp << finalSuffix << "(" << i << "," << j << "," << k << "," << l << ") " << (*this)(i,j,k,l);
699            if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1) && k==(getShape()[2]-1) && l==(getShape()[3]-1))) {            if (!(i==(getShape()[0]-1) && j==(getShape()[1]-1) && k==(getShape()[2]-1) && l==(getShape()[3]-1))) {
700              temp << endl;              temp << endl;
701            }            }

Legend:
Removed from v.757  
changed lines
  Added in v.1388

  ViewVC Help
Powered by ViewVC 1.1.26