2
0

Hedge.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright 2010 Juan Rada-Vilela
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. */
  12. /*
  13. * Hedge.cpp
  14. *
  15. * Created on: Dec 13, 2009
  16. * Author: jcrada
  17. */
  18. #include "Hedge.h"
  19. namespace fl {
  20. Hedge::~Hedge() {
  21. }
  22. std::string HedgeNot::name() const {
  23. return "not";
  24. }
  25. flScalar HedgeNot::hedge(flScalar mu) const {
  26. return 1 - mu;
  27. }
  28. std::string HedgeSomewhat::name() const {
  29. return "somewhat";
  30. }
  31. flScalar HedgeSomewhat::hedge(flScalar mu) const {
  32. return sqrt(mu);
  33. }
  34. std::string HedgeVery::name() const {
  35. return "very";
  36. }
  37. flScalar HedgeVery::hedge(flScalar mu) const {
  38. return mu * mu;
  39. }
  40. std::string HedgeAny::name() const {
  41. return "any";
  42. }
  43. flScalar HedgeAny::hedge(flScalar mu) const {
  44. return 1.0;
  45. }
  46. }