Apollo
10.0
自动驾驶开放平台
polynomial.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2018 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
#pragma once
17
18
#include <iostream>
19
#include <map>
20
#include <vector>
21
22
namespace
apollo
{
23
namespace
perception {
24
namespace
base {
25
26
class
Polynomial
{
27
public
:
28
Polynomial
();
29
~Polynomial
();
30
double
&
operator[]
(
const
uint32_t& order);
31
// sum(coeff_[i] * x^i)
32
double
operator()
(
const
double
& x);
33
34
const
std::map<uint32_t, double>&
getCoeff
()
const
;
35
36
private
:
37
std::map<uint32_t, double> coeff_;
38
std::vector<uint32_t> index_gap_;
39
std::map<uint32_t, double> power_cache_;
40
bool
initialized_ =
false
;
41
};
42
43
std::ostream&
operator<<
(std::ostream& o,
const
Polynomial
& p);
44
45
}
// namespace base
46
}
// namespace perception
47
}
// namespace apollo
apollo::perception::base::Polynomial
Definition
polynomial.h:26
apollo::perception::base::Polynomial::getCoeff
const std::map< uint32_t, double > & getCoeff() const
Definition
polynomial.cc:25
apollo::perception::base::Polynomial::Polynomial
Polynomial()
Definition
polynomial.cc:22
apollo::perception::base::Polynomial::~Polynomial
~Polynomial()
Definition
polynomial.cc:23
apollo::perception::base::Polynomial::operator()
double operator()(const double &x)
Definition
polynomial.cc:34
apollo::perception::base::Polynomial::operator[]
double & operator[](const uint32_t &order)
Definition
polynomial.cc:29
apollo::perception::base::operator<<
std::ostream & operator<<(std::ostream &o, const Polynomial &p)
Definition
polynomial.cc:71
apollo
class register implement
Definition
arena_queue.h:37
modules
perception
common
base
polynomial.h