Package mikera.vectorz.util

Examples of mikera.vectorz.util.VectorzException


    return this;
  }
 
  @Override
  public void validate() {
    if (length<=0) throw new VectorzException("Axis vector length is too small: "+length);
    if ((axis()<0)||(axis()>=length)) throw new VectorzException("Axis index out of bounds");
    super.validate();
  }
View Full Code Here


   * Creates a SparseIndexedVector using the given sorted Index to identify the indexes of non-zero values,
   * and a double[] array to specify all the non-zero element values
   */
  public static SparseIndexedVector create(int length, Index index, double[] data) {
    if (!index.isDistinctSorted()) {
      throw new VectorzException("Index must be sorted and distinct");
    }
    if (!(index.length()==data.length)) {
      throw new VectorzException("Length of index: mismatch woth data");     
    }
    return new SparseIndexedVector(length, index.clone(),DoubleArrays.copyOf(data));
  }
View Full Code Here

      return -1;
    }
    for (int i=0; i<length; i++) {
      if (!index.contains(i)) return i;
    }
    throw new VectorzException(ErrorMessages.impossible());
  }
View Full Code Here

    return new SparseIndexedVector(length,index.clone(),data.clone());
  }
 
  @Override
  public void validate() {
    if (index.length()!=data.length) throw new VectorzException("Inconsistent data and index!");
    if (!index.isDistinctSorted()) throw new VectorzException("Invalid index: "+index);
    super.validate();
  }
View Full Code Here

    return this;
  }
 
  @Override
  public void validate() {
    if ((offset<0)||(offset+length>data.length)||(length<0)) throw new VectorzException("ImmutableVector data out of bounds");
    super.validate();
  }
View Full Code Here

    this.col=col;
  }
 
  public static MatrixIndexScalar wrap(AMatrix matrix, int row, int col) {
    MatrixIndexScalar m= new MatrixIndexScalar(matrix,row,col);
    if (!m.isValidIndex()) throw new VectorzException(ErrorMessages.invalidIndex(matrix, row,col));
    return m;
  }
View Full Code Here

    return ImmutableScalar.create(get());
  }
 
  @Override
  public void validate() {
    if (!isValidIndex()) throw new VectorzException(ErrorMessages.invalidIndex(matrix, row,col));
    super.validate();
  }
View Full Code Here

    return true;
  }
 
  @Override
  public void validate() {
    if (length!=pos[numArrays]) throw new VectorzException("End position incorrect!?!");
   
    for (int i=0; i<numArrays; i++) {
      getSegment(i).validate();
    }
   
View Full Code Here

  public void validate() {
    int length = length();
    double[] data = getArray();
    int offset = getArrayOffset();
    if ((offset < 0) || (offset + length > data.length)) {
      throw new VectorzException("ArrayVector out of bounds");
    }
    super.validate();
  }
View Full Code Here

    return new JoinedVector(left.exactClone(),right.exactClone());
  }
 
  @Override
  public void validate() {
    if (left.tryEfficientJoin(right)!=null) throw new VectorzException("Should have used efficient join!");
    super.validate();
  }
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.