00001 #ifndef VECT_HEADER
00002 #define VECT_HEADER
00003
00004
00005
00013
00014
00015
00016
00017 #include <stdlib.h>
00018 #include <stdio.h>
00019
00020
00021
00022 #ifdef __cplusplus
00023 namespace RazorBack {
00024 #endif
00025
00027 typedef struct
00028 {
00029 double *Vec;
00030 unsigned int Len, Physlen;
00031 } Vect_;
00032
00033
00034
00035 #ifdef __cplusplus
00036 extern "C" {
00037 #endif
00038
00039
00040
00046 void init_vect(Vect_ *V, unsigned int L);
00047
00055 void resize_vect(Vect_ *V, unsigned int Newsize);
00056
00062 void copy_vect(const Vect_ *From, Vect_ *To);
00063
00069 void free_vect(Vect_ *V);
00070
00071
00072
00086 int vect_scalar(Vect_ *V, char Opcode, double Scalar);
00087
00099 int vect_inplace(const Vect_ *V, char Opcode, Vect_ *R);
00100
00112 int vect_vect(const Vect_ *V1, char Opcode, const Vect_ *V2, Vect_ *R);
00113
00119 double scalar_product(const Vect_ *V1, const Vect_ *V2);
00120
00130 int vect_product(const Vect_ *V1, const Vect_ *V2, Vect_ *P);
00131
00136 double vect_len2(const Vect_ *V);
00137
00142 double vect_len(const Vect_ *V);
00143
00149 double vect_norm(Vect_ *V);
00150
00158 double vect_norm_eps(Vect_ *V, double Eps);
00159
00160
00161
00168 int read_vect(FILE *In, Vect_ *V);
00169
00175 void write_vect(FILE *Out, const Vect_ *V, unsigned int Prec);
00176
00177
00178 #ifdef __cplusplus
00179 } }
00180 #endif
00181
00182
00183
00184 #endif