00001 // SquareRootParameterFilter.cpp: implementation of the CSquareRootParameterFilter class. 00002 // 00004 00005 #include "SquareRootParameterFilter.h" 00006 00008 // Construction/Destruction 00010 00011 CSquareRootParameterFilter::CSquareRootParameterFilter() 00012 { 00013 00014 } 00015 00016 CSquareRootParameterFilter::~CSquareRootParameterFilter() 00017 { 00018 00019 } 00020 00021 double CSquareRootParameterFilter::Operator(double operand) 00022 { 00023 if(operand < 0.0) 00024 { 00025 throw std::runtime_error("ERROR: Square root of negative number"); 00026 } 00027 else 00028 { 00029 return sqrt(operand); 00030 } 00031 } 00032 00033 double CSquareRootParameterFilter::OperatorInverse(double operand) 00034 { 00035 return operand*operand; 00036 }