
one.empty3.library.DoubleArray Maven / Gradle / Ivy
/*
*
* * Copyright (c) 2024. Manuel Daniel Dahmen
* *
* *
* * Copyright 2024 Manuel Daniel Dahmen
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*
*/
package one.empty3.library;
import java.util.*;
/**
* mettre dans des espaces et les supprimer
* quand ils sont vides.
*/
public class DoubleArray {
private int [] stack = new int [5];
public int current = 0;
private int length = 1000*1000;
List doubles;
List index;
List dimensions;
int spaces;
boolean [] freeSpace;
int max = 0;
public DoubleArray(int spaces, int spaceLength){
freeSpace = new boolean[spaces];
this.spaces = spaces;
doubles = new ArrayList<>();
doubles.add(new Double[spaceLength]);
index = new ArrayList<>();
index.add(new Integer[spaceLength]);
dimensions = new ArrayList<>();
dimensions.add(new Integer[spaceLength]);
// location = new ArrayList<>()
}
public void clear() {
for(int i=0; i=0;
}
// copy to free memory disallocated space.
public void save(int start0) {
int n = dimensions.get(0)[this.index.get(0)[start0]];
for(int i= 0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy