Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
multigrid.cpp File Reference
#include "multigrid.h"
#include <iostream>
Include dependency graph for multigrid.cpp:

Go to the source code of this file.

Functions

size_t power (size_t a, size_t b)
 

Function Documentation

size_t power ( size_t  a,
size_t  b 
)
inline

Definition at line 5 of file multigrid.cpp.

References pow().

Referenced by MultiGrid< NDIM, T >::MultiGrid().

5  {
6  size_t res = 1;
7  for(size_t i = 0; i < b; i++) {
8  res *= a;
9  }
10 #ifdef _BOUNDSCHECK
11  assert( (pow(1.0*a,1.0*b) - double(res)) < 0.5);
12 #endif
13  return res;
14 }
float pow(float base, unsigned long int exp)
Definition: precision.hpp:39