Home | Develop | Download | Contact
 Todo Estructuras de Datos Funciones Variables 'typedefs' Grupos Páginas
pdscvector.h
1 /*
2  * pdscvector.h
3  *
4  * Copyright 2011 Fernando Pujaico Rivera <fernando.pujaico.rivera@gmail.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  */
22 
33 #ifndef __PDSCVECTOR_H__
34 #define __PDSCVECTOR_H__
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 
41 #ifndef TRUE
42  #define TRUE 1
43 #endif
44 
45 #ifndef FALSE
46  #define FALSE 0
47 #endif
48 
49 #include <stdio.h>
50 #include <pds/pdscaglobal.h>
51 #include <pds/pdscn.h>
52 #include <pds/pdsra.h>
53 
68 typedef struct
69 {
71  PdsComplex *V;
74 }PdsCVector;
75 
89 
90 
98 
99 
107 PdsCVector *pds_cvector_new_vector(const PdsVector *VecSrc);
108 
110 
111 
124 int pds_cvector_init_complex(PdsCVector *Vector,PdsComplex Val);
125 
126 
135 
136 
145 
146 
156 int pds_cvector_init_cvector(PdsCVector *Vector,const PdsCVector *VecSrc);
157 
158 
169 int pds_cvector_init_rvector(PdsCVector *Vector,const PdsVector *VecSrc);
170 
171 
182 int pds_cvector_init_ivector(PdsCVector *Vector,const PdsVector *VecSrc);
183 
185 
186 
187 
199 int pds_cvector_printf(const PdsCVector *Vector);
200 
201 
209 int pds_cvector_fprintf(const PdsCVector *Vector,FILE *fd);
210 
212 
228 int pds_cvector_get_complex(const PdsCVector *Vector, PdsCaNatural x, PdsComplex *m);
229 
231 
232 
248 int pds_cvector_set_complex(PdsCVector *Vector, PdsCaNatural x, PdsComplex m);
249 
250 
262 
263 
275 
277 
278 
291 int pds_cvector_conjugate(PdsCVector *Vector);
292 
293 
303 int pds_cvector_conjugate_cvector(const PdsCVector *Vector,PdsCVector *VecDest);
304 
305 
315 int pds_cvector_modulus(const PdsCVector *Vector,PdsVector *VecDest);
316 
317 
327 int pds_cvector_modulus2(const PdsCVector *Vector,PdsVector *VecDest);
328 
329 
339 int pds_cvector_phase(const PdsCVector *Vector,PdsVector *VecDest);
340 
342 
354 void pds_cvector_free(PdsCVector *Vector);
355 
356 
363 void pds_cvector_destroy(PdsCVector **Vector);
364 
366 
371 #ifdef __cplusplus
372 }
373 #endif
374 
375 #endif /* __PDSCVECTOR_H__ */
376 
int pds_cvector_fprintf(const PdsCVector *Vector, FILE *fd)
Imprime en el archivo que apunta fd un vector de tipo puntero PdsCVector.
float PdsCaReal
Definition: pdscaglobal.h:43
int pds_cvector_init_rvector(PdsCVector *Vector, const PdsVector *VecSrc)
Inicia la parte real del vector de tipo puntero PdsCVector con un vector de tipo PdsVector. Si los tamaños son diferentes intersecta los tamaños y hace la copia en la intersección solamente. Vector.Real=VecSrc.
PdsCVector * pds_cvector_new_vector(const PdsVector *VecSrc)
Crea un vector de tipo PdsCVector usando como fuente el vector VecSrc y lo copia en la parte real del...
PdsCVector * pds_cvector_new(PdsCaNatural Nel)
Crea un vector de tipo PdsCVector e inicia con cero todos los elementos.
int pds_cvector_set_complex(PdsCVector *Vector, PdsCaNatural x, PdsComplex m)
Escribe el valor m en la posición (x) del vector Vector. (x) inicia con (0).
void pds_cvector_destroy(PdsCVector **Vector)
Libera un vector de tipo puntero PdsCVector, y limpia el puntero con NULL.
PdsCVector * pds_cvector_new_cvector(const PdsCVector *VecSrc)
Crea un vector de tipo PdsCVector usando como fuente el vector VecSrc.
int pds_cvector_conjugate_cvector(const PdsCVector *Vector, PdsCVector *VecDest)
Encuentra el conjugado del vector Vector, y el resultado es copiado en el vector VecDest. VecDest=CONJ(Vector).
int pds_cvector_init_real(PdsCVector *Vector, PdsCaReal Val)
Inicia la parte real del vector de tipo puntero PdsCVector. Vector.Real=Val.
La estructura tipo PdsCVector . Esta estructura genera un vector de Nel elementos. Para usar incluir pds/pdsca.h.
Definition: pdscvector.h:68
int pds_cvector_init_ivector(PdsCVector *Vector, const PdsVector *VecSrc)
Inicia la parte imaginaria del vector de tipo puntero PdsCVector con un vector de tipo PdsVector...
int pds_cvector_modulus(const PdsCVector *Vector, PdsVector *VecDest)
Encuentra el Modulo del vector Vector, y el resultado es copiado en el vector VecDest. VecDest=|Vector|.
int pds_cvector_init_cvector(PdsCVector *Vector, const PdsCVector *VecSrc)
Inicia el vector de tipo puntero PdsCVector con otro vector. Si los tamaños son diferentes intersecta...
int pds_cvector_init_imag(PdsCVector *Vector, PdsCaReal Val)
Inicia la parte imaginaria del vector de tipo puntero PdsCVector. Vector.Imag=Val.
PdsCaNatural Nel
Definition: pdscvector.h:73
int pds_cvector_init_complex(PdsCVector *Vector, PdsComplex Val)
Inicia el vector de tipo puntero PdsCVector. Vector=Val.
int pds_cvector_get_complex(const PdsCVector *Vector, PdsCaNatural x, PdsComplex *m)
Devuelve el valor complejo en la posición (x) del vector Vector. (x) inicia con (0).
void pds_cvector_free(PdsCVector *Vector)
Libera un vector de tipo puntero PdsCVector.
int pds_cvector_modulus2(const PdsCVector *Vector, PdsVector *VecDest)
Encuentra el Modulo^2 del vector Vector, y el resultado es copiado en el vector VecDest. VecDest=|Vector|^2.
int pds_cvector_conjugate(PdsCVector *Vector)
Encuentra el conjugado del vector Vector. Vector=CONJ(Vector).
int pds_cvector_phase(const PdsCVector *Vector, PdsVector *VecDest)
Encuentra la fase de Z=X+Yi phase=atan2(Y,X) del vector Vector, y el resultado es copiado en el vecto...
int pds_cvector_set_imag(PdsCVector *Vector, PdsCaNatural x, PdsCaReal m)
Escribe el valor m solo en la parte imaginaria de la posición (x) del vector Vector. (x) inicia con (0).
int pds_cvector_printf(const PdsCVector *Vector)
Imprime en pantalla un vector de tipo puntero PdsCVector.
unsigned int PdsCaNatural
Definition: pdscaglobal.h:48
int pds_cvector_set_real(PdsCVector *Vector, PdsCaNatural x, PdsCaReal m)
Escribe el valor m solo en la parte real de la posición (x) del vector Vector. (x) inicia con (0)...
PdsComplex * V
Definition: pdscvector.h:71

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed