GotoBLAS2

MinGW should be installed first. Next… GotoBLAS2 GotoBLAS2 is an implementation of Basic Linear Algebra Subprograms (BLAS). LAPACK uses BLAS. GotoBLAS2 has configurations for a variety of hardware platforms. It builds a library that is optimized for the given PC’s CPU. Make a folder called:… Read more

Matrix Inversion in LAPACK

Here is a Fortran program which performs matrix inversion using the LU decomposition method:  INVERSE_MATRIX.F It is compiled via: gfortran -o INVERSE_MATRIX INVERSE_MATRIX.F -llapack It compiles & runs under both Ubuntu & Cygwin. See also: http://www.nag.com/numeric/fl/nagdoc_fl23/examples/source/f07ajfe.f90 * * * The INVERSE_MATRIX.F program uses the subroutines:… Read more

C/C++ Tips

Passing 1D array as function argument Example… // prototype function declaration void calc(double *x); double a[1000]; int main() { // call calc calc(a); } void calc(double *x) { // do some calculations } *************************************************************** Dynamic Memory Allocation for 1D Array int* a = NULL;     //… Read more

Mixed C++ Fortran Programming

This is another matrix multiplication project using the BLAS function dgemm. It is complied and run in an Ubuntu system. The set consists of two programs:  (right mouse click.  save target or link as) matrix_mult_cf.cpp fort_matmul_main.f The set calculates: C = A*B The C++ program… Read more

Ubuntu Plotting Programs

I am evaluating plotting programs for Ubuntu.  I already have plotting capability via Matlab and Python/matplotlib running under Ubuntu. The Matlab export plot quality is ok but not great. So far my Python knowledge only extends to making static plots.  Identifying interactive, dynamic plotting methods… Read more

MinGW Windows Installation

MinGW stands for Minimalist GNU for Windows. MinGW is a native software port of the GNU Compiler Collection (GCC) and GNU Binutils for use in the development of native Microsoft Windows applications. MinGW can be downloaded with Code::Blocks. Or it can be downloaded via  soureforge.… Read more

C/C++ Read 2D Array

The following program reads a 2D array of numbers.  The array may have an arbitrary or unknown number of rows and columns up to a certain cell limit. The program counts the number of columns and rows as it reads the data. The program souce… Read more

Cygwin

Cygwin is a collection of tools which provide a Linux look and feel environment for Windows. It is also a DLL (cygwin1.dll) which acts as a Linux Application Programming Interface (API) layer providing substantial Linux API functionality. Cygwin is not a way to run native… Read more

Linux Ubuntu Tips

The make install command is necessary to build certain software package. This may result in an error such as: /usr/local/lib: Permission denied The problem can be fixed by typing: su -c “make install” Then enter root password when prompted * * * The Update Manager… Read more

Cython

Cython is a compiler which compiles Python-like code files to C code. The resulting functions can then be imported into other Python scripts. This method can be used to increase the execution speed of a Python script, particularly if the script uses for-loops. I have… Read more