/[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

trunk/escript/src/Data.cpp revision 1349 by matt, Wed Nov 21 06:38:08 2007 UTC temp/escript/src/Data.cpp revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC
# Line 922  Data::tan() const Line 922  Data::tan() const
922  Data  Data
923  Data::asin() const  Data::asin() const
924  {  {
925    return C_TensorUnaryOperation(*this, ::asin);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::asin);
926  }  }
927    
928  Data  Data
929  Data::acos() const  Data::acos() const
930  {  {
931    return C_TensorUnaryOperation(*this, ::acos);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::acos);
932  }  }
933    
934    
935  Data  Data
936  Data::atan() const  Data::atan() const
937  {  {
938    return C_TensorUnaryOperation(*this, ::atan);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::atan);
939  }  }
940    
941  Data  Data
942  Data::sinh() const  Data::sinh() const
943  {  {
944      return C_TensorUnaryOperation(*this, ::sinh);      return C_TensorUnaryOperation<double (*)(double)>(*this, ::sinh);
945    
946  }  }
947    
948  Data  Data
949  Data::cosh() const  Data::cosh() const
950  {  {
951      return C_TensorUnaryOperation(*this, ::cosh);      return C_TensorUnaryOperation<double (*)(double)>(*this, ::cosh);
952  }  }
953    
954  Data  Data
955  Data::tanh() const  Data::tanh() const
956  {  {
957      return C_TensorUnaryOperation(*this, ::tanh);      return C_TensorUnaryOperation<double (*)(double)>(*this, ::tanh);
958  }  }
959    
960    
# Line 1001  Data::atanh() const Line 1001  Data::atanh() const
1001  Data  Data
1002  Data::log10() const  Data::log10() const
1003  {  {
1004    return C_TensorUnaryOperation(*this, ::log10);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log10);
1005  }  }
1006    
1007  Data  Data
1008  Data::log() const  Data::log() const
1009  {  {
1010    return C_TensorUnaryOperation(*this, ::log);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::log);
1011  }  }
1012    
1013  Data  Data
# Line 1019  Data::sign() const Line 1019  Data::sign() const
1019  Data  Data
1020  Data::abs() const  Data::abs() const
1021  {  {
1022    return C_TensorUnaryOperation(*this, ::fabs);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::fabs);
1023  }  }
1024    
1025  Data  Data
# Line 1040  Data::pos() const Line 1040  Data::pos() const
1040  Data  Data
1041  Data::exp() const  Data::exp() const
1042  {  {
1043    return C_TensorUnaryOperation(*this, ::exp);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::exp);
1044  }  }
1045    
1046  Data  Data
1047  Data::sqrt() const  Data::sqrt() const
1048  {  {
1049    return C_TensorUnaryOperation(*this, ::sqrt);    return C_TensorUnaryOperation<double (*)(double)>(*this, ::sqrt);
1050  }  }
1051    
1052  double  double
# Line 1514  Data::powO(const boost::python::object& Line 1514  Data::powO(const boost::python::object&
1514  Data  Data
1515  Data::powD(const Data& right) const  Data::powD(const Data& right) const
1516  {  {
1517    return C_TensorBinaryOperation(*this, right, ::pow);    return C_TensorBinaryOperation<double (*)(double, double)>(*this, right, ::pow);
1518  }  }
1519    
1520  //  //
# Line 1768  Data::setTaggedValue(int tagKey, Line 1768  Data::setTaggedValue(int tagKey,
1768    }    }
1769    //    //
1770    // Ensure underlying data object is of type DataTagged    // Ensure underlying data object is of type DataTagged
1771    tag();    if (isConstant()) tag();
   
   if (!isTagged()) {  
     throw DataException("Error - DataTagged conversion failed!!");  
   }  
1772    
1773    numeric::array asNumArray(value);    numeric::array asNumArray(value);
1774    
# Line 1803  Data::setTaggedValueFromCPP(int tagKey, Line 1799  Data::setTaggedValueFromCPP(int tagKey,
1799    }    }
1800    //    //
1801    // Ensure underlying data object is of type DataTagged    // Ensure underlying data object is of type DataTagged
1802    tag();    if (isConstant()) tag();
   
   if (!isTagged()) {  
     throw DataException("Error - DataTagged conversion failed!!");  
   }  
1803    
1804    //    //
1805    // Call DataAbstract::setTaggedValue    // Call DataAbstract::setTaggedValue
# Line 1817  Data::setTaggedValueFromCPP(int tagKey, Line 1809  Data::setTaggedValueFromCPP(int tagKey,
1809  int  int
1810  Data::getTagNumber(int dpno)  Data::getTagNumber(int dpno)
1811  {  {
1812    return m_data->getTagNumber(dpno);    return getFunctionSpace().getTagFromSampleNo(dpno);
1813  }  }
1814    
1815  void  void

Legend:
Removed from v.1349  
changed lines
  Added in v.1387

  ViewVC Help
Powered by ViewVC 1.1.26