427 |
Data |
Data |
428 |
Data::oneOver() const |
Data::oneOver() const |
429 |
{ |
{ |
430 |
return escript::unaryOp(*this,bind1st(divides<double>(),1.)); |
return C_TensorUnaryOperation(*this, bind1st(divides<double>(),1.)); |
431 |
} |
} |
432 |
|
|
433 |
Data |
Data |
434 |
Data::wherePositive() const |
Data::wherePositive() const |
435 |
{ |
{ |
436 |
return escript::unaryOp(*this,bind2nd(greater<double>(),0.0)); |
return C_TensorUnaryOperation(*this, bind2nd(greater<double>(),0.0)); |
437 |
} |
} |
438 |
|
|
439 |
Data |
Data |
440 |
Data::whereNegative() const |
Data::whereNegative() const |
441 |
{ |
{ |
442 |
return escript::unaryOp(*this,bind2nd(less<double>(),0.0)); |
return C_TensorUnaryOperation(*this, bind2nd(less<double>(),0.0)); |
443 |
} |
} |
444 |
|
|
445 |
Data |
Data |
446 |
Data::whereNonNegative() const |
Data::whereNonNegative() const |
447 |
{ |
{ |
448 |
return escript::unaryOp(*this,bind2nd(greater_equal<double>(),0.0)); |
return C_TensorUnaryOperation(*this, bind2nd(greater_equal<double>(),0.0)); |
449 |
} |
} |
450 |
|
|
451 |
Data |
Data |
452 |
Data::whereNonPositive() const |
Data::whereNonPositive() const |
453 |
{ |
{ |
454 |
return escript::unaryOp(*this,bind2nd(less_equal<double>(),0.0)); |
return C_TensorUnaryOperation(*this, bind2nd(less_equal<double>(),0.0)); |
455 |
} |
} |
456 |
|
|
457 |
Data |
Data |
458 |
Data::whereZero(double tol) const |
Data::whereZero(double tol) const |
459 |
{ |
{ |
460 |
Data dataAbs=abs(); |
Data dataAbs=abs(); |
461 |
return escript::unaryOp(dataAbs,bind2nd(less_equal<double>(),tol)); |
return C_TensorUnaryOperation(dataAbs, bind2nd(less_equal<double>(),tol)); |
462 |
} |
} |
463 |
|
|
464 |
Data |
Data |
465 |
Data::whereNonZero(double tol) const |
Data::whereNonZero(double tol) const |
466 |
{ |
{ |
467 |
Data dataAbs=abs(); |
Data dataAbs=abs(); |
468 |
return escript::unaryOp(dataAbs,bind2nd(greater<double>(),tol)); |
return C_TensorUnaryOperation(dataAbs, bind2nd(greater<double>(),tol)); |
469 |
} |
} |
470 |
|
|
471 |
Data |
Data |
904 |
Data |
Data |
905 |
Data::sin() const |
Data::sin() const |
906 |
{ |
{ |
907 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sin); |
return C_TensorUnaryOperation(*this, ::sin); |
908 |
} |
} |
909 |
|
|
910 |
Data |
Data |
911 |
Data::cos() const |
Data::cos() const |
912 |
{ |
{ |
913 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cos); |
return C_TensorUnaryOperation(*this, ::cos); |
914 |
} |
} |
915 |
|
|
916 |
Data |
Data |
917 |
Data::tan() const |
Data::tan() const |
918 |
{ |
{ |
919 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tan); |
return C_TensorUnaryOperation(*this, ::tan); |
920 |
} |
} |
921 |
|
|
922 |
Data |
Data |
923 |
Data::asin() const |
Data::asin() const |
924 |
{ |
{ |
925 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asin); |
return C_TensorUnaryOperation(*this, ::asin); |
926 |
} |
} |
927 |
|
|
928 |
Data |
Data |
929 |
Data::acos() const |
Data::acos() const |
930 |
{ |
{ |
931 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acos); |
return C_TensorUnaryOperation(*this, ::acos); |
932 |
} |
} |
933 |
|
|
934 |
|
|
935 |
Data |
Data |
936 |
Data::atan() const |
Data::atan() const |
937 |
{ |
{ |
938 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atan); |
return C_TensorUnaryOperation(*this, ::atan); |
939 |
} |
} |
940 |
|
|
941 |
Data |
Data |
942 |
Data::sinh() const |
Data::sinh() const |
943 |
{ |
{ |
944 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sinh); |
return C_TensorUnaryOperation(*this, ::sinh); |
945 |
|
|
946 |
} |
} |
947 |
|
|
948 |
Data |
Data |
949 |
Data::cosh() const |
Data::cosh() const |
950 |
{ |
{ |
951 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::cosh); |
return C_TensorUnaryOperation(*this, ::cosh); |
952 |
} |
} |
953 |
|
|
954 |
Data |
Data |
955 |
Data::tanh() const |
Data::tanh() const |
956 |
{ |
{ |
957 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::tanh); |
return C_TensorUnaryOperation(*this, ::tanh); |
958 |
} |
} |
959 |
|
|
960 |
|
|
964 |
#ifdef _WIN32 |
#ifdef _WIN32 |
965 |
throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms."); |
throw DataException("Error - Data:: erf function is not supported on _WIN32 platforms."); |
966 |
#else |
#else |
967 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::erf); |
return C_TensorUnaryOperation(*this, ::erf); |
968 |
#endif |
#endif |
969 |
} |
} |
970 |
|
|
972 |
Data::asinh() const |
Data::asinh() const |
973 |
{ |
{ |
974 |
#ifdef _WIN32 |
#ifdef _WIN32 |
975 |
return escript::unaryOp(*this,escript::asinh_substitute); |
return C_TensorUnaryOperation(*this, escript::asinh_substitute); |
976 |
#else |
#else |
977 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::asinh); |
return C_TensorUnaryOperation(*this, ::asinh); |
978 |
#endif |
#endif |
979 |
} |
} |
980 |
|
|
982 |
Data::acosh() const |
Data::acosh() const |
983 |
{ |
{ |
984 |
#ifdef _WIN32 |
#ifdef _WIN32 |
985 |
return escript::unaryOp(*this,escript::acosh_substitute); |
return C_TensorUnaryOperation(*this, escript::acosh_substitute); |
986 |
#else |
#else |
987 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::acosh); |
return C_TensorUnaryOperation(*this, ::acosh); |
988 |
#endif |
#endif |
989 |
} |
} |
990 |
|
|
992 |
Data::atanh() const |
Data::atanh() const |
993 |
{ |
{ |
994 |
#ifdef _WIN32 |
#ifdef _WIN32 |
995 |
return escript::unaryOp(*this,escript::atanh_substitute); |
return C_TensorUnaryOperation(*this, escript::atanh_substitute); |
996 |
#else |
#else |
997 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::atanh); |
return C_TensorUnaryOperation(*this, ::atanh); |
998 |
#endif |
#endif |
999 |
} |
} |
1000 |
|
|
1001 |
Data |
Data |
1002 |
Data::log10() const |
Data::log10() const |
1003 |
{ |
{ |
1004 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log10); |
return C_TensorUnaryOperation(*this, ::log10); |
1005 |
} |
} |
1006 |
|
|
1007 |
Data |
Data |
1008 |
Data::log() const |
Data::log() const |
1009 |
{ |
{ |
1010 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::log); |
return C_TensorUnaryOperation(*this, ::log); |
1011 |
} |
} |
1012 |
|
|
1013 |
Data |
Data |
1014 |
Data::sign() const |
Data::sign() const |
1015 |
{ |
{ |
1016 |
return escript::unaryOp(*this,escript::fsign); |
return C_TensorUnaryOperation(*this, escript::fsign); |
1017 |
} |
} |
1018 |
|
|
1019 |
Data |
Data |
1020 |
Data::abs() const |
Data::abs() const |
1021 |
{ |
{ |
1022 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::fabs); |
return C_TensorUnaryOperation(*this, ::fabs); |
1023 |
} |
} |
1024 |
|
|
1025 |
Data |
Data |
1026 |
Data::neg() const |
Data::neg() const |
1027 |
{ |
{ |
1028 |
return escript::unaryOp(*this,negate<double>()); |
return C_TensorUnaryOperation(*this, negate<double>()); |
1029 |
} |
} |
1030 |
|
|
1031 |
Data |
Data |
1040 |
Data |
Data |
1041 |
Data::exp() const |
Data::exp() const |
1042 |
{ |
{ |
1043 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::exp); |
return C_TensorUnaryOperation(*this, ::exp); |
1044 |
} |
} |
1045 |
|
|
1046 |
Data |
Data |
1047 |
Data::sqrt() const |
Data::sqrt() const |
1048 |
{ |
{ |
1049 |
return escript::unaryOp(*this,(Data::UnaryDFunPtr)::sqrt); |
return C_TensorUnaryOperation(*this, ::sqrt); |
1050 |
} |
} |
1051 |
|
|
1052 |
double |
double |
1511 |
return powD(tmp); |
return powD(tmp); |
1512 |
} |
} |
1513 |
|
|
|
/* Data */ |
|
|
/* Data::powD(const Data& right) const */ |
|
|
/* { */ |
|
|
/* Data result; */ |
|
|
/* if (getDataPointRank()<right.getDataPointRank()) { */ |
|
|
/* result.copy(right); */ |
|
|
/* result.binaryOp(*this,escript::rpow); */ |
|
|
/* } else { */ |
|
|
/* result.copy(*this); */ |
|
|
/* result.binaryOp(right,(Data::BinaryDFunPtr)::pow); */ |
|
|
/* } */ |
|
|
/* return result; */ |
|
|
/* } */ |
|
|
|
|
1514 |
Data |
Data |
1515 |
Data::powD(const Data& right) const |
Data::powD(const Data& right) const |
1516 |
{ |
{ |