Menu

GettingStarted Log in to Edit

Nasos Iliopoulos

Introduction

larray is a template library, hence it doesn't need compilation to be used. Just copy the header files in a common path, or a local project folder and start using it. Alternatively scripts that install in common locations can be found in the trunk repository.

Downloading

The library headers can be found -here-, while the full distribution including larray development files (you need those only if you are modifying larray itself) and examples can be found -here-.

Installing

Using without system wide installation

Standard installation

Running a simple program

After you have installed the larray library, make a text file named main.cpp containing:

#include <larray/larray.hpp>
#include <iostream>
int main() {
    typedef larray<double, dyn, 3>::size_type size_type;

    larray<double, dyn, 3> mat;
    mat.resize(3,3);

    for (size_type i=0; i!=3; i++)
        for (size_type j=0; j!=3; j++)
            mat(i,j) = i+j + i*j;

    for (size_type i=0; i!=3; i++) {
        for (size_type j=0; j!=3; j++)
           std::cout << mat(i,j) << " ";
        std::cout << std::endl;
    }

    return 0;
}

In Linux or Mac OS X compile using (debug build):

g++  main.cpp -o getting_started_debug

or (release build):

g++ -03 -DNDEBUG main.cpp -o getting_started_release

run it with:

./getting_started_debug

or

./getting_started_release

Discussion

Anonymous
Anonymous

Add attachments
Cancel