From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 9A455BB84 for ; Fri, 2 Jun 2006 13:21:26 +0200 (CEST) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.197]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k52BLPpQ020077 for ; Fri, 2 Jun 2006 13:21:26 +0200 Received: by nz-out-0102.google.com with SMTP id 13so487874nzn for ; Fri, 02 Jun 2006 04:21:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rpwzcoJ6vrp7dHHJcjL6Hg9TcVwDt77ML5abRfgr2nax3mbVZwWQmf71nP11THPaOC6uzoow1D3d6OV/tr+mIZE+NA/dBFlHbwrEpfeWdNLoxVwoy7/ExMSuxYFxYhVTkPZaA4G6Aasx8MG3S81q7Ypvc0Vg4g51eiWSEAxA1sY= Received: by 10.36.77.12 with SMTP id z12mr2279940nza; Fri, 02 Jun 2006 04:21:25 -0700 (PDT) Received: by 10.36.118.2 with HTTP; Fri, 2 Jun 2006 04:21:25 -0700 (PDT) Message-ID: Date: Fri, 2 Jun 2006 23:21:25 +1200 From: "Jonathan Roewen" To: "otlore dolire" Subject: Re: [Caml-list] building fft Cc: caml-list@yquem.inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-j-chkmail-Score: MSGID : 44801F35.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44801F35.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; fft:01 lowercase:01 constructors:01 fft:01 rec:01 a-b:01 beginner's:01 ocaml:01 beginners:01 bug:01 testez:98 wrote:01 caml-list:01 caml-list:01 conflicts:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.3 variables have to start with a lowercase letter. values starting with uppercase are module names/type constructors. On 6/2/06, otlore dolire wrote: > I have a problem with a basic fft function i'm tryin to build. I think it= 's > right, yet it raises conflicts, as if it didn't recognize the "end" at th= e > end of it. Can you please tell me if someone sees something wrong? thx in > advance > > let rec fft N w y =3D > let Y =3D make_vect N {Re =3D 0. ; Im =3D 0.} > in > if N =3D 1 then begin Y.(0) <- y.(0) end > else > begin let m =3D div_int N 2; > let l1 =3D make_vect m {Re =3D 0. ; Im =3D 0. } > and l2 =3D make_vect m {Re =3D 0. ; Im =3D 0. } > in for k =3D 0 to m - 1 do > l1.(k) <- y.(2*k); > l2.(k) <- y.(2*k + 1) > done; > let L1 =3D make_vect m {Re =3D 0. ; Im =3D 0. } > and L2 =3D make_vect m {Re =3D 0. ; Im =3D 0. } > in > for i =3D 0 to m - 1 do > L1.(i) <- (fft m (prod w w) l1).(i); > L2.(i) <- (fft m (prod w w) l2).(i) > done; > let wk =3D ref {Re =3D 1. ; Im =3D 0. } > and P =3D ref {Re =3D 0. ; Im =3D 0. } > and I =3D ref {Re =3D 0. ; Im =3D 0. } > in for k=3D0 to m - 1 do > P :=3D L1.(k); > I :=3D prod !wk L2.(k); > Y.(k) <- prod (add !P !I) {Re =3D 0.5 ; Im =3D 0. }; > Y.(k + m) <- prod (sous !P !I) {Re =3D 0.5 ; Im =3D 0.= }; > wk :=3D prod !wk w > done > end; > Y;; > > > PS: i defined the type cplx by type cplx =3D {Re : float ; Im : float}, p= rod, > add and sous are respectively product, addition and substraction of cplx > numbers > > _________________________________________________________________ > Windows Live Mail : d=E9couvrez et testez la version b=EAta ! > http://www.ideas.live.com/programpage.aspx?versionId=3D5d21c51a-b161-4314= -9b0e-4911fb2b2e6d > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >