makepp.c 866 B

12345678910111213141516171819202122232425262728293031323334
  1. /* makepp.c */
  2. #include "ransurf.h"
  3. #include "local_proto.h"
  4. double MakePP(int Row, int Col, int OutRows, int OutCols,
  5. double **Randoms, BIGF BigF)
  6. {
  7. int DRow, DCol;
  8. int RRow, RCol;
  9. double Effect, Value;
  10. G_debug(2, "MakePP()");
  11. Value = 0.0;
  12. RRow = Row + BigF.RowPlus;
  13. RCol = Col + BigF.ColPlus;
  14. for (DRow = RRow - BigF.RowPlus; DRow <= RRow + BigF.RowPlus; DRow++) {
  15. /* if( BigF.LowBF this to speed up function */
  16. for (DCol = RCol - BigF.ColPlus; DCol <= RCol + BigF.ColPlus; DCol++) {
  17. DistDecay(&Effect, RRow - DRow, RCol - DCol);
  18. G_debug(3, "(RRow - DRow):%d", RRow - DRow);
  19. G_debug(3, "(RCol - DCol):%d", RCol - DCol);
  20. G_debug(3, "(Effect):%.12lf", Effect);
  21. Value += Effect * Randoms[DRow][DCol];
  22. }
  23. }
  24. return (Value);
  25. }