Warning, file /include/gsl/gsl_vector_complex_long_double.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef __GSL_VECTOR_COMPLEX_LONG_DOUBLE_H__
0021 #define __GSL_VECTOR_COMPLEX_LONG_DOUBLE_H__
0022
0023 #include <stdlib.h>
0024 #include <gsl/gsl_types.h>
0025 #include <gsl/gsl_errno.h>
0026 #include <gsl/gsl_complex.h>
0027 #include <gsl/gsl_check_range.h>
0028 #include <gsl/gsl_vector_long_double.h>
0029 #include <gsl/gsl_vector_complex.h>
0030 #include <gsl/gsl_block_complex_long_double.h>
0031
0032 #undef __BEGIN_DECLS
0033 #undef __END_DECLS
0034 #ifdef __cplusplus
0035 # define __BEGIN_DECLS extern "C" {
0036 # define __END_DECLS }
0037 #else
0038 # define __BEGIN_DECLS
0039 # define __END_DECLS
0040 #endif
0041
0042 __BEGIN_DECLS
0043
0044 typedef struct
0045 {
0046 size_t size;
0047 size_t stride;
0048 long double *data;
0049 gsl_block_complex_long_double *block;
0050 int owner;
0051 } gsl_vector_complex_long_double;
0052
0053 typedef struct
0054 {
0055 gsl_vector_complex_long_double vector;
0056 } _gsl_vector_complex_long_double_view;
0057
0058 typedef _gsl_vector_complex_long_double_view gsl_vector_complex_long_double_view;
0059
0060 typedef struct
0061 {
0062 gsl_vector_complex_long_double vector;
0063 } _gsl_vector_complex_long_double_const_view;
0064
0065 typedef const _gsl_vector_complex_long_double_const_view gsl_vector_complex_long_double_const_view;
0066
0067
0068
0069 gsl_vector_complex_long_double *gsl_vector_complex_long_double_alloc (const size_t n);
0070 gsl_vector_complex_long_double *gsl_vector_complex_long_double_calloc (const size_t n);
0071
0072 gsl_vector_complex_long_double *
0073 gsl_vector_complex_long_double_alloc_from_block (gsl_block_complex_long_double * b,
0074 const size_t offset,
0075 const size_t n,
0076 const size_t stride);
0077
0078 gsl_vector_complex_long_double *
0079 gsl_vector_complex_long_double_alloc_from_vector (gsl_vector_complex_long_double * v,
0080 const size_t offset,
0081 const size_t n,
0082 const size_t stride);
0083
0084 void gsl_vector_complex_long_double_free (gsl_vector_complex_long_double * v);
0085
0086
0087
0088 _gsl_vector_complex_long_double_view
0089 gsl_vector_complex_long_double_view_array (long double *base,
0090 size_t n);
0091
0092 _gsl_vector_complex_long_double_view
0093 gsl_vector_complex_long_double_view_array_with_stride (long double *base,
0094 size_t stride,
0095 size_t n);
0096
0097 _gsl_vector_complex_long_double_const_view
0098 gsl_vector_complex_long_double_const_view_array (const long double *base,
0099 size_t n);
0100
0101 _gsl_vector_complex_long_double_const_view
0102 gsl_vector_complex_long_double_const_view_array_with_stride (const long double *base,
0103 size_t stride,
0104 size_t n);
0105
0106 _gsl_vector_complex_long_double_view
0107 gsl_vector_complex_long_double_subvector (gsl_vector_complex_long_double *base,
0108 size_t i,
0109 size_t n);
0110
0111
0112 _gsl_vector_complex_long_double_view
0113 gsl_vector_complex_long_double_subvector_with_stride (gsl_vector_complex_long_double *v,
0114 size_t i,
0115 size_t stride,
0116 size_t n);
0117
0118 _gsl_vector_complex_long_double_const_view
0119 gsl_vector_complex_long_double_const_subvector (const gsl_vector_complex_long_double *base,
0120 size_t i,
0121 size_t n);
0122
0123
0124 _gsl_vector_complex_long_double_const_view
0125 gsl_vector_complex_long_double_const_subvector_with_stride (const gsl_vector_complex_long_double *v,
0126 size_t i,
0127 size_t stride,
0128 size_t n);
0129
0130 _gsl_vector_long_double_view
0131 gsl_vector_complex_long_double_real (gsl_vector_complex_long_double *v);
0132
0133 _gsl_vector_long_double_view
0134 gsl_vector_complex_long_double_imag (gsl_vector_complex_long_double *v);
0135
0136 _gsl_vector_long_double_const_view
0137 gsl_vector_complex_long_double_const_real (const gsl_vector_complex_long_double *v);
0138
0139 _gsl_vector_long_double_const_view
0140 gsl_vector_complex_long_double_const_imag (const gsl_vector_complex_long_double *v);
0141
0142
0143
0144
0145 void gsl_vector_complex_long_double_set_zero (gsl_vector_complex_long_double * v);
0146 void gsl_vector_complex_long_double_set_all (gsl_vector_complex_long_double * v,
0147 gsl_complex_long_double z);
0148 int gsl_vector_complex_long_double_set_basis (gsl_vector_complex_long_double * v, size_t i);
0149
0150 int gsl_vector_complex_long_double_fread (FILE * stream,
0151 gsl_vector_complex_long_double * v);
0152 int gsl_vector_complex_long_double_fwrite (FILE * stream,
0153 const gsl_vector_complex_long_double * v);
0154 int gsl_vector_complex_long_double_fscanf (FILE * stream,
0155 gsl_vector_complex_long_double * v);
0156 int gsl_vector_complex_long_double_fprintf (FILE * stream,
0157 const gsl_vector_complex_long_double * v,
0158 const char *format);
0159
0160 int gsl_vector_complex_long_double_memcpy (gsl_vector_complex_long_double * dest, const gsl_vector_complex_long_double * src);
0161 int gsl_vector_complex_long_double_conj_memcpy (gsl_vector_complex_long_double * dest, const gsl_vector_complex_long_double * src);
0162
0163 int gsl_vector_complex_long_double_reverse (gsl_vector_complex_long_double * v);
0164
0165 int gsl_vector_complex_long_double_swap (gsl_vector_complex_long_double * v, gsl_vector_complex_long_double * w);
0166 int gsl_vector_complex_long_double_swap_elements (gsl_vector_complex_long_double * v, const size_t i, const size_t j);
0167
0168 int gsl_vector_complex_long_double_equal (const gsl_vector_complex_long_double * u,
0169 const gsl_vector_complex_long_double * v);
0170
0171 int gsl_vector_complex_long_double_isnull (const gsl_vector_complex_long_double * v);
0172 int gsl_vector_complex_long_double_ispos (const gsl_vector_complex_long_double * v);
0173 int gsl_vector_complex_long_double_isneg (const gsl_vector_complex_long_double * v);
0174 int gsl_vector_complex_long_double_isnonneg (const gsl_vector_complex_long_double * v);
0175
0176 int gsl_vector_complex_long_double_add (gsl_vector_complex_long_double * a, const gsl_vector_complex_long_double * b);
0177 int gsl_vector_complex_long_double_sub (gsl_vector_complex_long_double * a, const gsl_vector_complex_long_double * b);
0178 int gsl_vector_complex_long_double_mul (gsl_vector_complex_long_double * a, const gsl_vector_complex_long_double * b);
0179 int gsl_vector_complex_long_double_div (gsl_vector_complex_long_double * a, const gsl_vector_complex_long_double * b);
0180 int gsl_vector_complex_long_double_scale (gsl_vector_complex_long_double * a, const gsl_complex_long_double x);
0181 int gsl_vector_complex_long_double_add_constant (gsl_vector_complex_long_double * a, const gsl_complex_long_double x);
0182 int gsl_vector_complex_long_double_axpby (const gsl_complex_long_double alpha, const gsl_vector_complex_long_double * x, const gsl_complex_long_double beta, gsl_vector_complex_long_double * y);
0183
0184 int gsl_vector_complex_long_double_div_real (gsl_vector_complex_long_double * a, const gsl_vector_long_double * b);
0185
0186 INLINE_DECL gsl_complex_long_double gsl_vector_complex_long_double_get (const gsl_vector_complex_long_double * v, const size_t i);
0187 INLINE_DECL void gsl_vector_complex_long_double_set (gsl_vector_complex_long_double * v, const size_t i, gsl_complex_long_double z);
0188 INLINE_DECL gsl_complex_long_double *gsl_vector_complex_long_double_ptr (gsl_vector_complex_long_double * v, const size_t i);
0189 INLINE_DECL const gsl_complex_long_double *gsl_vector_complex_long_double_const_ptr (const gsl_vector_complex_long_double * v, const size_t i);
0190
0191 #ifdef HAVE_INLINE
0192
0193 INLINE_FUN
0194 gsl_complex_long_double
0195 gsl_vector_complex_long_double_get (const gsl_vector_complex_long_double * v,
0196 const size_t i)
0197 {
0198 #if GSL_RANGE_CHECK
0199 if (GSL_RANGE_COND(i >= v->size))
0200 {
0201 gsl_complex_long_double zero = {{0, 0}};
0202 GSL_ERROR_VAL ("index out of range", GSL_EINVAL, zero);
0203 }
0204 #endif
0205 return *GSL_COMPLEX_LONG_DOUBLE_AT (v, i);
0206 }
0207
0208 INLINE_FUN
0209 void
0210 gsl_vector_complex_long_double_set (gsl_vector_complex_long_double * v,
0211 const size_t i, gsl_complex_long_double z)
0212 {
0213 #if GSL_RANGE_CHECK
0214 if (GSL_RANGE_COND(i >= v->size))
0215 {
0216 GSL_ERROR_VOID ("index out of range", GSL_EINVAL);
0217 }
0218 #endif
0219 *GSL_COMPLEX_LONG_DOUBLE_AT (v, i) = z;
0220 }
0221
0222 INLINE_FUN
0223 gsl_complex_long_double *
0224 gsl_vector_complex_long_double_ptr (gsl_vector_complex_long_double * v,
0225 const size_t i)
0226 {
0227 #if GSL_RANGE_CHECK
0228 if (GSL_RANGE_COND(i >= v->size))
0229 {
0230 GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
0231 }
0232 #endif
0233 return GSL_COMPLEX_LONG_DOUBLE_AT (v, i);
0234 }
0235
0236 INLINE_FUN
0237 const gsl_complex_long_double *
0238 gsl_vector_complex_long_double_const_ptr (const gsl_vector_complex_long_double * v,
0239 const size_t i)
0240 {
0241 #if GSL_RANGE_CHECK
0242 if (GSL_RANGE_COND(i >= v->size))
0243 {
0244 GSL_ERROR_NULL ("index out of range", GSL_EINVAL);
0245 }
0246 #endif
0247 return GSL_COMPLEX_LONG_DOUBLE_AT (v, i);
0248 }
0249
0250
0251 #endif
0252
0253 __END_DECLS
0254
0255 #endif