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

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

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

revision 1711 by jfenwick, Fri Aug 15 06:24:20 2008 UTC revision 1712 by jfenwick, Wed Aug 20 05:04:28 2008 UTC
# Line 91  Data::Data(const Data& inData) Line 91  Data::Data(const Data& inData)
91    m_protected=inData.isProtected();    m_protected=inData.isProtected();
92  }  }
93    
94    
95  Data::Data(const Data& inData,  Data::Data(const Data& inData,
96             const DataTypes::RegionType& region)             const DataTypes::RegionType& region)
97  {  {
# Line 139  Data::Data(const DataTagged::TagListType Line 140  Data::Data(const DataTagged::TagListType
140    }    }
141  }  }
142    
143    
144    
145    Data::Data(DataAbstract* underlyingdata)
146    {
147        m_data=shared_ptr<DataAbstract>(underlyingdata);
148        m_protected=false;
149    }
150    
151  Data::Data(const numeric::array& value,  Data::Data(const numeric::array& value,
152         const FunctionSpace& what,         const FunctionSpace& what,
153             bool expanded)             bool expanded)
# Line 2168  escript::C_GeneralTensorProduct(Data& ar Line 2177  escript::C_GeneralTensorProduct(Data& ar
2177    // General tensor product: res(SL x SR) = arg_0(SL x SM) * arg_1(SM x SR)    // General tensor product: res(SL x SR) = arg_0(SL x SM) * arg_1(SM x SR)
2178    // SM is the product of the last axis_offset entries in arg_0.getShape().    // SM is the product of the last axis_offset entries in arg_0.getShape().
2179    
   return C_GeneralTensorProduct_J(arg_0, arg_1, axis_offset, transpose);  
   
2180    // Interpolate if necessary and find an appropriate function space    // Interpolate if necessary and find an appropriate function space
2181    Data arg_0_Z, arg_1_Z;    Data arg_0_Z, arg_1_Z;
2182    if (arg_0.getFunctionSpace()!=arg_1.getFunctionSpace()) {    if (arg_0.getFunctionSpace()!=arg_1.getFunctionSpace()) {
# Line 2191  escript::C_GeneralTensorProduct(Data& ar Line 2198  escript::C_GeneralTensorProduct(Data& ar
2198    // Get rank and shape of inputs    // Get rank and shape of inputs
2199    int rank0 = arg_0_Z.getDataPointRank();    int rank0 = arg_0_Z.getDataPointRank();
2200    int rank1 = arg_1_Z.getDataPointRank();    int rank1 = arg_1_Z.getDataPointRank();
2201    DataTypes::ShapeType shape0 = arg_0_Z.getDataPointShape();    const DataTypes::ShapeType& shape0 = arg_0_Z.getDataPointShape();
2202    DataTypes::ShapeType shape1 = arg_1_Z.getDataPointShape();    const DataTypes::ShapeType& shape1 = arg_1_Z.getDataPointShape();
2203    
2204    // Prepare for the loops of the product and verify compatibility of shapes    // Prepare for the loops of the product and verify compatibility of shapes
2205    int start0=0, start1=0;    int start0=0, start1=0;
# Line 2201  escript::C_GeneralTensorProduct(Data& ar Line 2208  escript::C_GeneralTensorProduct(Data& ar
2208    else if (transpose == 2)  { start1 = rank1-axis_offset; }    else if (transpose == 2)  { start1 = rank1-axis_offset; }
2209    else              { throw DataException("C_GeneralTensorProduct: Error - transpose should be 0, 1 or 2"); }    else              { throw DataException("C_GeneralTensorProduct: Error - transpose should be 0, 1 or 2"); }
2210    
2211    
2212    // Adjust the shapes for transpose    // Adjust the shapes for transpose
2213    DataTypes::ShapeType tmpShape0;    DataTypes::ShapeType tmpShape0(rank0);    // pre-sizing the vectors rather
2214    DataTypes::ShapeType tmpShape1;    DataTypes::ShapeType tmpShape1(rank1);    // than using push_back
2215    for (int i=0; i<rank0; i++)   { tmpShape0.push_back( shape0[(i+start0)%rank0] ); }    for (int i=0; i<rank0; i++)   { tmpShape0[i]=shape0[(i+start0)%rank0]; }
2216    for (int i=0; i<rank1; i++)   { tmpShape1.push_back( shape1[(i+start1)%rank1] ); }    for (int i=0; i<rank1; i++)   { tmpShape1[i]=shape1[(i+start1)%rank1]; }
2217    
2218  #if 0  #if 0
2219    // For debugging: show shape after transpose    // For debugging: show shape after transpose
# Line 2236  escript::C_GeneralTensorProduct(Data& ar Line 2244  escript::C_GeneralTensorProduct(Data& ar
2244      SR *= tmpShape1[i];      SR *= tmpShape1[i];
2245    }    }
2246    
2247    // Define the shape of the output    // Define the shape of the output (rank of shape is the sum of the loop ranges below)
2248    DataTypes::ShapeType shape2;    DataTypes::ShapeType shape2(rank0+rank1-2*axis_offset);  
2249    for (int i=0; i<rank0-axis_offset; i++) { shape2.push_back(tmpShape0[i]); } // First part of arg_0_Z    {         // block to limit the scope of out_index
2250    for (int i=axis_offset; i<rank1; i++)   { shape2.push_back(tmpShape1[i]); } // Last part of arg_1_Z       int out_index=0;
2251         for (int i=0; i<rank0-axis_offset; i++, ++out_index) { shape2[out_index]=tmpShape0[i]; } // First part of arg_0_Z
2252         for (int i=axis_offset; i<rank1; i++, ++out_index)   { shape2[out_index]=tmpShape1[i]; } // Last part of arg_1_Z
2253      }
2254    
2255    // Declare output Data object    // Declare output Data object
2256    Data res;    Data res;
2257    
2258    if      (arg_0_Z.isConstant()   && arg_1_Z.isConstant()) {    if      (arg_0_Z.isConstant()   && arg_1_Z.isConstant()) {
2259      res = Data(0.0, shape2, arg_1_Z.getFunctionSpace());    // DataConstant output      res = Data(0.0, shape2, arg_1_Z.getFunctionSpace());    // DataConstant output
2260      double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[0]);      double *ptr_0 = &(arg_0_Z.getDataAtOffset(0));
2261      double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[0]);      double *ptr_1 = &(arg_1_Z.getDataAtOffset(0));
2262      double *ptr_2 = &((res.getPointDataView().getData())[0]);      double *ptr_2 = &(res.getDataAtOffset(0));
2263      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2264    }    }
2265    else if (arg_0_Z.isConstant()   && arg_1_Z.isTagged()) {    else if (arg_0_Z.isConstant()   && arg_1_Z.isTagged()) {
# Line 2269  escript::C_GeneralTensorProduct(Data& ar Line 2280  escript::C_GeneralTensorProduct(Data& ar
2280    
2281      // Prepare offset into DataConstant      // Prepare offset into DataConstant
2282      int offset_0 = tmp_0->getPointOffset(0,0);      int offset_0 = tmp_0->getPointOffset(0,0);
2283      double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);      double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2284      // Get the views      // Get the views
2285      DataArrayView view_1 = tmp_1->getDefaultValue();  //     DataArrayView view_1 = tmp_1->getDefaultValue();
2286      DataArrayView view_2 = tmp_2->getDefaultValue();  //     DataArrayView view_2 = tmp_2->getDefaultValue();
2287      // Get the pointers to the actual data  //     // Get the pointers to the actual data
2288      double *ptr_1 = &((view_1.getData())[0]);  //     double *ptr_1 = &((view_1.getData())[0]);
2289      double *ptr_2 = &((view_2.getData())[0]);  //     double *ptr_2 = &((view_2.getData())[0]);
2290    
2291        double *ptr_1 = &(tmp_1->getDefaultValue(0));
2292        double *ptr_2 = &(tmp_2->getDefaultValue(0));
2293    
2294    
2295      // Compute an MVP for the default      // Compute an MVP for the default
2296      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2297      // Compute an MVP for each tag      // Compute an MVP for each tag
# Line 2283  escript::C_GeneralTensorProduct(Data& ar Line 2299  escript::C_GeneralTensorProduct(Data& ar
2299      DataTagged::DataMapType::const_iterator i; // i->first is a tag, i->second is an offset into memory      DataTagged::DataMapType::const_iterator i; // i->first is a tag, i->second is an offset into memory
2300      for (i=lookup_1.begin();i!=lookup_1.end();i++) {      for (i=lookup_1.begin();i!=lookup_1.end();i++) {
2301        tmp_2->addTag(i->first);        tmp_2->addTag(i->first);
2302        DataArrayView view_1 = tmp_1->getDataPointByTag(i->first);  //       DataArrayView view_1 = tmp_1->getDataPointByTag(i->first);
2303        DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);  //       DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);
2304        double *ptr_1 = &view_1.getData(0);  //       double *ptr_1 = &view_1.getData(0);
2305        double *ptr_2 = &view_2.getData(0);  //       double *ptr_2 = &view_2.getData(0);
2306    
2307          double *ptr_1 = &(tmp_1->getDataByTag(i->first,0));
2308          double *ptr_2 = &(tmp_2->getDataByTag(i->first,0));
2309        
2310        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2311      }      }
2312    
# Line 2309  escript::C_GeneralTensorProduct(Data& ar Line 2329  escript::C_GeneralTensorProduct(Data& ar
2329        for (dataPointNo_1 = 0; dataPointNo_1 < numDataPointsPerSample_1; dataPointNo_1++) {        for (dataPointNo_1 = 0; dataPointNo_1 < numDataPointsPerSample_1; dataPointNo_1++) {
2330          int offset_1 = tmp_1->getPointOffset(sampleNo_1,dataPointNo_1);          int offset_1 = tmp_1->getPointOffset(sampleNo_1,dataPointNo_1);
2331          int offset_2 = tmp_2->getPointOffset(sampleNo_1,dataPointNo_1);          int offset_2 = tmp_2->getPointOffset(sampleNo_1,dataPointNo_1);
2332          double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);          double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2333          double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);          double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2334          double *ptr_2 = &((res.getPointDataView().getData())[offset_2]);          double *ptr_2 = &(res.getDataAtOffset(offset_2));
2335          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2336        }        }
2337      }      }
# Line 2335  escript::C_GeneralTensorProduct(Data& ar Line 2355  escript::C_GeneralTensorProduct(Data& ar
2355    
2356      // Prepare offset into DataConstant      // Prepare offset into DataConstant
2357      int offset_1 = tmp_1->getPointOffset(0,0);      int offset_1 = tmp_1->getPointOffset(0,0);
2358      double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);      double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2359      // Get the views      // Get the views
2360      DataArrayView view_0 = tmp_0->getDefaultValue();  //     DataArrayView view_0 = tmp_0->getDefaultValue();
2361      DataArrayView view_2 = tmp_2->getDefaultValue();  //     DataArrayView view_2 = tmp_2->getDefaultValue();
2362      // Get the pointers to the actual data  //     // Get the pointers to the actual data
2363      double *ptr_0 = &((view_0.getData())[0]);  //     double *ptr_0 = &((view_0.getData())[0]);
2364      double *ptr_2 = &((view_2.getData())[0]);  //     double *ptr_2 = &((view_2.getData())[0]);
2365    
2366        double *ptr_0 = &(tmp_0->getDefaultValue(0));
2367        double *ptr_2 = &(tmp_2->getDefaultValue(0));
2368    
2369      // Compute an MVP for the default      // Compute an MVP for the default
2370      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2371      // Compute an MVP for each tag      // Compute an MVP for each tag
2372      const DataTagged::DataMapType& lookup_0=tmp_0->getTagLookup();      const DataTagged::DataMapType& lookup_0=tmp_0->getTagLookup();
2373      DataTagged::DataMapType::const_iterator i; // i->first is a tag, i->second is an offset into memory      DataTagged::DataMapType::const_iterator i; // i->first is a tag, i->second is an offset into memory
2374      for (i=lookup_0.begin();i!=lookup_0.end();i++) {      for (i=lookup_0.begin();i!=lookup_0.end();i++) {
2375    //      tmp_2->addTaggedValue(i->first,tmp_2->getDefaultValue());
2376    //       DataArrayView view_0 = tmp_0->getDataPointByTag(i->first);
2377    //       DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);
2378    //       double *ptr_0 = &view_0.getData(0);
2379    //       double *ptr_2 = &view_2.getData(0);
2380    
2381        tmp_2->addTag(i->first);        tmp_2->addTag(i->first);
2382        DataArrayView view_0 = tmp_0->getDataPointByTag(i->first);        double *ptr_0 = &(tmp_0->getDataByTag(i->first,0));
2383        DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);        double *ptr_2 = &(tmp_2->getDataByTag(i->first,0));
       double *ptr_0 = &view_0.getData(0);  
       double *ptr_2 = &view_2.getData(0);  
2384        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2385      }      }
2386    
# Line 2373  escript::C_GeneralTensorProduct(Data& ar Line 2401  escript::C_GeneralTensorProduct(Data& ar
2401      DataTagged* tmp_2=dynamic_cast<DataTagged*>(res.borrowData());      DataTagged* tmp_2=dynamic_cast<DataTagged*>(res.borrowData());
2402      if (tmp_2==0) { throw DataException("GTP Programming error - casting to DataTagged."); }      if (tmp_2==0) { throw DataException("GTP Programming error - casting to DataTagged."); }
2403    
2404      // Get the views  //     // Get the views
2405      DataArrayView view_0 = tmp_0->getDefaultValue();  //     DataArrayView view_0 = tmp_0->getDefaultValue();
2406      DataArrayView view_1 = tmp_1->getDefaultValue();  //     DataArrayView view_1 = tmp_1->getDefaultValue();
2407      DataArrayView view_2 = tmp_2->getDefaultValue();  //     DataArrayView view_2 = tmp_2->getDefaultValue();
2408      // Get the pointers to the actual data  //     // Get the pointers to the actual data
2409      double *ptr_0 = &((view_0.getData())[0]);  //     double *ptr_0 = &((view_0.getData())[0]);
2410      double *ptr_1 = &((view_1.getData())[0]);  //     double *ptr_1 = &((view_1.getData())[0]);
2411      double *ptr_2 = &((view_2.getData())[0]);  //     double *ptr_2 = &((view_2.getData())[0]);
2412    
2413        double *ptr_0 = &(tmp_0->getDefaultValue(0));
2414        double *ptr_1 = &(tmp_1->getDefaultValue(0));
2415        double *ptr_2 = &(tmp_2->getDefaultValue(0));
2416    
2417    
2418      // Compute an MVP for the default      // Compute an MVP for the default
2419      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);      matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2420      // Merge the tags      // Merge the tags
# Line 2396  escript::C_GeneralTensorProduct(Data& ar Line 2430  escript::C_GeneralTensorProduct(Data& ar
2430      // Compute an MVP for each tag      // Compute an MVP for each tag
2431      const DataTagged::DataMapType& lookup_2=tmp_2->getTagLookup();      const DataTagged::DataMapType& lookup_2=tmp_2->getTagLookup();
2432      for (i=lookup_2.begin();i!=lookup_2.end();i++) {      for (i=lookup_2.begin();i!=lookup_2.end();i++) {
2433        DataArrayView view_0 = tmp_0->getDataPointByTag(i->first);  //       DataArrayView view_0 = tmp_0->getDataPointByTag(i->first);
2434        DataArrayView view_1 = tmp_1->getDataPointByTag(i->first);  //       DataArrayView view_1 = tmp_1->getDataPointByTag(i->first);
2435        DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);  //       DataArrayView view_2 = tmp_2->getDataPointByTag(i->first);
2436        double *ptr_0 = &view_0.getData(0);  //       double *ptr_0 = &view_0.getData(0);
2437        double *ptr_1 = &view_1.getData(0);  //       double *ptr_1 = &view_1.getData(0);
2438        double *ptr_2 = &view_2.getData(0);  //       double *ptr_2 = &view_2.getData(0);
2439    
2440          double *ptr_0 = &(tmp_0->getDataByTag(i->first,0));
2441          double *ptr_1 = &(tmp_1->getDataByTag(i->first,0));
2442          double *ptr_2 = &(tmp_2->getDataByTag(i->first,0));
2443    
2444        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);        matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2445      }      }
2446    
# Line 2422  escript::C_GeneralTensorProduct(Data& ar Line 2461  escript::C_GeneralTensorProduct(Data& ar
2461      #pragma omp parallel for private(sampleNo_0,dataPointNo_0) schedule(static)      #pragma omp parallel for private(sampleNo_0,dataPointNo_0) schedule(static)
2462      for (sampleNo_0 = 0; sampleNo_0 < numSamples_0; sampleNo_0++) {      for (sampleNo_0 = 0; sampleNo_0 < numSamples_0; sampleNo_0++) {
2463        int offset_0 = tmp_0->getPointOffset(sampleNo_0,0); // They're all the same, so just use #0        int offset_0 = tmp_0->getPointOffset(sampleNo_0,0); // They're all the same, so just use #0
2464        double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);        double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2465        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {
2466          int offset_1 = tmp_1->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_1 = tmp_1->getPointOffset(sampleNo_0,dataPointNo_0);
2467          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);
2468          double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);          double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2469          double *ptr_2 = &((res.getPointDataView().getData())[offset_2]);          double *ptr_2 = &(res.getDataAtOffset(offset_2));
2470          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2471        }        }
2472      }      }
# Line 2451  escript::C_GeneralTensorProduct(Data& ar Line 2490  escript::C_GeneralTensorProduct(Data& ar
2490        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {
2491          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);
2492          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);
2493          double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);          double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2494          double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);          double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2495          double *ptr_2 = &((res.getPointDataView().getData())[offset_2]);          double *ptr_2 = &(res.getDataAtOffset(offset_2));
2496          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2497        }        }
2498      }      }
# Line 2476  escript::C_GeneralTensorProduct(Data& ar Line 2515  escript::C_GeneralTensorProduct(Data& ar
2515      #pragma omp parallel for private(sampleNo_0,dataPointNo_0) schedule(static)      #pragma omp parallel for private(sampleNo_0,dataPointNo_0) schedule(static)
2516      for (sampleNo_0 = 0; sampleNo_0 < numSamples_0; sampleNo_0++) {      for (sampleNo_0 = 0; sampleNo_0 < numSamples_0; sampleNo_0++) {
2517        int offset_1 = tmp_1->getPointOffset(sampleNo_0,0);        int offset_1 = tmp_1->getPointOffset(sampleNo_0,0);
2518        double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);        double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2519        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {        for (dataPointNo_0 = 0; dataPointNo_0 < numDataPointsPerSample_0; dataPointNo_0++) {
2520          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);
2521          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);
2522          double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);          double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2523          double *ptr_2 = &((res.getPointDataView().getData())[offset_2]);          double *ptr_2 = &(res.getDataAtOffset(offset_2));
2524          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2525        }        }
2526      }      }
# Line 2506  escript::C_GeneralTensorProduct(Data& ar Line 2545  escript::C_GeneralTensorProduct(Data& ar
2545          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_0 = tmp_0->getPointOffset(sampleNo_0,dataPointNo_0);
2546          int offset_1 = tmp_1->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_1 = tmp_1->getPointOffset(sampleNo_0,dataPointNo_0);
2547          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);          int offset_2 = tmp_2->getPointOffset(sampleNo_0,dataPointNo_0);
2548          double *ptr_0 = &((arg_0_Z.getPointDataView().getData())[offset_0]);          double *ptr_0 = &(arg_0_Z.getDataAtOffset(offset_0));
2549          double *ptr_1 = &((arg_1_Z.getPointDataView().getData())[offset_1]);          double *ptr_1 = &(arg_1_Z.getDataAtOffset(offset_1));
2550          double *ptr_2 = &((res.getPointDataView().getData())[offset_2]);          double *ptr_2 = &(res.getDataAtOffset(offset_2));
2551          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);          matrix_matrix_product(SL, SM, SR, ptr_0, ptr_1, ptr_2, transpose);
2552        }        }
2553      }      }
# Line 2542  Data::toString() const Line 2581  Data::toString() const
2581  }  }
2582    
2583    
2584    
2585    DataTypes::ValueType::const_reference
2586    Data::getDataAtOffset(DataTypes::ValueType::size_type i) const
2587    {
2588        return getPointDataView().getData()[i];
2589    }
2590    
2591    
2592    DataTypes::ValueType::reference
2593    Data::getDataAtOffset(DataTypes::ValueType::size_type i)
2594    {
2595        return getPointDataView().getData()[i];
2596    }
2597    
2598    
2599  /* Member functions specific to the MPI implementation */  /* Member functions specific to the MPI implementation */
2600    
2601  void  void

Legend:
Removed from v.1711  
changed lines
  Added in v.1712

  ViewVC Help
Powered by ViewVC 1.1.26