-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
10,317 additions
and
13,734 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Copyright (c) 2000- Markus Mottl <[email protected]> | ||
Copyright (c) 2000- Christophe Troestler <[email protected]> | ||
|
||
Copyright (c) 2000-2012 Egbert Ammicht <[email protected]> | ||
Copyright (c) 2000-2012 Patrick Cousot <[email protected]> | ||
Copyright (c) 2000-2012 Sam Ehrlichman <[email protected]> | ||
Copyright (c) 2000-2012 Jane Street Capital LLC <[email protected]> | ||
Copyright (c) 2000-2012 Florent Hoareau <[email protected]> | ||
Copyright (c) 2000-2012 Liam Stewart <[email protected]> | ||
Copyright (c) 2000-2012 Oleg Trott <[email protected]> | ||
Copyright (c) 2000-2012 Martin Willensdorfer <[email protected]> | ||
Copyright © 2000- Markus Mottl <[email protected]> | ||
Copyright © 2000- Christophe Troestler <[email protected]> | ||
|
||
Copyright © 2000-2012 Egbert Ammicht <[email protected]> | ||
Copyright © 2000-2012 Patrick Cousot <[email protected]> | ||
Copyright © 2000-2012 Sam Ehrlichman <[email protected]> | ||
Copyright © 2000-2012 Jane Street Capital LLC <[email protected]> | ||
Copyright © 2000-2012 Florent Hoareau <[email protected]> | ||
Copyright © 2000-2012 Liam Stewart <[email protected]> | ||
Copyright © 2000-2012 Oleg Trott <[email protected]> | ||
Copyright © 2000-2012 Martin Willensdorfer <[email protected]> | ||
|
||
The Library is distributed under the terms of the GNU Lesser General | ||
Public License version 2.1 (included below). | ||
|
@@ -22,7 +22,7 @@ requirements listed in clause 6 of the GNU Lesser General Public License. | |
By "a publicly distributed version of the Library", we mean either the | ||
unmodified Library as distributed by the authors, or a modified version | ||
of the Library that is distributed under the conditions defined in clause | ||
2 of the GNU Lesser General Public License. This exception does not | ||
3 of the GNU Lesser General Public License. This exception does not | ||
however invalidate any other reasons why the executable file might be | ||
covered by the GNU Lesser General Public License. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
(env | ||
(dev | ||
(flags (:standard -w -9 -principal)) | ||
(c_flags | ||
(:standard -Wall -pedantic -Wno-strict-prototypes -Wextra -Wunused))) | ||
(release (ocamlopt_flags (:standard -O3))) | ||
) | ||
(dev | ||
(flags | ||
(:standard -w -9 -principal)) | ||
(c_flags | ||
(:standard -Wall -pedantic -Wno-strict-prototypes -Wextra -Wunused))) | ||
(release | ||
(ocamlopt_flags | ||
(:standard -O3)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,27 @@ | ||
(* File: blas.ml | ||
Copyright (C) 2004- | ||
Copyright © 2004- | ||
Markus Mottl | ||
email: [email protected] | ||
WWW: http://www.ocaml.info | ||
Markus Mottl email: [email protected] WWW: http://www.ocaml.info | ||
Christophe Troestler | ||
email: [email protected] | ||
WWW: http://www.umh.ac.be/math/an/ | ||
Christophe Troestler email: [email protected] WWW: | ||
http://www.umh.ac.be/math/an/ | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is free software; you can redistribute it and/or modify it under | ||
the terms of the GNU Lesser General Public License as published by the Free | ||
Software Foundation; either version 2.1 of the License, or (at your option) | ||
any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
This library is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*) | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with this library; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) | ||
|
||
open Format | ||
|
||
open Lacaml.D | ||
open Lacaml.Io | ||
|
||
|
@@ -53,18 +48,8 @@ let () = | |
printf "y <- x@\n@\n"; | ||
printf "y = @[%a@]@\n@\n" pp_rfvec (copy ~y x); | ||
|
||
let a = | ||
Mat.of_array | ||
[| | ||
[| 2.; 3. |]; | ||
[| 1.; -5. |]; | ||
|] in | ||
let b = | ||
Mat.of_array | ||
[| | ||
[| 4.; 3.; 6. |]; | ||
[| 1.; -2.; 3. |]; | ||
|] in | ||
let a = Mat.of_array [| [| 2.; 3. |]; [| 1.; -5. |] |] in | ||
let b = Mat.of_array [| [| 4.; 3.; 6. |]; [| 1.; -2.; 3. |] |] in | ||
|
||
let c = gemm ~transa:`T a b in | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,6 @@ | ||
(executables | ||
(names | ||
blas | ||
eig | ||
gbsv | ||
lin_eq | ||
lin_eq_comp | ||
lin_reg | ||
nag_gbsv | ||
nag_gesv | ||
nag_gtsv | ||
nag_pbsv | ||
nag_posv | ||
nag_ppsv | ||
nag_ptsv | ||
nag_spsv | ||
nag_sysv | ||
qr | ||
sbev | ||
sbgv | ||
schur_complex | ||
schur_real | ||
shuffle | ||
svd | ||
) | ||
(libraries lacaml) | ||
(modes byte exe) | ||
) | ||
(names blas eig gbsv lin_eq lin_eq_comp lin_reg nag_gbsv nag_gesv nag_gtsv | ||
nag_pbsv nag_posv nag_ppsv nag_ptsv nag_spsv nag_sysv qr sbev sbgv | ||
schur_complex schur_real shuffle svd) | ||
(libraries lacaml) | ||
(modes byte exe)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
(* File: eig.ml | ||
Copyright (C) 2004- | ||
Copyright © 2004- | ||
Markus Mottl | ||
email: [email protected] | ||
WWW: http://www.ocaml.info | ||
Markus Mottl email: [email protected] WWW: http://www.ocaml.info | ||
Christophe Troestler | ||
email: [email protected] | ||
WWW: http://www.umh.ac.be/math/an/ | ||
Christophe Troestler email: [email protected] WWW: | ||
http://www.umh.ac.be/math/an/ | ||
Oleg Trott | ||
email: [email protected] | ||
WWW: http://www.columbia.edu/~ot14 | ||
Oleg Trott email: [email protected] WWW: http://www.columbia.edu/~ot14 | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is free software; you can redistribute it and/or modify it under | ||
the terms of the GNU Lesser General Public License as published by the Free | ||
Software Foundation; either version 2.1 of the License, or (at your option) | ||
any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
This library is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*) | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with this library; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) | ||
|
||
open Format | ||
|
||
open Lacaml.Io | ||
|
||
(* SYEV DEMO *) | ||
|
@@ -45,11 +38,12 @@ let () = | |
printf "@[<2>Symmetric real matrix A =@\n@\n@[%a@]@]@\n@\n" pp_fmat a; | ||
|
||
let w = syev a_copy in | ||
printf "\ | ||
@[<2>Eigenvalues: W = @[%a@]@]@\n@\n\ | ||
----------------------------------------------------------------------@\n\ | ||
@\n" pp_rfvec w | ||
|
||
printf | ||
"@[<2>Eigenvalues: W = @[%a@]@]@\n\ | ||
@\n\ | ||
----------------------------------------------------------------------@\n\ | ||
@\n" | ||
pp_rfvec w | ||
|
||
(* GEEV DEMO *) | ||
|
||
|
@@ -64,8 +58,9 @@ let () = | |
done; | ||
|
||
(* All unperturbed eigenvalues are zero *) | ||
a.{n, 1} <- 1e-5; (* perturbation, try this: n >> 1 *) | ||
a.{n, 1} <- 1e-5; | ||
|
||
(* perturbation, try this: n >> 1 *) | ||
let a_copy = lacpy a in | ||
|
||
printf "@[<2>General real matrix A =@\n@\n@[%a@]@]@\n@\n" pp_fmat a; | ||
|
@@ -75,11 +70,14 @@ let () = | |
printf "@[<2>Eigenvalues: WR =@\n@\n@[%a@]@]@\n@\n" pp_rfvec wr; | ||
printf "@[<2>Eigenvalues: WI =@\n@\n@[%a@]@]@\n@\n" pp_rfvec wi; | ||
|
||
printf "\ | ||
@[<2>Matrix VR =@\n@\n@[%a@]@]@\n@\n\ | ||
----------------------------------------------------------------------@\n\ | ||
@\n" pp_fmat right | ||
|
||
printf | ||
"@[<2>Matrix VR =@\n\ | ||
@\n\ | ||
@[%a@]@]@\n\ | ||
@\n\ | ||
----------------------------------------------------------------------@\n\ | ||
@\n" | ||
pp_fmat right | ||
|
||
(* CGEEV DEMO *) | ||
|
||
|
@@ -88,10 +86,9 @@ let () = | |
let n = 3 in | ||
|
||
let a = | ||
Mat.random | ||
~re_from:(-500.) ~re_range:1000. | ||
~im_from:(-500.) ~im_range:1000. | ||
n n in | ||
Mat.random ~re_from:(-500.) ~re_range:1000. ~im_from:(-500.) ~im_range:1000. | ||
n n | ||
in | ||
let a_copy = lacpy a in | ||
|
||
printf "@[<2>General complex matrix A =@\n@\n@[%a@]@]@\n@\n" pp_cmat a; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,37 @@ | ||
(* File: lin_eq.ml | ||
Copyright (C) 2004- | ||
Copyright © 2004- | ||
Markus Mottl | ||
email: [email protected] | ||
WWW: http://www.ocaml.info | ||
Markus Mottl email: [email protected] WWW: http://www.ocaml.info | ||
Christophe Troestler | ||
email: [email protected] | ||
WWW: http://www.umh.ac.be/math/an/ | ||
Christophe Troestler email: [email protected] WWW: | ||
http://www.umh.ac.be/math/an/ | ||
Oleg Trott | ||
email: [email protected] | ||
WWW: http://www.columbia.edu/~ot14 | ||
Oleg Trott email: [email protected] WWW: http://www.columbia.edu/~ot14 | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is free software; you can redistribute it and/or modify it under | ||
the terms of the GNU Lesser General Public License as published by the Free | ||
Software Foundation; either version 2.1 of the License, or (at your option) | ||
any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
Lesser General Public License for more details. | ||
This library is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
*) | ||
You should have received a copy of the GNU Lesser General Public License | ||
along with this library; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) | ||
|
||
open Format | ||
|
||
open Lacaml.D | ||
open Lacaml.Io | ||
|
||
let () = | ||
let n = 10 in | ||
let kl = 2 and ku = 1 in | ||
let row = 2 in | ||
let ab = Mat.random ~from:(-500.) ~range:1000. (2 * kl + ku + row) n in | ||
let ab = Mat.random ~from:(-500.) ~range:1000. ((2 * kl) + ku + row) n in | ||
let b = Vec.random n in | ||
let sol = copy b in | ||
gbsv (lacpy ab) kl ku ~abr:row (Mat.from_col_vec sol); | ||
|
Oops, something went wrong.