Da Vinci Firmware 1
Firmware for the DaVinci-M rocket avionics board.
Loading...
Searching...
No Matches
eml_mtimes_helper.h File Reference

A MATLAB Coder helper for performing element-wise array operations. More...

#include "rtwtypes.h"
#include <stddef.h>
#include <stdlib.h>
Include dependency graph for eml_mtimes_helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

double binary_expand_op (const double in1_data[], const int in1_size[2], const double in2_data[], const int *in2_size, const double in3_data[], const double in4_data[], const int *in4_size, const double in5_data[], const int *in5_size, const double in6_data[], const double in7_data[], const int *in7_size)
 Performs a fused set of element-wise operations for 2D interpolation.
 

Detailed Description

A MATLAB Coder helper for performing element-wise array operations.

Author
Francesco Abate, MSA (Originally generated by MATLAB Coder)
Version
24.2 (MATLAB Coder version)
Date
2024-12-03

This is an auto-generated helper file from MATLAB Coder. Its primary purpose is to provide functions that emulate MATLAB's "binary expansion" (also known as broadcasting) capabilities. This allows for element-wise operations on arrays of different but compatible dimensions without requiring explicit loops in the source code.

In this project, it is used as a low-level utility by the cdEvaluation function to execute the mathematical steps of a 2D bilinear interpolation. Developers should typically not call this function directly.

Definition in file eml_mtimes_helper.h.

Function Documentation

◆ binary_expand_op()

double binary_expand_op ( const double  in1_data[],
const int  in1_size[2],
const double  in2_data[],
const int *  in2_size,
const double  in3_data[],
const double  in4_data[],
const int *  in4_size,
const double  in5_data[],
const int *  in5_size,
const double  in6_data[],
const double  in7_data[],
const int *  in7_size 
)

Performs a fused set of element-wise operations for 2D interpolation.

This function is a highly specific helper generated by MATLAB to efficiently compute a bilinear interpolation step. It combines multiple weighted sums of intermediate values using broadcasting logic.

Parameters
[in]in1_dataArray containing the first weight factor (related to Mach distance).
[in]in1_sizeDimensions of the in1_data array.
[in]in2_dataArray containing the first intermediate interpolated value.
[in]in2_sizePointer to the size of the in2_data array.
[in]in3_dataArray containing the second weight factor (related to Mach distance).
[in]in4_dataArray containing the second intermediate interpolated value.
[in]in4_sizePointer to the size of the in4_data array.
[in]in5_dataArray containing the third intermediate interpolated value.
[in]in5_sizePointer to the size of the in5_data array.
[in]in6_dataArray containing the third weight factor (related to deployment distance).
[in]in7_dataArray containing the fourth intermediate interpolated value.
[in]in7_sizePointer to the size of the in7_data array.
Returns
The final interpolated Coefficient of Drag (Cd), a dimensionless value.

Definition at line 31 of file eml_mtimes_helper.c.

37{
38 double b_in2_data;
39 double in6;
40 double out1;
41 int i;
42 int loop_ub;
43 out1 = in3_data[0];
44 in6 = in6_data[0];
45 if (*in7_size == 1) {
46 if (*in5_size == 1) {
47 if (*in4_size == 1) {
48 loop_ub = *in2_size;
49 } else {
50 loop_ub = *in4_size;
51 }
52 } else {
53 loop_ub = *in5_size;
54 }
55 } else {
56 loop_ub = *in7_size;
57 }
58 for (i = 0; i < loop_ub; i++) {
59 b_in2_data =
60 ((in2_data[0] * out1 + in4_data[0] * out1) + in5_data[0] * in6) +
61 in7_data[0] * in6;
62 }
63 out1 = 0.0;
64 loop_ub = in1_size[1];
65 for (i = 0; i < loop_ub; i++) {
66 out1 += in1_data[0] * b_in2_data;
67 }
68 return out1;
69}

Referenced by cdEvaluation().

Here is the caller graph for this function: