1/* 2 * Copyright (c) 2016 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 30 unchanged lines hidden (view full) --- 39 40#include "sim/mathexpr.hh" 41 42#include <algorithm> 43#include <cmath> 44#include <regex> 45#include <string> 46 |
47#include "base/logging.hh" |
48 49MathExpr::MathExpr(std::string expr) 50 : ops( 51 std::array<OpSearch, uNeg + 1> {{ 52 OpSearch {true, bAdd, 0, '+', [](double a, double b) { return a + b; }}, 53 OpSearch {true, bSub, 0, '-', [](double a, double b) { return a - b; }}, 54 OpSearch {true, bMul, 1, '*', [](double a, double b) { return a * b; }}, 55 OpSearch {true, bDiv, 1, '/', [](double a, double b) { return a / b; }}, --- 123 unchanged lines hidden --- |