#include "rtc_tools/frame_analyzer/linear_least_squares.h"
#include <math.h>
#include <cstdint>
#include <cstdlib>
#include <functional>
#include <numeric>
#include <type_traits>
#include <utility>
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
namespace webrtc {
namespace test {
Matrix;
namespace {
template <typename R, typename T>
R DotProduct(const std::valarray<T>& a, const std::valarray<T>& b) { … }
template <typename R, typename T>
Matrix<R> MatrixMultiply(const Matrix<T>& a, const Matrix<T>& b) { … }
template <typename T>
Matrix<T> Transpose(const Matrix<T>& matrix) { … }
template <typename R, typename T>
std::valarray<R> ConvertTo(const std::valarray<T>& v) { … }
template <typename R, typename T>
Matrix<R> ConvertTo(const Matrix<T>& mat) { … }
template <typename T>
std::vector<std::vector<T>> ToVectorMatrix(const Matrix<T>& m) { … }
template <typename T>
Matrix<T> FromVectorMatrix(const std::vector<std::vector<T>>& mat) { … }
Matrix<double> GaussianElimination(Matrix<double> matrix_to_invert,
Matrix<double> right_hand_matrix) { … }
}
IncrementalLinearLeastSquares::IncrementalLinearLeastSquares() = default;
IncrementalLinearLeastSquares::~IncrementalLinearLeastSquares() = default;
void IncrementalLinearLeastSquares::AddObservations(
const std::vector<std::vector<uint8_t>>& x,
const std::vector<std::vector<uint8_t>>& y) { … }
std::vector<std::vector<double>>
IncrementalLinearLeastSquares::GetBestSolution() const { … }
}
}