Algae ![]() |
http://algae.sourceforge.net |
Description: | Algae is an interpreted language for numerical analysis and
matrix processing, similar to Octave or MATLAB. Algae is said to be
very fast. It is free software under the GNU General Public
License.
Some facts:
|
Hello World | Michael Neumann |
# Hello World in Algae printf("Hello World\n"); |
Prints "Hello World" onto the
screen. |
Misc | Michael Neumann |
# fill(shape; values) fill(3,4; 1,2,3,4) # => 3x4 matrix filled (row-wise) with 1,2,3,4 diag(1,2,3) # 3x3 matix with 1,2,3 on the diagonal # linspace(a; b; n) linspace(1;10;100) creates a vector with 100 elements from 1 to 10 # ident(n) # creates the nxn identity matrix |
Squares (1) | Michael Neumann |
# Note that functions can be applied to scalars as well as to vectors or matrices squares = function(x) { return x^2; } nums = 1:10:1; # a vector containing elements from 1 to 10 print( squares(nums) ); # or ... print( nums^2 ); |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
for (i in 1:10) { printf("%d "; i^2); } printf("\n"); |
Outputs the squares from 1 to
10. |