Package mikera.vectorz.util

Examples of mikera.vectorz.util.VectorzException


  @Override
  public void set(int[] indexes, double value) {
    if (indexes.length==2) {
      set(indexes[0],indexes[1],value);
    } else {
      throw new VectorzException(""+indexes.length+"D set not supported on AMatrix");
    }
  }
View Full Code Here


          } else {
            return SingleElementVector.create(val,i,len);
          }
        }
      }
      throw new VectorzException("non-zero element not found!!");
    } else if (n>(len*SPARSE_DENSITY_THRESHOLD)) {
      return Vector.create(v); // not enough sparsity to make worthwhile
    } else {
      return SparseIndexedVector.create(v);
    }
View Full Code Here

      return super.elementIterator();
    }
  }
 
  @Override public void validate() {
    if (dimensions>shape.length) throw new VectorzException("Insufficient shape data");
    if (dimensions>stride.length) throw new VectorzException("Insufficient stride data");
   
    if ((offset<0)||(offset>=data.length)) throw new VectorzException("Offset out of bounds");
    int[] endIndex=IntArrays.decrementAll(shape);
    int endOffset=offset+IntArrays.dotProduct(endIndex, stride);
    if ((endOffset<0)||(endOffset>data.length)) throw new VectorzException("End offset out of bounds");
    super.validate();
  }
View Full Code Here

  @Override
  public void validate() {
    super.validate();
    if (dimensions != shape.length)
      throw new VectorzException("Inconsistent dimensionality");
    if ((dimensions > 0) && (strides[dimensions - 1] != 1))
      throw new VectorzException("Last stride should be 1");

    if (data.length != IntArrays.arrayProduct(shape))
      throw new VectorzException("Inconsistent shape");
    if (!IntArrays.equals(strides, IntArrays.calcStrides(shape)))
      throw new VectorzException("Inconsistent strides");
  }
View Full Code Here

   
    if (object.getClass().isArray()) {
      return create(Arrays.asList((Object[])object));
    }
   
    throw new VectorzException("Don't know how to create array from: "+object.getClass());
  }
View Full Code Here

TOP

Related Classes of mikera.vectorz.util.VectorzException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.