Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] help
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: mohammad siddiqui <writetosafi@h...>
Subject: [Caml-list] help
Hello,
I am involved in a conversion project, where we  are translating programs 
from C
to ocaml. I am having hardtime dealing with pointers. One of the structures
contains a pointer to a structure as one of its fields, which in turns 
contains
a pointer to another structure, I replaced this by using arrays in ocaml but 
I
am not able to make changes to inner structures fields (using Array.set ) if 
i
do so it changes the values of all the elements of that array.
  Can any one help resolving this?  The structures in C are below:


typedef struct word {
  FNUM    wnum;	               /* word number */
  FVAL    weight;              /* word weight */
} WORD;



typedef struct doc {
  long    docnum;              /* Document ID. This has to be the position 
of
                                  the document in the training set array. */
  long    queryid;
  double  costfactor;
  double  twonorm_sq;
  WORD    *words;              /* The words/values in the document by */
                                    /*increasing word-number. I replaced 
this by
an   array in ocaml*/
} DOC;



typedef struct model {
  long    sv_num;
  long    at_upper_bound;
  double  b;
  DOC     **supvec;  /* I replaced this by array of type doc in ocaml */
  double  *alpha;

} MODEL;



I am unable to change the values for an example How can I change the value 
od
model.supvec[i].words[i].wnum?

Thanks,

Mohammad S Siddiqui.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners