core
vpdl
vpdt
vpdt_field_default.h
Go to the documentation of this file.
1
// This is core/vpdl/vpdt/vpdt_field_default.h
2
#ifndef vpdt_field_default_h_
3
#define vpdt_field_default_h_
4
//:
5
// \file
6
// \author Matthew Leotta
7
// \brief A type generator for the default types (those used in vpdl)
8
// \date March 5, 2009
9
//
10
// The default field types are scalar, fixed vector, and variable vector
11
// This class acts as an inverse to vpdt_field_traits. From the scalar
12
// type (T) and dimension (n), it produces the default field type according to:
13
// - For n > 1 the field type is vnl_vector_fixed<T,n>
14
// - For n == 1 the field type is T
15
// - For n == 0 the field type is vnl_vector<T>
16
//
17
// The n == 0 indicates that the dimension is dynamic and set at run time.
18
//
19
// \verbatim
20
// Modifications
21
// None
22
// \endverbatim
23
24
#include <
vnl/vnl_vector.h
>
25
#include <
vnl/vnl_vector_fixed.h
>
26
27
28
//: Generate the default field type for scalar type T and dimension n
29
template
<
class
T,
unsigned
int
n=0>
30
struct
vpdt_field_default
31
{
32
//: The default field type
33
typedef
vnl_vector_fixed<T,n>
type
;
34
};
35
36
37
//: Generate the default field type for scalar type T and dimension n
38
template
<
class
T>
39
struct
vpdt_field_default
<T,1>
40
{
41
//: The default field type
42
typedef
T
type
;
43
};
44
45
46
//: Generate the default field type for scalar type T and dimension n
47
template
<
class
T>
48
struct
vpdt_field_default
<T,0>
49
{
50
//: The default field type
51
typedef
vnl_vector<T>
type
;
52
};
53
54
55
#endif // vpdt_field_default_h_
vpdt_field_default< T, 1 >::type
T type
The default field type.
Definition:
vpdt_field_default.h:42
vnl_vector.h
vpdt_field_default< T, 0 >::type
vnl_vector< T > type
The default field type.
Definition:
vpdt_field_default.h:51
vnl_vector
vnl_vector_fixed
vnl_vector_fixed.h
vpdt_field_default
Generate the default field type for scalar type T and dimension n.
Definition:
vpdt_field_default.h:30
vpdt_field_default::type
vnl_vector_fixed< T, n > type
The default field type.
Definition:
vpdt_field_default.h:33
Generated by
1.8.15