NASA Logo
Ocean Color Science Software

ocssw V2022
NVector.hpp
Go to the documentation of this file.
1 #ifndef FOCS_NVECTOR_HPP
2 #define FOCS_NVECTOR_HPP
3 namespace focs {
4 template <typename T, size_t Dims>
5 struct NVector {
6  typedef std::vector<typename NVector<T, Dims - 1>::type> type;
7  int dimensions = Dims;
8 };
9 template <typename T>
10 struct NVector<T, 0> {
11  typedef T type;
12 };
13 } // namespace focs
14 // usage: NVector<2, double>::type == 2D vector of doubles
15 #endif // FOCS_NVECTOR_HPP
float * vector(long nl, long nh)
Definition: nrutil.c:15
std::vector< typename NVector< T, Dims - 1 >::type > type
Definition: NVector.hpp:6
int dimensions
Definition: NVector.hpp:7