mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-07 08:41:11 +00:00
Imported Healpix, cfitsio, cosmotool. Added cmake tool to build dependencies (cfitsio, hdf5, netcdf, boost, healpix, gsl, ..). Adjusted CMakeLists.txt
This commit is contained in:
parent
4bfb62f177
commit
51f6798f88
241 changed files with 243806 additions and 0 deletions
40
external/cosmotool/src/fixArray.hpp
vendored
Normal file
40
external/cosmotool/src/fixArray.hpp
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
#ifndef __FIX_ARRAY_HPP
|
||||
#define __FIX_ARRAY_HPP
|
||||
|
||||
namespace CosmoTool
|
||||
{
|
||||
|
||||
template <typename T, unsigned int sz> class fixArray
|
||||
{
|
||||
private:
|
||||
T d[sz];
|
||||
|
||||
public:
|
||||
/*! Returns the size of the array. */
|
||||
long size() const { return sz; }
|
||||
|
||||
/*! Returns a reference to element \a #n */
|
||||
template<typename T2> T &operator[] (T2 n) {
|
||||
return d[n];
|
||||
}
|
||||
|
||||
/*! Returns a constant reference to element \a #n */
|
||||
template<typename T2> const T &operator[] (T2 n) const {
|
||||
return d[n];
|
||||
}
|
||||
|
||||
template<typename T2> void importArray(T2 *indata) {
|
||||
for (int i = 0; i < sz; i++)
|
||||
d[i] = indata[i];
|
||||
}
|
||||
|
||||
template<typename T2> void exportArray(T2 *outdata) {
|
||||
for (int i = 0; i < sz; i++)
|
||||
outdata[i] = d[i];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue