33 #ifndef LIBSAKURA_LIBSAKURA_SAKURA_H_
34 #define LIBSAKURA_LIBSAKURA_SAKURA_H_
39 #include <sys/types.h>
43 #if defined(__GNUC__) || defined(__GNUG__)
44 # define LIBSAKURA_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
46 # define LIBSAKURA_WARN_UNUSED_RESULT
49 #define LIBSAKURA_NOEXCEPT
54 #if __cplusplus >= 201103L
55 # undef LIBSAKURA_NOEXCEPT
56 # define LIBSAKURA_NOEXCEPT noexcept
176 size_t size_required) LIBSAKURA_NOEXCEPT;
191 size_t elements_required) LIBSAKURA_NOEXCEPT;
196 double *
LIBSAKURA_SYMBOL(AlignDouble)(
size_t elements_in_arena,
double *arena,
197 size_t elements_required) LIBSAKURA_NOEXCEPT;
255 size_t num_data,
float const data[],
bool const is_valid[],
265 size_t num_data,
float const data[],
bool const is_valid[],
281 size_t num_data,
bool const is_valid[],
float data[],
282 size_t *new_num_data) LIBSAKURA_NOEXCEPT;
307 size_t num_data,
float const data[],
float new_data[])
367 size_t num_spectra,
size_t start_spectrum,
size_t end_spectrum,
368 bool const spectrum_mask[],
369 double const x[],
double const y[],
370 size_t support,
size_t sampling,
size_t num_polarizations,
371 uint32_t const polarization_map[],
372 size_t num_channels, uint32_t const channel_map[],
375 float const weight[],
bool weight_only,
376 size_t num_convolution_table,
377 float const convolution_table[],
378 size_t num_polarizations_for_grid,
size_t num_channels_for_grid,
379 size_t width,
size_t height,
381 float weight_of_grid[],
419 size_t num_data,
float const data[],
size_t num_condition,
420 float const lower_bounds[],
421 float const upper_bounds[],
bool result[])
428 size_t num_data,
int const data[],
size_t num_condition,
429 int const lower_bounds[],
430 int const upper_bounds[],
bool result[])
468 size_t num_data,
float const data[],
size_t num_condition,
469 float const lower_bounds[],
470 float const upper_bounds[],
bool result[])
477 size_t num_data,
int const data[],
size_t num_condition,
478 int const lower_bounds[],
479 int const upper_bounds[],
bool result[])
507 size_t num_data,
float const data[],
float threshold,
508 bool result[]) LIBSAKURA_NOEXCEPT;
514 size_t num_data,
int const data[],
int threshold,
515 bool result[]) LIBSAKURA_NOEXCEPT;
542 size_t num_data,
float const data[],
float threshold,
543 bool result[]) LIBSAKURA_NOEXCEPT;
549 size_t num_data,
int const data[],
int threshold,
550 bool result[]) LIBSAKURA_NOEXCEPT;
577 size_t num_data,
float const data[],
float threshold,
578 bool result[]) LIBSAKURA_NOEXCEPT;
584 size_t num_data,
int const data[],
int threshold,
585 bool result[]) LIBSAKURA_NOEXCEPT;
612 size_t num_data,
float const data[],
float threshold,
613 bool result[]) LIBSAKURA_NOEXCEPT;
619 size_t num_data,
int const data[],
int threshold,
620 bool result[]) LIBSAKURA_NOEXCEPT;
639 size_t num_data,
float const data[],
640 bool result[]) LIBSAKURA_NOEXCEPT;
657 uint8_t const data[],
bool result[])
664 uint32_t const data[],
bool result[])
683 bool const data[],
bool result[])
722 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
723 bool const edit_mask[], uint8_t result[])
729 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
730 bool const edit_mask[], uint32_t result[])
770 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
771 bool const edit_mask[], uint8_t result[])
777 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
778 bool const edit_mask[], uint32_t result[])
817 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
818 bool const edit_mask[], uint8_t result[])
824 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
825 bool const edit_mask[], uint32_t result[])
856 size_t num_data, uint8_t const data[],
857 bool const edit_mask[], uint8_t result[])
863 size_t num_data, uint32_t const data[],
864 bool const edit_mask[], uint32_t result[])
903 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
904 bool const edit_mask[], uint8_t result[])
910 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
911 bool const edit_mask[], uint32_t result[])
950 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
951 bool const edit_mask[], uint8_t result[])
957 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
958 bool const edit_mask[], uint32_t result[])
1075 uint8_t polynomial_order,
size_t num_base,
1076 double const base_position[],
size_t num_array,
1077 float const base_data[],
1078 bool const base_mask[],
size_t num_interpolated,
1079 double const interpolated_position[],
1080 float interpolated_data[],
1081 bool interpolated_mask[])
1089 uint8_t polynomial_order,
size_t num_base,
1090 double const base_position[],
size_t num_array,
1091 float const base_data[],
1092 bool const base_mask[],
size_t num_interpolated,
1093 double const interpolated_position[],
1094 float interpolated_data[],
1095 bool interpolated_mask[])
1138 size_t num_data,
float const scaling_factor[],
1139 float const data[],
float const reference[],
1140 float result[]) LIBSAKURA_NOEXCEPT;
1179 float scaling_factor,
size_t num_data,
float const data[],
1180 float const reference[],
float result[])
1228 float peak_location,
float kernel_width,
size_t num_kernel,
float kernel[])
1249 size_t num_kernel,
float const kernel[],
1251 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1294 float const kernel[],
size_t num_data,
1295 float const input_data[],
1296 bool const input_mask[],
float output_data[],
1320 size_t num_data,
float const input_data[],
1404 size_t const num_data,
float const data[],
1405 bool const mask[],
size_t const num_model_bases,
1406 double const basis_data[],
1407 size_t const num_lsq_bases,
1408 size_t const use_bases_idx[],
1409 double lsq_matrix[],
1410 double lsq_vector[])
1411 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1483 size_t const num_data,
float const data[],
1484 bool const mask[],
size_t const num_exclude_indices,
1485 size_t const exclude_indices[],
1486 size_t const num_model_bases,
1487 double const basis_data[],
1488 size_t const num_lsq_bases,
1489 size_t const use_bases_idx[],
1490 double lsq_matrix[],
1491 double lsq_vector[])
1492 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1521 size_t num_equations,
1522 double const in_matrix[],
1523 double const in_vector[],
1525 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1560 size_t const num_data,
float const data[],
1561 bool const mask[],
size_t const num_peaks,
1562 double height[],
double err_height[],
1563 double center[],
double err_center[],
1564 double sigma[],
double err_sigma[])
1565 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1608 struct LIBSAKURA_SYMBOL(LSQFitContextFloat);
1635 LIBSAKURA_SYMBOL(LSQFitType) const lsqfit_type, uint16_t order,
size_t num_data,
1659 uint16_t npiece,
size_t num_data,
1684 uint16_t nwave,
size_t num_data,
1772 uint16_t order,
size_t num_data,
float const data[],
1773 bool const mask[],
float clip_threshold_sigma,
1774 uint16_t num_fitting_max,
size_t num_coeff,
double coeff[],
1775 float best_fit[],
float residual[],
1776 bool final_mask[],
float *rms,
1778 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1858 size_t num_pieces,
size_t num_data,
float const data[],
1859 bool const mask[],
float clip_threshold_sigma,
1860 uint16_t num_fitting_max,
double coeff[][4],
1861 float best_fit[],
float residual[],
1862 bool final_mask[],
float *rms,
1865 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1946 size_t num_nwave,
size_t const nwave[],
size_t num_data,
1947 float const data[],
bool const mask[],
1948 float clip_threshold_sigma, uint16_t num_fitting_max,
size_t num_coeff,
1949 double coeff[],
float best_fit[],
1950 float residual[],
bool final_mask[],
float *rms,
1952 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1980 size_t num_data,
float const data[],
size_t num_coeff,
1981 double const coeff[],
float out[])
1982 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2017 size_t num_data,
float const data[],
size_t num_pieces,
2018 double const coeff[][4],
2019 size_t const boundary[],
float out[])
2020 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2058 size_t num_data,
float const data[],
size_t num_nwave,
2059 size_t const nwave[],
size_t num_coeff,
2060 double const coeff[],
float out[])
2061 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2083 uint16_t order,
size_t *num_coeff)
2084 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2131 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2132 float const src[],
float dst[]) LIBSAKURA_NOEXCEPT;
2171 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2172 float const src[],
float dst[]) LIBSAKURA_NOEXCEPT;
2178 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2179 double const src[],
double dst[]) LIBSAKURA_NOEXCEPT;
2185 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2186 double const src[],
double dst[]) LIBSAKURA_NOEXCEPT;
2192 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2193 double const src[][2],
double dst[][2]) LIBSAKURA_NOEXCEPT;
2199 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2200 double const src[][2],
double dst[][2]) LIBSAKURA_NOEXCEPT;
2291 float fraction,
double pixel_size,
size_t num_data,
double const x[],
2292 double const y[],
double const *blc_x,
double const *blc_y,
2293 double const *trc_x,
double const *trc_y,
bool mask[]);
size_t count
number of valid data
Definition: sakura.h:212
#define LIBSAKURA_SYMBOL(x)
Definition: config.h:34
ssize_t index_of_min
index for one of min value.
Definition: sakura.h:232
float min
min value of valid data.
Definition: sakura.h:224
#define LIBSAKURA_NOEXCEPT
Definition: sakura.h:49
double sum
sum of valid data
Definition: sakura.h:216
float max
max value of valid data.
Definition: sakura.h:228
#define LIBSAKURA_WARN_UNUSED_RESULT
Definition: sakura.h:46
double square_sum
sum of squared valid data
Definition: sakura.h:220
ssize_t index_of_max
index for one of max value.
Definition: sakura.h:236