LCOV - code coverage report
Current view: top level - src/common/optimization/src - utils.cpp (source / functions) Hit Total Coverage
Test: lcov.total.filtered Lines: 20 20 100.0 %
Date: 2021-01-26 05:02:50 Functions: 9 9 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 6 6 100.0 %

           Branch data     Line data    Source code
       1                 :            : // Copyright 2019 the Autoware Foundation
       2                 :            : //
       3                 :            : // Licensed under the Apache License, Version 2.0 (the "License");
       4                 :            : // you may not use this file except in compliance with the License.
       5                 :            : // You may obtain a copy of the License at
       6                 :            : //
       7                 :            : //     http://www.apache.org/licenses/LICENSE-2.0
       8                 :            : //
       9                 :            : // Unless required by applicable law or agreed to in writing, software
      10                 :            : // distributed under the License is distributed on an "AS IS" BASIS,
      11                 :            : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      12                 :            : // See the License for the specific language governing permissions and
      13                 :            : // limitations under the License.
      14                 :            : //
      15                 :            : // Co-developed by Tier IV, Inc. and Apex.AI, Inc.
      16                 :            : 
      17                 :            : #include <common/types.hpp>
      18                 :            : #include <optimization/utils.hpp>
      19                 :            : 
      20                 :            : using autoware::common::types::bool8_t;
      21                 :            : 
      22                 :            : namespace autoware
      23                 :            : {
      24                 :            : namespace common
      25                 :            : {
      26                 :            : namespace optimization
      27                 :            : {
      28                 :          3 : ComputeMode::ComputeMode(bool8_t score, bool8_t jacobian, bool8_t hessian)
      29                 :          3 : : m_score(score), m_jacobian(jacobian), m_hessian(hessian) {}
      30                 :            : 
      31                 :        309 : ComputeMode & ComputeMode::set_score() noexcept
      32                 :            : {
      33                 :        309 :   m_score = true;
      34                 :        309 :   return *this;
      35                 :            : }
      36                 :        489 : ComputeMode & ComputeMode::set_jacobian() noexcept
      37                 :            : {
      38                 :        489 :   m_jacobian = true;
      39                 :        489 :   return *this;
      40                 :            : }
      41                 :        242 : ComputeMode & ComputeMode::set_hessian() noexcept
      42                 :            : {
      43                 :        242 :   m_hessian = true;
      44                 :        242 :   return *this;
      45                 :            : }
      46                 :            : 
      47                 :      38559 : bool8_t ComputeMode::score() const noexcept {return m_score;}
      48                 :     276027 : bool8_t ComputeMode::jacobian() const noexcept {return m_jacobian;}
      49                 :     242539 : bool8_t ComputeMode::hessian() const noexcept {return m_hessian;}
      50                 :         60 : bool8_t ComputeMode::operator==(const ComputeMode & other) const noexcept
      51                 :            : {
      52         [ +  + ]:        100 :   return (m_score == other.score()) &&
      53   [ +  +  +  + ]:         85 :          (m_jacobian == other.jacobian()) &&
      54                 :         25 :          (m_hessian == other.hessian());
      55                 :            : }
      56                 :         60 : bool8_t ComputeMode::operator!=(const ComputeMode & other) const noexcept
      57                 :            : {
      58                 :         60 :   return !(*this == other);
      59                 :            : }
      60                 :            : 
      61                 :            : }  // namespace optimization
      62                 :            : }  // namespace common
      63                 :            : }  // namespace autoware

Generated by: LCOV version 1.14