You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tthe C# Array "Double[]" of double type is treated as pointers to array of pointers to double. For example, a[i] (in C#) would be converted to *(a->GetData(i)) instead of a->GetData(i). After adding "double" as a fundamental type in Lib/src/public/System/support/internal/TypeTraits.h, only some of the cases are handled correctly while others are still not correct.
C# Code Example:
...
// Initialize Gaussian data lists
gauss_h = new Double[fit.num_gauss];
gauss_h_cross = new Double[fit.num_gauss];
gauss_p = new Double[fit.num_gauss];
gauss_p_init = new Double[fit.num_gauss];
for (i = 0; i < fit.num_gauss; i++)
{
vec.error_position[i] = Math.Abs(gauss_p_init[i] - gauss_p[i]) >= extend.peak_diff_cutoff;
}
// Determine the cross-normalized peak heights
for (i = 0; i < fit.num_gauss; i++)
{
vec.normalized_cross_height[i] = (CROSS_COEFF * metric_cross * Math.Abs(gauss_h[i])) + (metric * Math.Abs(gauss_h_cross[i]));
vec.normalized_cross_height[i] /= (CROSS_COEFF * metric_cross) + metric;
}
...
C++ output:
...
Array* array = new Array((int)(fit->num_gauss));
Array* array2 = new Array((int)(fit->num_gauss));
Array* array3 = new Array((int)(fit->num_gauss));
Array* array4 = new Array((int)(fit->num_gauss));
for (uint num = 0u; num < (uint)(fit->num_gauss); num += 1u) {
vec->error_position->SetData((int)(num), Math::Abs(*(array4->GetData((int)(num))) - *(array3->GetData((int)(num)))) >= extend->peak_diff_cutoff);
}
for (uint num = 0u; num < (uint)(fit->num_gauss); num += 1u) {
vec->normalized_cross_height->SetData((int)(num), ((5.0 * metric_cross) * Math::Abs(array->GetData((int)(num)))) + (metric * Math::Abs(array2->GetData((int)(num)))));
vec->normalized_cross_height->SetData((int)(num), (5.0 * metric_cross) + metric);
}
...
The text was updated successfully, but these errors were encountered:
Tthe C# Array "Double[]" of double type is treated as pointers to array of pointers to double. For example, a[i] (in C#) would be converted to *(a->GetData(i)) instead of a->GetData(i). After adding "double" as a fundamental type in Lib/src/public/System/support/internal/TypeTraits.h, only some of the cases are handled correctly while others are still not correct.
C# Code Example:
...
// Initialize Gaussian data lists
gauss_h = new Double[fit.num_gauss];
gauss_h_cross = new Double[fit.num_gauss];
gauss_p = new Double[fit.num_gauss];
gauss_p_init = new Double[fit.num_gauss];
for (i = 0; i < fit.num_gauss; i++)
{
vec.error_position[i] = Math.Abs(gauss_p_init[i] - gauss_p[i]) >= extend.peak_diff_cutoff;
}
...
C++ output:
...
Array* array = new Array((int)(fit->num_gauss));
Array* array2 = new Array((int)(fit->num_gauss));
Array* array3 = new Array((int)(fit->num_gauss));
Array* array4 = new Array((int)(fit->num_gauss));
for (uint num = 0u; num < (uint)(fit->num_gauss); num += 1u) {
vec->error_position->SetData((int)(num), Math::Abs(*(array4->GetData((int)(num))) - *(array3->GetData((int)(num)))) >= extend->peak_diff_cutoff);
}
for (uint num = 0u; num < (uint)(fit->num_gauss); num += 1u) {
vec->normalized_cross_height->SetData((int)(num), ((5.0 * metric_cross) * Math::Abs(array->GetData((int)(num)))) + (metric * Math::Abs(array2->GetData((int)(num)))));
vec->normalized_cross_height->SetData((int)(num), (5.0 * metric_cross) + metric);
}
...
The text was updated successfully, but these errors were encountered: