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

matlabcontrol.link.MatlabLogicalFullMatrix Maven / Gradle / Ivy

There is a newer version: 4.6.0
Show newest version
/*
 * Code licensed under new-style BSD (see LICENSE).
 * All code up to tags/original: Copyright (c) 2013, Joshua Kaplan
 * All code after tags/original: Copyright (c) 2016, DiffPlug
 */
package matlabcontrol.link;

/**
 *
 * @since 4.2.0
 * @author Joshua Kaplan
 */
class MatlabLogicalFullMatrix extends MatlabLogicalMatrix {
	private final FullArray _array;

	MatlabLogicalFullMatrix(boolean[] values, int[] dimensions) {
		_array = new FullArray(boolean[].class, values, null, dimensions);
	}

	MatlabLogicalFullMatrix(T values) {
		_array = new FullArray(boolean[].class, values, null);
	}

	@Override
	BaseArray getBaseArray() {
		return _array;
	}

	@Override
	public boolean getElementAtLinearIndex(int linearIndex) {
		return _array._real[linearIndex];
	}

	@Override
	public boolean getElementAtIndices(int row, int column) {
		return _array._real[_array.getLinearIndex(row, column)];
	}

	@Override
	public boolean getElementAtIndices(int row, int column, int page) {
		return _array._real[_array.getLinearIndex(row, column, page)];
	}

	@Override
	public boolean getElementAtIndices(int row, int column, int[] pages) {
		return _array._real[_array.getLinearIndex(row, column, pages)];
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy