# small Fortran program

For this project, you'd write a small (< 50 lines) Fortran library, which would perform some matrix operations using the Lapack matrix library ([url removed, login to view]).

## Deliverables

For this project, you'd write a small (< 50 lines) Fortran library, which would perform some matrix operations using the Lapack matrix library ([url removed, login to view]). It not necessary to understand much about Lapack, since I've provided an implementation (in a different language -- Ocaml) below. You'd translate these two Ocaml methods into Fortran subroutines.

It's not really necessary to understand much about Ocaml to port these. Just know that the statement "let x = 3 in" assigns the value 3 to variable x. All Lapack operations are double precision, so rather than "scal" (Ocaml), call DSCAL (Fortran).

Note that arguments "pu", "m_avg", "m_var", and "m_normal" are vectors of the same length. "r" is a real valued number. Both methods return vectors with the same length as the other vectors.

* * *

method get_normal_density r m_avg m_var m_normal =

let r_vec = [url removed, login to view] num_z r in

let r_diff = [url removed, login to view] r_vec m_avg in

let r_sqdiff = [url removed, login to view] r_diff r_diff in

scal (-0.5) r_sqdiff;

let r_exp = [url removed, login to view] r_sqdiff m_var in

let get_exp z = exp r_exp.{z} in

let normal_exp = [url removed, login to view] num_z get_exp in

[url removed, login to view] m_normal normal_exp

method expectation pu r m_avg m_var m_normal =

let pr_m_vec = self#get_normal_density

r m_avg m_var m_normal in

let pr_mu_vec = [url removed, login to view] pr_m_vec pu in

let pr_mu = [url removed, login to view] pr_mu_vec in

scal (1. /. pr_mu) pr_mu_vec;

pr_mu_vec

* * *

I'm planning to call your Fortran library from my Ocaml program. If you'd be willing to provide a sample Ocaml program that calls your Fortran library (see [url removed, login to view]), let me know, and we can agree on a higher price or a bonus or something. Otherwise, I'll remove this paragraph from the project description before accepting your bid. The sample program should demonstrate that calling the Fortran code does not block other Ocaml threads from running during its execution. My hope is that each call to the Fortran code will run on a different processor, when multiple processors are available.

Please let me know if you have questions. Thank you.

## Platform

Linux, g77

Habilidades: Engenharia, Linux, MySQL, PHP, Arquitetura de software, Teste de Software, UNIX

( 8 comentários ) United States

ID do Projeto: #3054026

## 3 freelancers estão ofertando em média \$43 para este trabalho

renardpaul

See private message.

\$42.5 USD in 14 dias
(111 Comentários)
6.7
DannyCoder

See private message.

\$38.25 USD in 14 dias
(15 Comentários)
3.4
mdelwar

See private message.

\$42.5 USD in 14 dias
(8 Comentários)
3.7
gamllvw

See private message.

\$42.5 USD in 14 dias
(0 Comentários)
0.0