All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cern.colt.matrix.tlong.impl.DenseLargeLongMatrix2D Maven / Gradle / Ivy

Go to download

Parallel Colt is a multithreaded version of Colt - a library for high performance scientific computing in Java. It contains efficient algorithms for data analysis, linear algebra, multi-dimensional arrays, Fourier transforms, statistics and histogramming.

The newest version!
/*
Copyright (C) 1999 CERN - European Organization for Nuclear Research.
Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose 
is hereby granted without fee, provided that the above copyright notice appear in all copies and 
that both that copyright notice and this permission notice appear in supporting documentation. 
CERN makes no representations about the suitability of this software for any purpose. 
It is provided "as is" without expressed or implied warranty.
 */
package cern.colt.matrix.tlong.impl;

import cern.colt.matrix.tlong.LongMatrix1D;
import cern.colt.matrix.tlong.LongMatrix2D;

/**
 * Dense 2-d matrix holding long elements. First see the package summary and javadoc tree view to get the broad picture.
 * 

* Implementation: *

* This data structure allows to store more than 2^31 elements. Internally holds * one two-dimensional array, elements[rows][columns]. Note that this * implementation is not synchronized. *

* Time complexity: *

* O(1) (i.e. constant time) for the basic operations get, * getQuick, set, setQuick and size. * * @author Piotr Wendykier ([email protected]) * */ public class DenseLargeLongMatrix2D extends WrapperLongMatrix2D { private static final long serialVersionUID = 1L; private long[][] elements; public DenseLargeLongMatrix2D(int rows, int columns) { super(null); try { setUp(rows, columns); } catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } elements = new long[rows][columns]; content = this; } public long getQuick(int row, int column) { return elements[row][column]; } public void setQuick(int row, int column, long value) { elements[row][column] = value; } public long[][] elements() { return elements; } protected LongMatrix2D getContent() { return this; } public LongMatrix2D like(int rows, int columns) { return new DenseLargeLongMatrix2D(rows, columns); } public LongMatrix1D like1D(int size) { return new DenseLongMatrix1D(size); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy