| 431 | } |
| 432 | |
| 433 | virtual void GenerateCode(Code &code, FlatArray<int> inputs, int index) const override { |
| 434 | |
| 435 | if (consistent) |
| 436 | throw Exception("consistent tangent does not support Compile(True) yet"); |
| 437 | |
| 438 | string miptype; |
| 439 | if(code.is_simd) |
| 440 | miptype = "SIMD<DimMappedIntegrationPoint<"+ToLiteral(D)+">>*"; |
| 441 | else |
| 442 | miptype = "DimMappedIntegrationPoint<"+ToLiteral(D)+">*"; |
| 443 | auto tv_expr = CodeExpr("static_cast<const "+miptype+">(&ip)->GetTV()"); |
| 444 | auto tv = Var("tmp", index); |
| 445 | code.body += tv.Assign(tv_expr); |
| 446 | |
| 447 | code.Declare (index, this->Dimensions(), this->IsComplex()); |
| 448 | for( int i : Range(D)) |
| 449 | code.body += Var(index,i).Assign(tv(i), false); |
| 450 | } |
| 451 | |
| 452 | using CoefficientFunctionNoDerivative::Evaluate; |
| 453 | virtual void Evaluate (const SIMD_BaseMappedIntegrationRule & ir, BareSliceMatrix<SIMD<double>> values) const override |