* [Caml-list] Linear constraints
@ 2004-06-16 15:41 Claudio Trento
2004-06-16 16:27 ` Boulet Pierre
0 siblings, 1 reply; 4+ messages in thread
From: Claudio Trento @ 2004-06-16 15:41 UTC (permalink / raw)
To: caml-list
Hello,
I would know if there is a way to create a linear constraint like "2x + 3y
> 6" in Ocaml. I've try to define new type but don't like me so much...
Thanks,
Claudio
-------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Linear constraints
2004-06-16 15:41 [Caml-list] Linear constraints Claudio Trento
@ 2004-06-16 16:27 ` Boulet Pierre
2004-06-16 17:10 ` [Caml-list] Using Ocaml keywords as structure members Shishir Ramam
0 siblings, 1 reply; 4+ messages in thread
From: Boulet Pierre @ 2004-06-16 16:27 UTC (permalink / raw)
To: Claudio Trento; +Cc: caml-list
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
Claudio,
you have to redefine such a type. I have done so in the SPPoC package that
provides an API for parameterized linear optimization and symbolic polyhedron
manipulation. You may want to have a look at it. It is downloadable on
<http://www.lifl.fr/west/sppoc/>.
Regards,
Pierre.
Claudio Trento wrote:
> Hello,
> I would know if there is a way to create a linear constraint like "2x + 3y
>
>>6" in Ocaml. I've try to define new type but don't like me so much...
>
>
> Thanks,
> Claudio
--
Pierre Boulet
<http://www.lifl.fr/~boulet/>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 4065 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Caml-list] Using Ocaml keywords as structure members.
2004-06-16 16:27 ` Boulet Pierre
@ 2004-06-16 17:10 ` Shishir Ramam
2004-06-17 20:00 ` Xavier Leroy
0 siblings, 1 reply; 4+ messages in thread
From: Shishir Ramam @ 2004-06-16 17:10 UTC (permalink / raw)
To: caml-list
Hi,
I am interesting in converting a data-structure from
C to Ocaml using CamlIdl. I am running into some
trouble because one of the structure members is
named "end".
-------------------------------------------
# type a_test = {
start: int;
end: int;
}
;;
Characters 34-37:
end: int;
^^^
Syntax error
-------------------------------------------
Apart from renaming the structure member in
C (3rd party, lotsa work!), is there anything else
that I can do?
thanks in advance for all help.
-shishir
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail
-------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] Using Ocaml keywords as structure members.
2004-06-16 17:10 ` [Caml-list] Using Ocaml keywords as structure members Shishir Ramam
@ 2004-06-17 20:00 ` Xavier Leroy
0 siblings, 0 replies; 4+ messages in thread
From: Xavier Leroy @ 2004-06-17 20:00 UTC (permalink / raw)
To: Shishir Ramam; +Cc: caml-list
> I am interesting in converting a data-structure from
> C to Ocaml using CamlIdl. I am running into some
> trouble because one of the structure members is
> named "end".
> Apart from renaming the structure member in
> C (3rd party, lotsa work!), is there anything else
> that I can do?
Yes: use the "mlname" attribute. In the IDL file:
struct a_test {
int start;
[mlname(end_)] int end;
};
> A common C coding convention is to use
> struct definitions of the form -
>
> <test.idl> ---------
>
> typedef struct a {
> int x;
> int y;
> } a;
>
> </test.idl> --------
> Using CamlIdl, this results in a conversion to [incorrect Caml code]
I'd suggest to change the IDL file (and only the IDL file) to either
typedef struct {
int x;
int y;
} a;
// use "a" instead of "struct a" everywhere else
or
struct a {
int x;
int y;
};
// use "struct a" instead of "a" everywhere else
Note that I'm not suggesting you do this change in the .c and .h
sources for the original C code. IDL descriptions can (and often need
to) omit some aspects of the C interface they describe.
- Xavier Leroy
-------------------
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-06-17 20:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-16 15:41 [Caml-list] Linear constraints Claudio Trento
2004-06-16 16:27 ` Boulet Pierre
2004-06-16 17:10 ` [Caml-list] Using Ocaml keywords as structure members Shishir Ramam
2004-06-17 20:00 ` Xavier Leroy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox