Free cookie consent management tool by TermsFeed Policy Generator

# Changeset 17227 for branches/3022-FastFunctionExtraction

Ignore:
Timestamp:
09/02/19 16:30:38 (5 years ago)
Message:

Location:
branches/3022-FastFunctionExtraction
Files:
4 edited

Unmodified
Removed
• ## branches/3022-FastFunctionExtraction

• Property svn:global-ignores set to
FFX_Python
• ## branches/3022-FastFunctionExtraction/FFX/BasisFunction.cs

 r17219 ﻿using System; ﻿using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; namespace HeuristicLab.Algorithms.DataAnalysis.FastFunctionExtraction { public enum operators { Abs, Log, Sin, Cos }; class BasisFunction struct BasisFunction { public double _val { get; set; } public string _var { get; set; } public double _exp { get; set; } public operators _op { get; set; } public string Var { get; set; }     // e.g. "Abs(Column1 ** 2)" public double[] Val { get; set; }   // this holds the already calculated values, i.e. the function written in Var public bool IsOperator { get; set; }// alg needs to check if basis function has an operator public NonlinOp Operator { get; } public BasisFunction(string var, double[] val, bool isOperator, NonlinOp op = NonlinOp.None) { this.Var = var; this.Val= val; this.IsOperator = isOperator; this.Operator = op; } public static BasisFunction operator *(BasisFunction a, BasisFunction b) { Debug.Assert(a.Val.Length == b.Val.Length); double[] newVal = new double[a.Val.Length]; for(int i = 0; i < a.Val.Length; i++) { newVal[i] = a.Val[i] * b.Val[i]; } return new BasisFunction(a.Var + " * " + b.Var, newVal, false); } public int Complexity() => 1; public ISymbolicExpressionTree Tree() { return null; } } }