File: shape2.hpp

package info (click to toggle)
frugally-deep 0.18.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,036 kB
  • sloc: cpp: 6,680; python: 1,262; makefile: 4; sh: 1
file content (42 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2016, Tobias Hermann.
// https://github.com/Dobiasd/frugally-deep
// Distributed under the MIT License.
// (See accompanying LICENSE file or at
//  https://opensource.org/licenses/MIT)

#pragma once

#include "fdeep/common.hpp"

#include <cstddef>
#include <cstdlib>
#include <string>

namespace fdeep {
namespace internal {

    class shape2 {
    public:
        explicit shape2(
            std::size_t height,
            std::size_t width)
            : height_(height)
            , width_(width)
        {
        }
        std::size_t area() const
        {
            return height_ * width_;
        }

        std::size_t height_;
        std::size_t width_;
    };

    inline bool operator==(const shape2& lhs, const shape2& rhs)
    {
        return lhs.height_ == rhs.height_ && lhs.width_ == rhs.width_;
    }

}
}