/[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 2005 by jfenwick, Mon Nov 10 01:21:39 2008 UTC revision 2049 by phornby, Mon Nov 17 08:54:33 2008 UTC
# Line 1324  Data::tanh() const Line 1324  Data::tanh() const
1324  Data  Data
1325  Data::erf() const  Data::erf() const
1326  {  {
1327  #ifdef _WIN32  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1328    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");    throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms.");
1329  #else  #else
1330    if (isLazy())    if (isLazy())
# Line 1344  Data::asinh() const Line 1344  Data::asinh() const
1344      DataLazy* c=new DataLazy(borrowDataPtr(),ASINH);      DataLazy* c=new DataLazy(borrowDataPtr(),ASINH);
1345      return Data(c);      return Data(c);
1346    }    }
1347  #ifdef _WIN32  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1348    return C_TensorUnaryOperation(*this, escript::asinh_substitute);    return C_TensorUnaryOperation(*this, escript::asinh_substitute);
1349  #else  #else
1350    return C_TensorUnaryOperation(*this, ::asinh);    return C_TensorUnaryOperation(*this, ::asinh);
# Line 1359  Data::acosh() const Line 1359  Data::acosh() const
1359      DataLazy* c=new DataLazy(borrowDataPtr(),ACOSH);      DataLazy* c=new DataLazy(borrowDataPtr(),ACOSH);
1360      return Data(c);      return Data(c);
1361    }    }
1362  #ifdef _WIN32  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1363    return C_TensorUnaryOperation(*this, escript::acosh_substitute);    return C_TensorUnaryOperation(*this, escript::acosh_substitute);
1364  #else  #else
1365    return C_TensorUnaryOperation(*this, ::acosh);    return C_TensorUnaryOperation(*this, ::acosh);
# Line 1374  Data::atanh() const Line 1374  Data::atanh() const
1374      DataLazy* c=new DataLazy(borrowDataPtr(),ATANH);      DataLazy* c=new DataLazy(borrowDataPtr(),ATANH);
1375      return Data(c);      return Data(c);
1376    }    }
1377  #ifdef _WIN32  #if defined (_WIN32) && !defined(__INTEL_COMPILER)
1378    return C_TensorUnaryOperation(*this, escript::atanh_substitute);    return C_TensorUnaryOperation(*this, escript::atanh_substitute);
1379  #else  #else
1380    return C_TensorUnaryOperation(*this, ::atanh);    return C_TensorUnaryOperation(*this, ::atanh);
# Line 1585  Data::infWorker() const Line 1585  Data::infWorker() const
1585  Data  Data
1586  Data::maxval() const  Data::maxval() const
1587  {  {
1588      if (isLazy())
1589      {
1590        Data temp(*this);   // to get around the fact that you can't resolve a const Data
1591        temp.resolve();
1592        return temp.maxval();
1593      }
1594    //    //
1595    // set the initial maximum value to min possible double    // set the initial maximum value to min possible double
1596    FMax fmax_func;    FMax fmax_func;
# Line 1594  Data::maxval() const Line 1600  Data::maxval() const
1600  Data  Data
1601  Data::minval() const  Data::minval() const
1602  {  {
1603      if (isLazy())
1604      {
1605        Data temp(*this);   // to get around the fact that you can't resolve a const Data
1606        temp.resolve();
1607        return temp.minval();
1608      }
1609    //    //
1610    // set the initial minimum value to max possible double    // set the initial minimum value to max possible double
1611    FMin fmin_func;    FMin fmin_func;
# Line 1662  Data::symmetric() const Line 1674  Data::symmetric() const
1674       }       }
1675       if (isLazy())       if (isLazy())
1676       {       {
1677      Data temp(*this);   // to get around the fact that you can't resolve a const Data      DataLazy* c=new DataLazy(borrowDataPtr(),SYM);
1678      temp.resolve();      return Data(c);
     return temp.symmetric();  
1679       }       }
1680       Data ev(0.,getDataPointShape(),getFunctionSpace());       Data ev(0.,getDataPointShape(),getFunctionSpace());
1681       ev.typeMatchRight(*this);       ev.typeMatchRight(*this);
# Line 1677  Data::nonsymmetric() const Line 1688  Data::nonsymmetric() const
1688  {  {
1689       if (isLazy())       if (isLazy())
1690       {       {
1691      Data temp(*this);   // to get around the fact that you can't resolve a const Data      DataLazy* c=new DataLazy(borrowDataPtr(),NSYM);
1692      temp.resolve();      return Data(c);
     return temp.nonsymmetric();  
1693       }       }
1694       // check input       // check input
1695       DataTypes::ShapeType s=getDataPointShape();       DataTypes::ShapeType s=getDataPointShape();
# Line 1712  Data::nonsymmetric() const Line 1722  Data::nonsymmetric() const
1722       }       }
1723  }  }
1724    
1725    
1726    // Doing a lazy version of this would require some thought.
1727    // First it needs a parameter (which DataLazy doesn't support at the moment).
1728    // (secondly although it does not apply to trace) we can't handle operations which return
1729    // multiple results (like eigenvectors_values) or return values of different shapes to their input
1730    // (like eigenvalues).
1731  Data  Data
1732  Data::trace(int axis_offset) const  Data::trace(int axis_offset) const
1733  {  {

Legend:
Removed from v.2005  
changed lines
  Added in v.2049

  ViewVC Help
Powered by ViewVC 1.1.26