/[escript]/trunk/escript/src/Data.cpp
ViewVC logotype

Diff of /trunk/escript/src/Data.cpp

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

revision 435 by gross, Thu Dec 1 06:40:20 2005 UTC revision 436 by gross, Thu Jan 19 22:36:36 2006 UTC
# Line 29  Line 29 
29  #include <boost/python/str.hpp>  #include <boost/python/str.hpp>
30  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
31  #include <boost/python/long.hpp>  #include <boost/python/long.hpp>
32    #include <boost/python/tuple.hpp>
33    
34  #include "escript/Data/DataException.h"  #include "escript/Data/DataException.h"
35  #include "escript/Data/DataExpanded.h"  #include "escript/Data/DataExpanded.h"
# Line 880  Data::integrate() const Line 881  Data::integrate() const
881      }      }
882    }    }
883    if (rank==2) {    if (rank==2) {
884      bp_array.resize(shape[0],shape[1]);         bp_array.resize(shape[0],shape[1]);
885      for (int i=0; i<shape[0]; i++) {         for (int i=0; i<shape[0]; i++) {
886        for (int j=0; j<shape[1]; j++) {           for (int j=0; j<shape[1]; j++) {
887          index = i + shape[0] * j;             index = i + shape[0] * j;
888          bp_array[i,j] = integrals[index];             bp_array[make_tuple(i,j)] = integrals[index];
889        }           }
890      }         }
891    }    }
892    if (rank==3) {    if (rank==3) {
893      bp_array.resize(shape[0],shape[1],shape[2]);      bp_array.resize(shape[0],shape[1],shape[2]);
# Line 894  Data::integrate() const Line 895  Data::integrate() const
895        for (int j=0; j<shape[1]; j++) {        for (int j=0; j<shape[1]; j++) {
896          for (int k=0; k<shape[2]; k++) {          for (int k=0; k<shape[2]; k++) {
897            index = i + shape[0] * ( j + shape[1] * k );            index = i + shape[0] * ( j + shape[1] * k );
898            bp_array[i,j,k] = integrals[index];            bp_array[make_tuple(i,j,k)] = integrals[index];
899          }          }
900        }        }
901      }      }
# Line 906  Data::integrate() const Line 907  Data::integrate() const
907          for (int k=0; k<shape[2]; k++) {          for (int k=0; k<shape[2]; k++) {
908            for (int l=0; l<shape[3]; l++) {            for (int l=0; l<shape[3]; l++) {
909              index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) );              index = i + shape[0] * ( j + shape[1] * ( k + shape[2] * l ) );
910              bp_array[i,j,k,l] = integrals[index];              bp_array[make_tuple(i,j,k,l)] = integrals[index];
911            }            }
912          }          }
913        }        }

Legend:
Removed from v.435  
changed lines
  Added in v.436

  ViewVC Help
Powered by ViewVC 1.1.26