Skip to content
Mike Anderson edited this page Aug 28, 2013 · 9 revisions

Adding Vectorz as a dependency

You need to have the Vectorz library .jar and all its dependencies on your classpath if you want to use Vectorz.

The easiest way to do this is to use Maven (or a similar dependency manager like Leiningen) to download the latest Vectorz release from the Clojars repository.

If you want to download the dependencies manually, you can get them directly from the Clojars repository

Basic Vectorz types

mikera.vectorz.Vector is the most basic type in Vectorz - it represents a one-dimensional vector of double values, analogous to a normal Java array.

import mikera.vectorz.*;
...
Vector v=Vector.of(1,2,3,4);
double sum=v.elementSum(); // => 10.0

Factory classes

There are a lot of helpful static factory methods in the following classes:

  • mikera.vectorz.Vectorz
  • mikera.matrixx.Matrixx
  • mikera.arrayz.Arrayz

Example usage:

Matrix m = Matrix.createSquareMatrix(10); // => 10x10 square matrix, initially filled with zeros
Clone this wiki locally