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
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[],
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,
514 size_t num_data,
int const data[],
int threshold,
542 size_t num_data,
float const data[],
float threshold,
549 size_t num_data,
int const data[],
int threshold,
577 size_t num_data,
float const data[],
float threshold,
584 size_t num_data,
int const data[],
int threshold,
612 size_t num_data,
float const data[],
float threshold,
619 size_t num_data,
int const data[],
int threshold,
639 size_t num_data,
float const data[],
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[],
1179 float scaling_factor,
size_t num_data,
float const data[],
1180 float const reference[],
float result[])
1186 struct LIBSAKURA_SYMBOL(Convolve1DContextFloat);
1228 float peak_location,
float kernel_width,
size_t num_kernel,
float kernel[])
1249 size_t num_kernel,
float const kernel[],
1250 struct LIBSAKURA_SYMBOL(Convolve1DContextFloat) **context)
1294 float const kernel[],
size_t num_data,
1295 float const input_data[],
1296 bool const input_mask[],
float output_data[],
1319 struct LIBSAKURA_SYMBOL(Convolve1DContextFloat) const *context,
1320 size_t num_data,
float const input_data[],
1332 struct LIBSAKURA_SYMBOL(Convolve1DContextFloat) *context)
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[])
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[])
1521 size_t num_equations,
1522 double const in_matrix[],
1523 double const in_vector[],
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[])
1608 struct LIBSAKURA_SYMBOL(LSQFitContextFloat);
1636 LIBSAKURA_SYMBOL(LSQFitType)
const lsqfit_type, uint16_t order,
size_t num_data,
1637 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) **context)
1661 uint16_t npiece,
size_t num_data,
1662 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) **context)
1687 uint16_t nwave,
size_t num_data,
1688 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) **context)
1702 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) *context)
1774 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
1775 uint16_t order,
size_t num_data,
float const data[],
1776 bool const mask[],
float clip_threshold_sigma,
1777 uint16_t num_fitting_max,
size_t num_coeff,
double coeff[],
1778 float best_fit[],
float residual[],
1779 bool final_mask[],
float *rms,
1860 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
1861 size_t num_pieces,
size_t num_data,
float const data[],
1862 bool const mask[],
float clip_threshold_sigma,
1863 uint16_t num_fitting_max,
double coeff[][4],
1864 float best_fit[],
float residual[],
1865 bool final_mask[],
float *rms,
1948 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
1949 size_t num_nwave,
size_t const nwave[],
size_t num_data,
1950 float const data[],
bool const mask[],
1951 float clip_threshold_sigma, uint16_t num_fitting_max,
size_t num_coeff,
1952 double coeff[],
float best_fit[],
1953 float residual[],
bool final_mask[],
float *rms,
1982 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
1983 size_t num_data,
float const data[],
size_t num_coeff,
1984 double const coeff[],
float out[])
2019 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
2020 size_t num_data,
float const data[],
size_t num_pieces,
2021 double const coeff[][4],
2022 size_t const boundary[],
float out[])
2060 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
2061 size_t num_data,
float const data[],
size_t num_nwave,
2062 size_t const nwave[],
size_t num_coeff,
2063 double const coeff[],
float out[])
2085 struct LIBSAKURA_SYMBOL(LSQFitContextFloat) const *context,
2086 uint16_t order,
size_t *num_coeff)
2134 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2174 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2181 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2188 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2195 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2202 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2294 float fraction,
double pixel_size,
size_t num_data,
double const x[],
2295 double const y[],
double const *blc_x,
double const *blc_y,
2296 double const *trc_x,
double const *trc_y,
bool mask[]);
#define LIBSAKURA_SYMBOL(x)
Definition: config.h:34
#define LIBSAKURA_NOEXCEPT
Definition: sakura.h:49
#define LIBSAKURA_WARN_UNUSED_RESULT
Definition: sakura.h:46
size_t count
number of valid data
Definition: sakura.h:212
float min
min value of valid data.
Definition: sakura.h:224
double square_sum
sum of squared valid data
Definition: sakura.h:220
ssize_t index_of_min
index for one of min value.
Definition: sakura.h:232
double sum
sum of valid data
Definition: sakura.h:216
float max
max value of valid data.
Definition: sakura.h:228
ssize_t index_of_max
index for one of max value.
Definition: sakura.h:236