- Timestamp:
- 11/12/18 14:54:12 (6 years ago)
- Location:
- trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/BatchOperations.cs
r16287 r16293 64 64 a[i] = Math.Cos(b[i]); 65 65 } 66 67 public static void Tan(double[] a, double[] b) { 68 for (int i = 0; i < BATCHSIZE; ++i) 69 a[i] = Math.Tan(b[i]); 70 } 71 72 public static void Pow(double[] a, double[] b) { 73 for (int i = 0; i < BATCHSIZE; ++i) 74 a[i] = Math.Pow(a[i], Math.Round(b[i])); 75 } 76 77 public static void Root(double[] a, double[] b) { 78 for (int i = 0; i < BATCHSIZE; ++i) 79 a[i] = Math.Pow(a[i], 1 / Math.Round(b[i])); 80 } 81 82 public static void Square(double[] a, double[] b) { 83 for (int i = 0; i < BATCHSIZE; ++i) 84 a[i] = Math.Pow(b[i], 2d); 85 } 86 87 public static void Sqrt(double[] a, double[] b) { 88 for (int i = 0; i < BATCHSIZE; ++i) 89 a[i] = Math.Sqrt(b[i]); 90 } 66 91 } 67 92 } -
trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionTreeBatchInterpreter.cs
r16287 r16293 65 65 break; 66 66 } 67 67 68 case OpCodes.Add: { 68 69 Load(instr.buf, code[c].buf); … … 76 77 if (n == 1) { 77 78 Neg(instr.buf, code[c].buf); 78 break;79 79 } else { 80 80 Load(instr.buf, code[c].buf); … … 82 82 Sub(instr.buf, code[c + j].buf); 83 83 } 84 break;85 }84 } 85 break; 86 86 } 87 87 … … 97 97 if (n == 1) { 98 98 Inv(instr.buf, code[c].buf); 99 break;100 99 } else { 101 100 Load(instr.buf, code[c].buf); … … 103 102 Div(instr.buf, code[c + j].buf); 104 103 } 105 break; 106 } 104 } 105 break; 106 } 107 108 case OpCodes.Square: { 109 Square(instr.buf, code[c].buf); 110 break; 111 } 112 113 case OpCodes.Root: { 114 Root(instr.buf, code[c].buf); 115 break; 116 } 117 118 case OpCodes.SquareRoot: { 119 Sqrt(instr.buf, code[c].buf); 120 break; 121 } 122 123 case OpCodes.Power: { 124 Pow(instr.buf, code[c].buf); 125 break; 107 126 } 108 127 … … 114 133 case OpCodes.Log: { 115 134 Log(instr.buf, code[c].buf); 135 break; 136 } 137 138 case OpCodes.Sin: { 139 Sin(instr.buf, code[c].buf); 140 break; 141 } 142 143 case OpCodes.Cos: { 144 Cos(instr.buf, code[c].buf); 145 break; 146 } 147 148 case OpCodes.Tan: { 149 Tan(instr.buf, code[c].buf); 116 150 break; 117 151 } … … 139 173 140 174 return result; 175 } 176 177 public IEnumerable<double> GetSymbolicExpressionTreeValues(ISymbolicExpressionTree tree, IDataset dataset, int[] rows) { 178 return GetValues(tree, dataset, rows); 141 179 } 142 180
Note: See TracChangeset
for help on using the changeset viewer.