In progress...

Example use:

using Arex;
using System;

namespace ArexTest
{
    class Program
    {
        static void Main(string[] args)
        {
            // First 3x3 array initialized with random values
            double[][] a = Factory.CreateDouble2D(3, 3); a.ByRandom();
            Console.Out.WriteLine(a.ToText());

            // Second 3x3 array initialized with random values
            double[][] b = Factory.CreateDouble2D(3, 3); b.ByRandom();
            Console.Out.WriteLine(b.ToText());

            // Array addition
            Console.Out.WriteLine(a.Add(b).ToText());
            // Scalar addition
            Console.Out.WriteLine(a.Add(1.0).ToText());
            // Matrix multiplication
            Console.Out.WriteLine(a.Matmul(b).ToText());

            // Third one dimensional array of 9 elements
            double[] c = new double[9]; c.ByRange(0.0, 1.0);
            // Resahape to 4x3 array (oversized elements are set to zero)
            Console.Out.WriteLine(c.Reshape(4, 3).ToText());

            Console.ReadKey();
        }
    }
}

Last edited Apr 10, 2013 at 6:42 AM by akustra, version 3

Comments

No comments yet.