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

cern.colt.matrix.tint.impl.DenseLargeIntMatrix3D 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.tint.impl;

import cern.colt.matrix.tint.IntMatrix3D;

/**
 * Dense 3-d matrix holding int 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 three-dimensional array, elements[slices][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 DenseLargeIntMatrix3D extends WrapperIntMatrix3D { private static final long serialVersionUID = 1L; private int[][][] elements; public DenseLargeIntMatrix3D(int slices, int rows, int columns) { super(null); try { setUp(slices, rows, columns); } catch (IllegalArgumentException exc) { // we can hold slices*rows*columns>Integer.MAX_VALUE cells ! if (!"matrix too large".equals(exc.getMessage())) throw exc; } elements = new int[slices][rows][columns]; } public int getQuick(int slice, int row, int column) { return elements[slice][row][column]; } public void setQuick(int slice, int row, int column, int value) { elements[slice][row][column] = value; } public int[][][] elements() { return elements; } protected IntMatrix3D getContent() { return this; } public IntMatrix3D like(int slices, int rows, int columns) { return new DenseLargeIntMatrix3D(slices, rows, columns); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy