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

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

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

revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC revision 813 by ksteube, Mon Aug 21 02:08:47 2006 UTC
# Line 29  extern "C" { Line 29  extern "C" {
29  #include "paso/Paso.h"  #include "paso/Paso.h"
30  }  }
31    
32    #ifndef PASO_MPI
33    #define MPI_Comm long
34    #endif
35    
36  #include <string>  #include <string>
37  #include <algorithm>  #include <algorithm>
38    
# Line 234  class Data { Line 238  class Data {
238    
239    /**    /**
240       \brief       \brief
241         switches on update protection
242    
243      */
244      ESCRIPT_DLL_API
245      void
246      setProtection();
247    
248      /**
249         \brief
250         Returns trueif the data object is protected against update
251    
252      */
253      ESCRIPT_DLL_API
254      bool
255      isProtected() const;
256      /**
257         \brief
258       Return the values of all data-points as a single python numarray object.       Return the values of all data-points as a single python numarray object.
259    */    */
260    ESCRIPT_DLL_API    ESCRIPT_DLL_API
# Line 252  class Data { Line 273  class Data {
273       \brief       \brief
274       Return the value of the specified data-point as a single python numarray object.       Return the value of the specified data-point as a single python numarray object.
275    */    */
276    #ifndef PASO_MPI  
277    ESCRIPT_DLL_API    ESCRIPT_DLL_API
278    const boost::python::numeric::array    const boost::python::numeric::array
279    convertToNumArrayFromDPNo(int sampleNo,    convertToNumArrayFromDPNo(int ProcNo,
280                                                            int sampleNo,
281                              int dataPointNo);                              int dataPointNo);
282    #else
283      ESCRIPT_DLL_API
284      const boost::python::numeric::array
285      convertToNumArrayFromDPNo(int procNo,
286                    int sampleNo,
287                    int dataPointNo);
288    #endif
289    
290    
291    /**    /**
292       \brief       \brief
# Line 528  class Data { Line 559  class Data {
559    getDataPoint(int sampleNo,    getDataPoint(int sampleNo,
560                 int dataPointNo)                 int dataPointNo)
561    {    {
562      return m_data->getDataPoint(sampleNo,dataPointNo);          return m_data->getDataPoint(sampleNo,dataPointNo);
563    }    }
564    
565    /**    /**
# Line 766  class Data { Line 797  class Data {
797    
798    ESCRIPT_DLL_API    ESCRIPT_DLL_API
799    void    void
800    calc_mindp(int& SampleNo,    calc_mindp(int& ProcNo,
801                            int& SampleNo,  
802               int& DataPointNo) const;               int& DataPointNo) const;
   
803    /**    /**
804       \brief       \brief
805       Return the sign of each data point of this Data object.       Return the sign of each data point of this Data object.
# Line 781  class Data { Line 812  class Data {
812    
813    /**    /**
814       \brief       \brief
815         Return the symmetric part of a matrix which is half the matrix plus its transpose.
816         *
817      */
818      ESCRIPT_DLL_API
819      Data
820      symmetric() const;
821    
822      /**
823         \brief
824         Return the nonsymmetric part of a matrix which is half the matrix minus its transpose.
825         *
826      */
827      ESCRIPT_DLL_API
828      Data
829      nonsymmetric() const;
830    
831      /**
832         \brief
833         Return the trace of a matrix
834         *
835      */
836      ESCRIPT_DLL_API
837      Data
838      trace(int axis_offset) const;
839    
840      /**
841         \brief
842         Transpose each data point of this Data object around the given axis.
843         *
844      */
845      ESCRIPT_DLL_API
846      Data
847      transpose(int axis_offset) const;
848    
849      /**
850         \brief
851       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.       Return the eigenvalues of the symmetric part at each data point of this Data object in increasing values.
852       Currently this function is restricted to rank 2, square shape, and dimension 3.       Currently this function is restricted to rank 2, square shape, and dimension 3.
853       *       *
# Line 804  class Data { Line 871  class Data {
871    
872    /**    /**
873       \brief       \brief
874       Transpose each data point of this Data object around the given axis.       swaps the components axis0 and axis1
      --* not implemented yet *--  
875       *       *
876    */    */
877    ESCRIPT_DLL_API    ESCRIPT_DLL_API
878    Data    Data
879    transpose(int axis) const;    swapaxes(const int axis0, const int axis1) const;
   
   /**  
      \brief  
      Calculate the trace of each data point of this Data object.  
      *  
   */  
   ESCRIPT_DLL_API  
   Data  
   trace() const;  
880    
881    /**    /**
882       \brief       \brief
# Line 1190  class Data { Line 1247  class Data {
1247       \brief       \brief
1248       print the data values to stdout. Used for debugging       print the data values to stdout. Used for debugging
1249    */    */
1250    void print();    ESCRIPT_DLL_API
1251      void
1252        print(void);
1253    
1254      /**
1255         \brief
1256         return the MPI rank number of the local data
1257             MPI_COMM_WORLD is assumed and the result of MPI_Comm_size()
1258             is returned
1259      */
1260      ESCRIPT_DLL_API
1261        int
1262        get_MPIRank(void) const;
1263    
1264      /**
1265         \brief
1266         return the MPI rank number of the local data
1267             MPI_COMM_WORLD is assumed and the result of MPI_Comm_rank()
1268             is returned
1269      */
1270      ESCRIPT_DLL_API
1271        int
1272        get_MPISize(void) const;
1273    
1274      /**
1275         \brief
1276         return the MPI rank number of the local data
1277             MPI_COMM_WORLD is assumed and returned.
1278      */
1279      ESCRIPT_DLL_API
1280        MPI_Comm
1281        get_MPIComm(void) const;
1282    
1283      /**
1284         \brief
1285         return the object produced by the factory, which is a DataConstant or DataExpanded
1286      */
1287      ESCRIPT_DLL_API
1288        DataAbstract*
1289        borrowData(void) const;
1290    
1291   protected:   protected:
1292    
# Line 1295  class Data { Line 1391  class Data {
1391    reshapeDataPoint(const DataArrayView::ShapeType& shape);    reshapeDataPoint(const DataArrayView::ShapeType& shape);
1392    
1393    //    //
1394      // flag to protect the data object against any update
1395      bool m_protected;
1396    
1397      //
1398    // pointer to the actual data object    // pointer to the actual data object
1399    boost::shared_ptr<DataAbstract> m_data;    boost::shared_ptr<DataAbstract> m_data;
1400    
# Line 1430  ESCRIPT_DLL_API std::ostream& operator<< Line 1530  ESCRIPT_DLL_API std::ostream& operator<<
1530    
1531  /**  /**
1532    \brief    \brief
1533      Compute a tensor product of two Data objects
1534      \param arg0 - Input - Data object
1535      \param arg1 - Input - Data object
1536      \param axis_offset - Input - axis offset
1537      \param transpose - Input - 0: transpose neither, 1: transpose arg0, 2: transpose arg1
1538    */
1539    ESCRIPT_DLL_API
1540    Data
1541    C_GeneralTensorProduct(Data& arg0,
1542                         Data& arg1,
1543                         int axis_offset=0,
1544                         int transpose=0);
1545    
1546    /**
1547      \brief
1548    Return true if operands are equivalent, else return false.    Return true if operands are equivalent, else return false.
1549    NB: this operator does very little at this point, and isn't to    NB: this operator does very little at this point, and isn't to
1550    be relied on. Requires further implementation.    be relied on. Requires further implementation.

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

  ViewVC Help
Powered by ViewVC 1.1.26