NOT FINISHED ...

------------------------------------------------------------------------
* File manipulations
------------------------------------------------------------------------

procedure reset(var f: text); inline;
procedure rewrite(var f: text); inline;
procedure append(var f: text); inline;

function reset(var f: text; s:string): boolean; inline;
function rewrite(var f: text; s:string): boolean; inline;
function append(var f:text; s:string):boolean;

procedure rwr(nam:string); inline;
procedure rwr(p:boolean); inline;
procedure rwr(nam:string; var f:text); inline;

procedure opn(s:string; var f:text); inline;
procedure apn(s:string; var f:text); inline;
procedure clo(var f:text); inline;

------------------------------------------------------------------------
* Input
------------------------------------------------------------------------

function mrd(var r:mtx):boolean;
function mrd(var r:mtx; fnam:string):boolean; inline;
function mrd(var r:mtx; fnam:string; mnam:string):boolean;
function mrd(var r: mtx; var f: text): boolean; inline;
function mrd(var r: mtx; var f: text; mnam:string): boolean;

------------------------------------------------------------------------
* Output
------------------------------------------------------------------------

procedure fmt(d:longint); inline;

function mwr(a:mtx): boolean; inline;
function mwr(a:mtx; s:string): boolean;
function mwr(a:mtx; var f:text):boolean;
function mwr(a:double): boolean; inline;
function mwr(a:double; var f:text): boolean; inline;

------------------------------------------------------------------------
* Creation and special matrices see also equ()
------------------------------------------------------------------------

procedure zer(a:mtx); inline;
procedure zer(var r:mtx; a:mtx); inline;
procedure zer(var r:mtx; lgn, col: longint); inline;

procedure one(a:mtx); inline;
procedure one(var r:mtx; a:mtx); inline;
procedure one(var r:mtx; lgn, col: longint); inline;

procedure eye(a:mtx);
procedure eye(var r:mtx; a:mtx); inline;
procedure eye(var r:mtx; lgn, col: longint);

procedure lsp(var r:mtx; x0, x1: double; n:longint);

------------------------------------------------------------------------
* Matrix and element/element operations
* see also softdim
------------------------------------------------------------------------

procedure prd(var r: mtx; a, b: mtx);

function inv(r:mtx):boolean;
function inv(r:mtx; var d:double):boolean;
function inv(var r:mtx; a:mtx):boolean;
function inv(var r:mtx; a:mtx; var d:double):boolean;

procedure cat(var r:mtx; a,b:mtx);
procedure cat(var r:mtx; a:mtx);

procedure stk(var r:mtx; a,b:mtx);
procedure stk(var r:mtx; a:mtx);

procedure add(a, b:mtx);
procedure add(a: mtx; x: double);
procedure add(var r: mtx; a:mtx; b:mtx);
procedure add(var r: mtx; a:mtx; t:boolean);
procedure add(var r: mtx; a:mtx; x:double);
procedure add(var r: mtx; x:double; a:mtx);
procedure add(var x: double; b:mtx);

... and the same for sub mul dvd

TODO in situ transposition based on GSL function

procedure elm(a:mtx; i, j: longint; x:double);
procedure elm(b:mtx; x:double);
function elm(a:mtx; b:mtx):boolean;
function elm(a:mtx; i, j: longint):double;

procedure equ(var r1:mtx; x:double); inline;
procedure equ(var r:mtx; a:mtx); inline;
procedure equ(var r:mtx; s:string);
procedure equ(var r:mtx; s:string; rnam:string); inline;
procedure equ(var r:mtx; x: double; a:mtx); inline;
procedure equ(var r:mtx; x:double; lgn, col:longint); inline;

------------------------------------------------------------------------
* Slices and access mode
------------------------------------------------------------------------

function col(a:mtx; j1, j2: longint): mtx;
function col(a:mtx; j1: longint): mtx;
function col(a:mtx): longint; inline;

function dia(a:mtx):mtx;

* NOTE tobe consistent I should use row rather than lgn (meaning less in english)
procedure lgn(var a:mtx; ri, rx:mtx);
procedure lgn(var a:mtx; r:mtx);
function lgn(a:mtx; i1,i2: longint): mtx;
function lgn(a:mtx; i1: longint): mtx;
function lgn(a:mtx): longint; inline;
function lgn(a:mtx; low, high:double):mtx;

function sli(a:mtx; l1, l2, c1, c2: longint): mtx;

function smx(a:mtx):boolean;
function smx(a:mtx; i1,j1:longint; lgn, col:longint):mtx;

function trp(a:mtx):mtx;

------------------------------------------------------------------------
* Miscelaneous operations
------------------------------------------------------------------------

procedure tra; inline;
procedure tra(p: boolean); inline;

//procedure wtrace(a,b:mtx; s:string);
//procedure wtrace(m:mtx; s:string);

//function mty(a:mtx):boolean; inline;

function nam(p:mtx):string; inline;

function spl( var s:mtx; x, y: mtx):boolean;
function sev(u:double; s:mtx):double;
function sev(var r:mtx; u:mtx; s:mtx):boolean;

procedure map(var r:mtx; var x:double); inline;
procedure map(var r:mtx; var x:double; lgn, col:longint);

//procedure mpt(a:mtx);
//procedure mpt(a:mtx; s:string); inline;

------------------------------------------------------------------------
* GSL partial interface
------------------------------------------------------------------------

TODO see wrap/avg for a simple usage
TODO link with fortran legacy code e.g. gcv09 and cp0

User smart inerface with wrap ...

