// // sensoroperations.hpp // dcdb // // Created by Tafani, Daniele on 13.04.18. // Copyright © 2018 LRZ. All rights reserved. // #include #include #include #include #ifndef sensoroperations_h #define sensoroperations_h namespace DCDB { typedef enum { DCDB_OP_SUCCESS, DCDB_OP_OVERFLOW, DCDB_OP_DIVISION_BY_ZERO, DCDB_OP_UNKNOWN, } DCDB_OP_RESULT; DCDB_OP_RESULT safeAdd(int64_t lh, int64_t rh, int64_t* result); DCDB_OP_RESULT safeMult(int64_t lh, int64_t rh, int64_t* result); DCDB_OP_RESULT safeMult(double lh, double rh, int64_t* result); DCDB_OP_RESULT scale(int64_t* result, double scalingFactor, double baseScalingFactor); DCDB_OP_RESULT delta(int64_t lh, int64_t rh, int64_t* result); DCDB_OP_RESULT delta(uint64_t lh, uint64_t rh, int64_t* result); DCDB_OP_RESULT derivative(int64_t lhx, int64_t rhx, uint64_t lht, uint64_t rht, int64_t* result); DCDB_OP_RESULT integral(int64_t lhx, int64_t rhx, uint64_t lht, uint64_t rht, int64_t* result); } /* End of namespace DCDB */ #endif /* sensoroperations_h */