init_function.hh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //=====================================================
  2. // File : init_function.hh
  3. // Author : L. Plagne <laurent.plagne@edf.fr)>
  4. // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002
  5. //=====================================================
  6. //
  7. // This program is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU General Public License
  9. // as published by the Free Software Foundation; either version 2
  10. // of the License, or (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. // You should have received a copy of the GNU General Public License
  17. // along with this program; if not, write to the Free Software
  18. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. //
  20. #ifndef INIT_FUNCTION_HH
  21. #define INIT_FUNCTION_HH
  22. double simple_function(int index)
  23. {
  24. return index;
  25. }
  26. double simple_function(int index_i, int index_j)
  27. {
  28. return index_i+index_j;
  29. }
  30. double pseudo_random(int /*index*/)
  31. {
  32. return std::rand()/double(RAND_MAX);
  33. }
  34. double pseudo_random(int /*index_i*/, int /*index_j*/)
  35. {
  36. return std::rand()/double(RAND_MAX);
  37. }
  38. double null_function(int /*index*/)
  39. {
  40. return 0.0;
  41. }
  42. double null_function(int /*index_i*/, int /*index_j*/)
  43. {
  44. return 0.0;
  45. }
  46. #endif