M_matrix(3f) - [M_matrix::INTRO] The Los Alamos-inspired Linear Algebra Fortran Facility (LALA) LICENSE(MIT)
Description
Examples
The M_matrix module contains the Linear Algebra Fortran Facility (LALA) which allows for interacting with a Fortran program using MatlabAll together, this allows lala(3f) to be used for self-describing configuration and data files, inspecting data in existing programs, transferring small amounts of data between programs or assisting in debugging and development, unit testing and macro-level timing.
or Octave-like commands. LALA is also usable as a simple one-line language. It is a WIP (Work In Progress) but is already useful.
o You can pass intrinsic-type data easily between your Fortran program and the LALA utility. o blocks of LALA commands may be passed to lala(3f) as well. o external files containing lala(3f) commands may be read to create data or as configuration files. o LALA commands may be recorded and played back. o a command-line based command history allowed for recalling and editing input. o a stand-alone program lets you create and test LALA files. It is a flexible calculator utility all by itself. o a built-in help command describes the many functions and commands o a user-added Fortran routine may be called via the USER() function.
Sample program:
program demo_M_matrix use M_matrix, only : lala, put_into_lala, get_from_lala, ifin_lala !real,allocatable :: r !complex,allocatable :: cvec(:) integer,allocatable :: iarr(:,:) character(len=:),allocatable :: t(:) integer :: ierr integer :: i! store some data into lala(3) call put_into_lala(A,[1,2,3,4,5]*10.5,ierr) write(*,*)is A defined in LALA?,ifin_lala(A) call lala(A/2.0)
! pass some commands to lala(3f) call lala([character(len=80) :: & &PI=atan(1)*4 , & &"mytitle=this is my title;", & &littlearray=< , & & 1 2 3; , & & 4 5 6; , & & 7 8 9; , & &> , & &S=sum(A) , & &I=inv(littlearray); , & &B=littlearray*sin(PI/3) , & &"save(keepB,B) ", & &])
! read a file containing lala(3f) commands call lala("exec(mycommands);")
! interactively interact with lala(3f) interpreter call lala()
! get some data from LALA into the calling program call get_from_lala(littlearray,iarr,ierr) write(*,(a))IN CALLING PROGRAM IARR= write(*,(1x,*(g0,1x)))(IARR(i,:),new_line(A),i=1,size(iarr,dim=1))
call get_from_lala(mytitle,t,ierr) write(*,*)IN CALLING PROGRAM T=,t
end program demo_M_matrix
Nemo Release 3.1 | M_matrix (3) | February 23, 2025 |