Examples of VectorzException


Examples of mikera.vectorz.util.VectorzException

    return g;
  }
 
  @Override
  public void validate() {
    if (length>data.length) throw new VectorzException("data array is wrong size!?!");
    super.validate();
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

      rp.permute(columnPermutations);
      columnPermutations=cp;

      source=pm.source;
    }
    if (source.rowCount()!=rowPermutations.length()) throw new VectorzException("Incorrect row permutation count: "+rowPermutations.length());
    if (source.columnCount()!=columnPermutations.length()) throw new VectorzException("Incorrect column permutation count: "+columnPermutations.length());
    this.rowPermutations=rowPermutations;
    this.columnPermutations=columnPermutations;
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    return SliceArray.create(al);
  }
 
  public static SliceArray<INDArray> create(List<INDArray> slices) {
    int slen=slices.size();
    if (slen==0) throw new VectorzException("Empty list of slices provided to SliceArray");
    INDArray[] arr=new INDArray[slen];
    return new SliceArray<INDArray>(IntArrays.consArray(slen,slices.get(0).getShape()),slices.toArray(arr));
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

  @Override
  public double get(int... indexes) {
    int d=indexes.length;
    T slice=slices[indexes[0]];
    switch (d) {
      case 0: throw new VectorzException("Can't do 0D get on SliceArray!");
      case 1: return slice.get();
      case 2: return slice.get(indexes[1]);
      case 3: return slice.get(indexes[1],indexes[2]);
      default: return slice.get(Arrays.copyOfRange(indexes,1,d));
    }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

      set(value);
    }
   
    T slice=slices[indexes[0]];
    switch (d) {
      case 0: throw new VectorzException("Can't do 0D set on SliceArray!");
      case 1: slice.set(value); return;
      case 2: slice.set(indexes[1],value); return;
      case 3: slice.set(indexes[1],indexes[2],value); return;
      default: slice.set(Arrays.copyOfRange(indexes,1,d),value); return;
    }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    return true;
  }

  @Override
  public void validate() {
    if (shape.length!=longShape.length) throw new VectorzException("Shape mismatch");
   
    long ec=0;
    for (int i=0; i<slices.length; i++) {
      T s=slices[i];
      ec+=s.elementCount();
      slices[i].validate();
      int[] ss=s.getShape();
      for (int j=0; j<ss.length; j++) {
        if(getShape(j+1)!=ss[j]) throw new VectorzException("Slice shape mismatch");
      }
    }
    if (ec!=elementCount()) throw new VectorzException("Element count mismatch");
   
    super.validate();
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

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

Examples of mikera.vectorz.util.VectorzException

  // =============================================
  // Standard implementations

  @Override
  public final double get(int row) {
    throw new VectorzException("1D get not supported on matrix!");
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    throw new VectorzException("1D get not supported on matrix!");
  }
 
  @Override
  public final double get() {
    throw new VectorzException("0D get not supported on matrix!");
  }
View Full Code Here

Examples of mikera.vectorz.util.VectorzException

    throw new VectorzException("0D get not supported on matrix!");
  }
 
  @Override
  public void set(int row, double value) {
    throw new VectorzException("1D get not supported on matrix!");
  }
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.