Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/19 16:03:48 (5 years ago)
Author:
mkommend
Message:

#2958: Merged 16266, 16269, 16274, 16276, 16277, 16285, 16286, 16287, 16289, 16293, 16296, 16297, 16298, 16333, 16334 into stable.

Location:
stable
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.ExtLibs

  • stable/HeuristicLab.ExtLibs/HeuristicLab.NativeInterpreter/0.1/NativeInterpreter-0.1/src/interpreter.h

    r16269 r17071  
    22#define NATIVE_TREE_INTERPRETER_CLANG_H
    33
    4 #include <cstring>
    5 #include <vector>
    6 #include <algorithm>
    7 
     4#include "vector_operations.h"
    85#include "instruction.h"
    9 #include "vector_operations.h"
    106
    117inline double evaluate(instruction *code, int len, int row) noexcept
     
    104100                    break;
    105101                }
     102            case OpCodes::Square:
     103                {
     104                    in.value = std::pow(code[in.childIndex].value, 2.);
     105                    break;
     106                }
    106107            case OpCodes::Sqrt:
    107108                {
     
    146147            case OpCodes::Sub:
    147148                {
    148                     load(in.buf, code[in.childIndex].buf);
    149                     for (int j = 1; j < in.narg; ++j)
    150                     {
    151                         sub(in.buf, code[in.childIndex + j].buf);
    152                     }
    153                     if (in.narg == 1)
    154                     {
    155                         neg(in.buf);
     149                    if (in.narg == 1)
     150                    {
     151                        neg(in.buf, code[in.childIndex].buf);
     152                        break;
     153                    }
     154                    else
     155                    {
     156                        load(in.buf, code[in.childIndex].buf);
     157                        for (int j = 1; j < in.narg; ++j)
     158                        {
     159                            sub(in.buf, code[in.childIndex + j].buf);
     160                        }
    156161                    }
    157162                    break;
     
    168173            case OpCodes::Div:
    169174                {
    170                     load(in.buf, code[in.childIndex].buf);
    171                     for (int j = 1; j < in.narg; ++j)
    172                     {
    173                         div(in.buf, code[in.childIndex + j].buf);
    174                     }
    175                     if (in.narg == 1)
    176                     {
    177                         inv(in.buf);
     175                    if (in.narg == 1)
     176                    {
     177                        inv(in.buf, code[in.childIndex].buf);
     178                        break;
     179                    }
     180                    else
     181                    {
     182                        load(in.buf, code[in.childIndex].buf);
     183                        for (int j = 1; j < in.narg; ++j)
     184                        {
     185                            div(in.buf, code[in.childIndex + j].buf);
     186                        }
    178187                    }
    179188                    break;
     
    219228                {
    220229                    square(in.buf, code[in.childIndex].buf);
     230                    break;
     231                }
     232            case OpCodes::Sqrt:
     233                {
     234                    sqrt(in.buf, code[in.childIndex].buf);
    221235                    break;
    222236                }
Note: See TracChangeset for help on using the changeset viewer.