Home | Develop | Download | Contact
testprog2.c
1 /*
2  * testprog1.c
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 
29 #include <config.h>
30 #include <stdlib.h>
31 #include <pds/pdscm.h>
32 
33 int main(int argc, char** argv)
34 {
35  PdsBVector *X=NULL;
36  PdsBVector *Y=NULL;
37  PdsBsc *Channel=NULL;
38 
39  X=pds_bvector_new(32);
40  Y=pds_bvector_new(32);
41  Channel=pds_bsc_new(0.1);
42  printf("BSC\np=0.1\n\n");
43 
44  pds_bvector_init_rand(X,0.5);
45 
46  pds_bsc_evaluate(Channel,X,Y);
47 
48  printf("Input : ");
49  pds_bvector_printf(X);
50  printf("Output: ");
51  pds_bvector_printf(Y);
52 
53  pds_bsc_free(Channel);
54  pds_bvector_free(Y);
55  pds_bvector_free(X);
56 
57  printf("\n");
58  return EXIT_SUCCESS;
59 }
void pds_bsc_free(PdsBsc *Channel)
Libera un canal de tipo puntero PdsBsc.
int pds_bsc_evaluate(PdsBsc *Channel, const PdsBVector *BVectorInput, PdsBVector *BVectorOutput)
Evalua un vector binario en un canal BSC.
La estructura tipo PdsBsc . Esta estructura genera una canal BSC. Para usar incluir pds/pdsbsc...
Definition: pdsbsc.h:67
PdsBsc * pds_bsc_new(PdsCmReal p)
Crea un canal de tipo PdsBsc.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed