Package mikera.vectorz.util

Examples of mikera.vectorz.util.VectorzException


    } else {
      int dims=a.dimensionality();
      switch (dims) {
        case 0: multiply(a.get()); return;
        case 1: multiply(a.asVector()); return;
        default: throw new VectorzException("Can't multiply vector with array of dimensionality: "+dims);
      }
    }
  }
View Full Code Here


    }
  }
 
  @Override
  public void validate() {
    if (length()<0) throw new VectorzException("Illegal length! Length = "+length());
    super.validate();
  }
View Full Code Here

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

  }
 
  @Override
  public void validate() {
    super.validate();
    if (!equals(this.exactClone())) throw new VectorzException("Thing not equal to itself");
    if (offset<0) throw new VectorzException("Negative offset! ["+offset+"]");
    if (index(rows-1,cols-1)>=data.length) throw new VectorzException("Negative offset! ["+offset+"]");
  }
View Full Code Here

  }
 
  @Override
  public void validate() {
    super.validate();
    if (size!=perm.length()) throw new VectorzException("Whoops!");
  }
View Full Code Here

  public void validate() {
    int rc=rowCount();
    int cc=columnCount();
    for (int i=0; i<rc; i++) {
      int s=components.get(i);
      if ((s<0)||(s>=cc)) throw new VectorzException("Component out of range at row "+i);
    }
    super.validate();
  }
View Full Code Here

  @Override
  public void validate() {
    super.validate();
        int dlen = data.length;
    if (dlen != lineCount()) throw new VectorzException("Too many rows");
    for (int i = 0; i < dlen; ++i) {
            AVector vec = unsafeGetVec(i);
      int vlen = (vec == null) ? lineLength() : vec.length();
      if (vlen!=lineLength()) throw new VectorzException("Wrong length data line vector, length "+vlen+" at position: "+i);
    }
  }
View Full Code Here

            * (1 - ca) + u * sa, w * w + (1 - w * w) * ca);
  }

  public static Matrix33 createRotationMatrix(AVector v, double angle) {
    if (!(v.length() == 3))
      throw new VectorzException(
          "Rotation matrix requires a 3d axis vector");
    return createRotationMatrix(v.unsafeGet(0), v.unsafeGet(1),
        v.unsafeGet(2), angle);
  }
View Full Code Here

    }   
  }
 
  @Override public void validate() {
    super.validate();
    if (minBand!=-lowerBandwidthLimit()) throw new VectorzException("Mismatched lower limit: "+minBand);
    if (maxBand!=upperBandwidthLimit()) throw new VectorzException("Mismatched upper limit: "+maxBand);
  }
View Full Code Here

  }
 
  @Override
  public void validate() {
    if (!clone().isBoolean()) {
      throw new VectorzException("Clone of boolean matrix should be boolean!");
    }
    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.