/*
* This code is part of Project Waterloo from King's College London
*
*
* Copyright King's College London 2011-
*
* @author Malcolm Lidierth, King's College London [Contact]
*
* Project Waterloo is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Project Waterloo is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*
*/
package kcl.waterloo.graphics.data;
/**
* Wrapper class for a double[].
*
* This class permits double arrays contained as a property in the wrapper to be
* passed by reference - useful in environments that support that for Java
* objects but not for primitive data types e.g. MATLAB
*
* @author Malcolm Lidierth, King's College London [Contact]
*/
public class PrimitiveDoubleBuffer {
/**
* Data vector.
*/
double[] data = null;
/**
* Constructs a new instance with a zero length vector.
*/
public PrimitiveDoubleBuffer() {
}
/**
* Constructs a new instance with a vector of length sz.
*
* @param sz
*/
public PrimitiveDoubleBuffer(int sz) {
data = new double[sz];
}
/**
* Constructs a new instance copying the input.
*
* @param arr
*/
public PrimitiveDoubleBuffer(double[] arr) {
this(arr, true);
}
// /**
// * Constructs a new instance copying the input.
// *
// * @param arr
// */
// public PrimitiveDoubleBuffer(Double[] arr) {
// this(new double[arr.length],false);
// double[] arr2=getDataRef();
// for (int k=0; k
Ads help maintain this website.