Package mikera.vectorz.util

Examples of mikera.vectorz.util.VectorzException


  @Override
  public void validate() {
    super.validate();
    int slen=source.length();
    for (int i=0; i<length; i++) {
      if ((indexes[i]<0)||(indexes[i]>=slen)) throw new VectorzException("Indexes out of range");
    }
  }
View Full Code Here


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

    return new SparseImmutableVector(length,index.clone(),data.clone());
  }
 
  @Override
  public void validate() {
    if (data.length==0) throw new VectorzException("SparseImmutableVector must have some non-zero values");
    if (index.length()!=data.length) throw new VectorzException("Inconsistent data and index!");
    if (!index.isDistinctSorted()) throw new VectorzException("Invalid index: "+index);
    for (int i=0; i<data.length; i++) {
      if (data[i]==0) throw new VectorzException("Should be no zero values in data array!");
    }
    super.validate();
  }
View Full Code Here

  }

  @Override
  public void validate() {
    if ((index < 0) || (index >= array.length)) {
      throw new VectorzException("Index out of bounds");
    }
    super.validate();
  }
View Full Code Here

    return true;
  }
 
  @Override
  public void validate() {
    if (length!=indexes.length) throw new VectorzException("Wrong index length");
    super.validate();
  }
View Full Code Here

    }
  }
 
  @Override
  public void validate() {
    if ((index<0)||(index>=vector.length())) throw new VectorzException("Index out of bounds");
    super.validate();
  }
View Full Code Here

  }

  @Override
  public void validate() {
    if (length>0) {
      if ((offset<0)||(offset>=data.length)) throw new VectorzException("offset out of bounds: "+offset);
      int lastIndex=offset+(stride*(length-1));
      if ((lastIndex<0)||(lastIndex>=data.length)) throw new VectorzException("lastIndex out of bounds: "+lastIndex);
    }
   
    super.validate();
  }
View Full Code Here

  }
 
  @Override
  public void validate() {
    super.validate();
    if (splits[n]!=length) throw new VectorzException("Unexpected final slit position - not equal to JoinedMultVector length");
  }
View Full Code Here

    int[] rs=new int[keySet.size()];
    int i=0;
    for (Integer x:keySet) {
      rs[i++]=x;
    }
    if (i!=rs.length) throw new VectorzException(ErrorMessages.impossible());
    return new Index(rs);
  }
View Full Code Here

    return equals(m);
  }
 
  @Override
  public void validate() {
    if (dimensions!=getLeadingDiagonal().length()) throw new VectorzException("dimension mismatch: "+dimensions);
   
    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.