4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include "../../../sensor_data.h"
24 float arr1[3] = {1.04, -4.678, -2.34};
26 vect<float> v1(3, arr1);
28 sensor_data<float> sd1(2.0, 3.0, 4.0, 140737488355328);
29 sensor_data<float> sd2(1.04, -4.678, -2.34);
30 sensor_data<float> sd3(0.054, 1.097, 4.456, 140737488355328);
31 sensor_data<float> sd10(v1, 140737488355328);
33 cout << "Constructor tests\n";
34 cout << "input\t" << v1 << "\n";
35 cout << "output\t" << sd10.m_data << "\t" << sd10.m_time_stamp << "\n\n";
36 cout << "input\t" << v1 << "\n";
37 cout << "output\t" << sd2.m_data << "\t" << sd2.m_time_stamp << "\n\n";
40 sensor_data<float> sd4 = sd1 + sd2;
41 cout<< "\n" << sd1.m_data << "\n" << sd2.m_data;
42 cout<< "\nSum:\n" << sd4.m_data << endl;
43 sensor_data<float> sd9 = sd1 + sd10;
44 cout<< "\n" << sd1.m_data << "\n" << sd10.m_data;
45 cout<< "\nSum:\n" << sd9.m_data << endl;
47 cout<< "\n\n\nNormalization:\n";
48 cout<< "\n" << sd3.m_data;
50 cout<< "\nResult:\n" << sd3.m_data << endl;
51 cout<< "\n" << sd2.m_data;
53 cout<< "\nResult:\n" << sd2.m_data << endl;
56 cout<<"\n\n\nScale data:\n";
57 sensor_data<float> sd8 = scale_data(sd2, xx);
58 cout<< "\n" << sd2.m_data << "\n" << xx;
59 cout<< "\nResult:\n" << sd8.m_data << endl;