Examples of VectorzException


Examples of mikera.vectorz.util.VectorzException

    return result;
  }
 
  @Override public void validate() {
    super.validate();
    if (lowerBandwidthLimit()<0) throw new VectorzException("Negative lower bandwidth limit?!?");
    int minBand=-lowerBandwidthLimit();
    int maxBand=upperBandwidthLimit();
    if (minBand<=-rowCount()) throw new VectorzException("Invalid lower limit: "+minBand);
    if (maxBand>=columnCount()) throw new VectorzException("Invalid upper limit: "+maxBand);
    for (int i=minBand; i<=maxBand; i++) {
      AVector v=getBand(i);
      if (bandLength(i)!=v.length()) throw new VectorzException("Invalid band length: "+i);
    }
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    return DiagonalMatrix.create(data);
  }
 
  @Override
  public void validate() {
    if (dimensions!=data.length) throw new VectorzException("dimension mismatch: "+dimensions);
   
    super.validate();
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

 
  @Override
  public void validate() {
    super.validate();
    for (int i=0; i<cols; i++) {
      if (getColumn(i).length()!=rows) throw new VectorzException("Invalid row count at column: "+i);
    }
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

  }
 
  @Override
  public void addMultiple(Vector source, Index index, double factor) {
    int len=source.length();
    if (index.length()!=len) throw new VectorzException(ErrorMessages.incompatibleShapes(index, source));
    for (int i=0; i<len; i++) {
      int j=index.data[i];
      this.data[j]+=source.data[i]*factor;
    }
  }
 
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

  }
 
  @Override
  public void addMultiple(Index destToSource, Vector source, double factor) {
    int len=this.length();
    if (destToSource.length()!=len) throw new VectorzException("Index length must match this vector");
    for (int i=0; i<len; i++) {
      int j=destToSource.data[i];
      this.data[i]+=source.data[j]*factor;
    }
  }
 
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

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

Examples of mikera.vectorz.util.VectorzException

    int[] ret=new int[n];
    int di=0;
    for (int i=0; i<data.length; i++) {
      if (data[i]!=0.0) ret[di++]=index.get(i);
    }
    if (di!=n) throw new VectorzException("Invalid non-zero index count. Maybe concurrent modification of vector?");
    return ret;
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

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

Examples of mikera.vectorz.util.VectorzException

    return SparseIndexedVector.create(this);
  }
 
  @Override
  public void validate() {
    if (length<=0) throw new VectorzException("Illegal length: "+length);
    for (Entry<Integer, Double> e:hash.entrySet()) {
      int i=e.getKey();
      if ((i<0)||(i>=length)) throw new VectorzException(ErrorMessages.invalidIndex(this, i));
      if (e.getValue()==0.0) throw new VectorzException("Unexpected zero at index: "+i);
    }
    super.validate();
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    return new IndexVector(index.clone());
  }
 
  @Override
  public void validate() {
    if (length!=index.length()) throw new VectorzException("Incorrect index length!!");
    super.validate();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.