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
185 size_t size_required) LIBSAKURA_NOEXCEPT;
200 size_t elements_required) LIBSAKURA_NOEXCEPT;
205 double *
LIBSAKURA_SYMBOL(AlignDouble)(
size_t elements_in_arena,
double *arena,
206 size_t elements_required) LIBSAKURA_NOEXCEPT;
264 size_t num_data,
float const data[],
bool const is_valid[],
274 size_t num_data,
float const data[],
bool const is_valid[],
290 size_t num_data,
bool const is_valid[],
float data[],
291 size_t *new_num_data) LIBSAKURA_NOEXCEPT;
316 size_t num_data,
float const data[],
float new_data[])
376 size_t num_spectra,
size_t start_spectrum,
size_t end_spectrum,
377 bool const spectrum_mask[],
378 double const x[],
double const y[],
379 size_t support,
size_t sampling,
size_t num_polarizations,
380 uint32_t const polarization_map[],
381 size_t num_channels, uint32_t const channel_map[],
384 float const weight[],
bool weight_only,
385 size_t num_convolution_table,
386 float const convolution_table[],
387 size_t num_polarizations_for_grid,
size_t num_channels_for_grid,
388 size_t width,
size_t height,
390 float weight_of_grid[],
428 size_t num_data,
float const data[],
size_t num_condition,
429 float const lower_bounds[],
430 float const upper_bounds[],
bool result[])
437 size_t num_data,
int const data[],
size_t num_condition,
438 int const lower_bounds[],
439 int const upper_bounds[],
bool result[])
477 size_t num_data,
float const data[],
size_t num_condition,
478 float const lower_bounds[],
479 float const upper_bounds[],
bool result[])
486 size_t num_data,
int const data[],
size_t num_condition,
487 int const lower_bounds[],
488 int const upper_bounds[],
bool result[])
516 size_t num_data,
float const data[],
float threshold,
517 bool result[]) LIBSAKURA_NOEXCEPT;
523 size_t num_data,
int const data[],
int threshold,
524 bool result[]) LIBSAKURA_NOEXCEPT;
551 size_t num_data,
float const data[],
float threshold,
552 bool result[]) LIBSAKURA_NOEXCEPT;
558 size_t num_data,
int const data[],
int threshold,
559 bool result[]) LIBSAKURA_NOEXCEPT;
586 size_t num_data,
float const data[],
float threshold,
587 bool result[]) LIBSAKURA_NOEXCEPT;
593 size_t num_data,
int const data[],
int threshold,
594 bool result[]) LIBSAKURA_NOEXCEPT;
621 size_t num_data,
float const data[],
float threshold,
622 bool result[]) LIBSAKURA_NOEXCEPT;
628 size_t num_data,
int const data[],
int threshold,
629 bool result[]) LIBSAKURA_NOEXCEPT;
648 size_t num_data,
float const data[],
649 bool result[]) LIBSAKURA_NOEXCEPT;
666 uint8_t const data[],
bool result[])
673 uint32_t const data[],
bool result[])
692 bool const data[],
bool result[])
731 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
732 bool const edit_mask[], uint8_t result[])
738 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
739 bool const edit_mask[], uint32_t result[])
779 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
780 bool const edit_mask[], uint8_t result[])
786 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
787 bool const edit_mask[], uint32_t result[])
826 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
827 bool const edit_mask[], uint8_t result[])
833 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
834 bool const edit_mask[], uint32_t result[])
865 size_t num_data, uint8_t const data[],
866 bool const edit_mask[], uint8_t result[])
872 size_t num_data, uint32_t const data[],
873 bool const edit_mask[], uint32_t result[])
912 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
913 bool const edit_mask[], uint8_t result[])
919 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
920 bool const edit_mask[], uint32_t result[])
959 uint8_t bit_mask,
size_t num_data, uint8_t const data[],
960 bool const edit_mask[], uint8_t result[])
966 uint32_t bit_mask,
size_t num_data, uint32_t const data[],
967 bool const edit_mask[], uint32_t result[])
1084 uint8_t polynomial_order,
size_t num_base,
1085 double const base_position[],
size_t num_array,
1086 float const base_data[],
1087 bool const base_mask[],
size_t num_interpolated,
1088 double const interpolated_position[],
1089 float interpolated_data[],
1090 bool interpolated_mask[])
1098 uint8_t polynomial_order,
size_t num_base,
1099 double const base_position[],
size_t num_array,
1100 float const base_data[],
1101 bool const base_mask[],
size_t num_interpolated,
1102 double const interpolated_position[],
1103 float interpolated_data[],
1104 bool interpolated_mask[])
1147 size_t num_data,
float const scaling_factor[],
1148 float const data[],
float const reference[],
1149 float result[]) LIBSAKURA_NOEXCEPT;
1188 float scaling_factor,
size_t num_data,
float const data[],
1189 float const reference[],
float result[])
1229 float kernel_width,
size_t num_kernel,
float kernel[])
1250 size_t num_kernel,
float const kernel[],
1252 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1295 float const kernel[],
size_t num_data,
1296 float const input_data[],
1297 bool const input_mask[],
float output_data[],
1321 size_t num_data,
float const input_data[],
1405 size_t const num_data,
float const data[],
1406 bool const mask[],
size_t const num_model_bases,
1407 double const basis_data[],
1408 size_t const num_lsq_bases,
1409 size_t const use_bases_idx[],
1410 double lsq_matrix[],
1411 double lsq_vector[])
1412 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1484 size_t const num_data,
float const data[],
1485 bool const mask[],
size_t const num_exclude_indices,
1486 size_t const exclude_indices[],
1487 size_t const num_model_bases,
1488 double const basis_data[],
1489 size_t const num_lsq_bases,
1490 size_t const use_bases_idx[],
1491 double lsq_matrix[],
1492 double lsq_vector[])
1493 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1522 size_t num_equations,
1523 double const in_matrix[],
1524 double const in_vector[],
1526 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1561 size_t const num_data,
float const data[],
1562 bool const mask[],
size_t const num_peaks,
1563 double height[],
double err_height[],
1564 double center[],
double err_center[],
1565 double sigma[],
double err_sigma[])
1566 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1609 struct LIBSAKURA_SYMBOL(LSQFitContextFloat);
1636 LIBSAKURA_SYMBOL(LSQFitType) const lsqfit_type, uint16_t order,
size_t num_data,
1660 uint16_t npiece,
size_t num_data,
1685 uint16_t nwave,
size_t num_data,
1773 uint16_t order,
size_t num_data,
float const data[],
1774 bool const mask[],
float clip_threshold_sigma,
1775 uint16_t num_fitting_max,
size_t num_coeff,
double coeff[],
1776 float best_fit[],
float residual[],
1777 bool final_mask[],
float *rms,
1779 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1859 size_t num_pieces,
size_t num_data,
float const data[],
1860 bool const mask[],
float clip_threshold_sigma,
1861 uint16_t num_fitting_max,
double coeff[][4],
1862 float best_fit[],
float residual[],
1863 bool final_mask[],
float *rms,
1866 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1947 size_t num_nwave,
size_t const nwave[],
size_t num_data,
1948 float const data[],
bool const mask[],
1949 float clip_threshold_sigma, uint16_t num_fitting_max,
size_t num_coeff,
1950 double coeff[],
float best_fit[],
1951 float residual[],
bool final_mask[],
float *rms,
1953 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
1981 size_t num_data,
float const data[],
size_t num_coeff,
1982 double const coeff[],
float out[])
1983 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2018 size_t num_data,
float const data[],
size_t num_pieces,
2019 double const coeff[][4],
2020 size_t const boundary[],
float out[])
2021 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2059 size_t num_data,
float const data[],
size_t num_nwave,
2060 size_t const nwave[],
size_t num_coeff,
2061 double const coeff[],
float out[])
2062 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2084 uint16_t order,
size_t *num_coeff)
2085 LIBSAKURA_NOEXCEPT LIBSAKURA_WARN_UNUSED_RESULT;
2132 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2133 float const src[],
float dst[]) LIBSAKURA_NOEXCEPT;
2172 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2173 float const src[],
float dst[]) LIBSAKURA_NOEXCEPT;
2179 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2180 double const src[],
double dst[]) LIBSAKURA_NOEXCEPT;
2186 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2187 double const src[],
double dst[]) LIBSAKURA_NOEXCEPT;
2193 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2194 double const src[][2],
double dst[][2]) LIBSAKURA_NOEXCEPT;
2200 bool inner_most_untouched,
size_t dims,
size_t const elements[],
2201 double const src[][2],
double dst[][2]) LIBSAKURA_NOEXCEPT;
2292 float fraction,
double pixel_size,
size_t num_data,
double const x[],
2293 double const y[],
double const *blc_x,
double const *blc_y,
2294 double const *trc_x,
double const *trc_y,
bool mask[]);
size_t count
number of valid data
Definition: sakura.h:221
#define LIBSAKURA_SYMBOL(x)
Definition: config.h:34
ssize_t index_of_min
index for one of min value.
Definition: sakura.h:241
float min
min value of valid data.
Definition: sakura.h:233
#define LIBSAKURA_NOEXCEPT
Definition: sakura.h:49
double sum
sum of valid data
Definition: sakura.h:225
float max
max value of valid data.
Definition: sakura.h:237
#define LIBSAKURA_WARN_UNUSED_RESULT
Definition: sakura.h:46
double square_sum
sum of squared valid data
Definition: sakura.h:229
ssize_t index_of_max
index for one of max value.
Definition: sakura.h:245