Currently job artifacts in CI/CD pipelines on LRZ GitLab never expire. Starting from Wed 26.1.2022 the default expiration time will be 30 days (GitLab default). Currently existing artifacts in already completed jobs will not be affected by the change. The latest artifacts for all jobs in the latest successful pipelines will be kept. More information: https://gitlab.lrz.de/help/user/admin_area/settings/continuous_integration.html#default-artifacts-expiration

sensoroperations.h 2.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
//================================================================================
// Name        : sensoroperations.h
// Author      : Daniele Tafani
// Copyright   : Leibniz Supercomputing Centre
// Description : C++ API for sensor operations.
//================================================================================

//================================================================================
// This file is part of DCDB (DataCenter DataBase)
// Copyright (C) 2018-2019 Leibniz Supercomputing Centre
11
//
12
13
14
15
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
16
//
17
18
19
20
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
21
//
22
23
24
25
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
//================================================================================
26

27
28
29
30
31
32
/**
 * @file sensoroperations.h
 *
 * @ingroup libdcdb
 */

33
34
35
36
#include <stdio.h>
#include <cstdint>
#include <cinttypes>
#include <cstdlib>
37
#include "unitconv.h"
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

#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);
57
    DCDB_OP_RESULT delta(uint64_t lh, uint64_t rh, int64_t* result);
58
59
    DCDB_OP_RESULT derivative(int64_t lhx, int64_t rhx, uint64_t lht, uint64_t rht, int64_t* result, DCDB::Unit unit = DCDB::Unit_None);
    DCDB_OP_RESULT integral(int64_t x, uint64_t lht, uint64_t rht, int64_t* result, DCDB::Unit unit = DCDB::Unit_None);
60
61
62
63
    
} /* End of namespace DCDB */

#endif /* sensoroperations_h */