OTB  6.7.0
Orfeo Toolbox
otbMachineLearningModelTraits.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 
22 #ifndef otbMachineLearningModelTraits_h
23 #define otbMachineLearningModelTraits_h
24 
25 
27 #include "itkFixedArray.h"
28 #include "itkIsNumber.h"
30 
31 namespace otb
32 {
33 
45 template <typename TInput, typename isNumber> struct MLMSampleTraitsImpl;
46 
47 
49 // For Numbers
50 template <typename TInput> struct MLMSampleTraitsImpl<TInput, itk::mpl::TrueType> {
51  typedef TInput ValueType;
53 };
54 
55 // For Vectors
56 template <typename TInput> struct MLMSampleTraitsImpl<TInput, itk::mpl::FalseType> {
57  typedef typename TInput::ValueType ValueType;
58  typedef TInput SampleType;
59 };
61 
66 
67 
79 template <typename TInput, typename isNumber> struct MLMTargetTraitsImpl;
80 
81 
83 // For Numbers
84 template <typename TInput> struct MLMTargetTraitsImpl<TInput, itk::mpl::TrueType> {
85  typedef TInput ValueType;
87 };
88 
89 // For Vectors
90 template <typename TInput> struct MLMTargetTraitsImpl<TInput, itk::mpl::FalseType> {
91  typedef typename TInput::ValueType ValueType;
92  typedef TInput SampleType;
93 };
95 
100 
101 
102 } // End namespace otb
103 
104 #endif
std::vector< double > SampleType