Package fork.lib.math.algebra.elementary.set.continuous

Examples of fork.lib.math.algebra.elementary.set.continuous.Region


* join regions that are close together
* @param rs
*/
protected void join(ArrayList<Region> rs){
    for( int i=0; i<rs.size()-1; i++ ){
        Region r= (Region)rs.get(i);
        Region rn= (Region)rs.get(i+1);
        if(rn.higherThan(r)){
            double dis= rn.low-r.high;
            if(dis<=par.joinGap){
                try{
                    Region ovl= new Region(r.low, rn.high);
                    rs.set(i, ovl);
                    rs.remove(rn);
                    i--;
                }catch(RegionException re){
                    re.printStackTrace();
View Full Code Here


public boolean satisfyMin(Landscape2D data){
    ArrayList<Region> ps= data.getRegions();
    if(ps==null || ps.isEmpty()){
        return false;
    }
    Region r= data.getXRange();
    double w= r.high-r.low+1;
    return w>=minWidth;
}
View Full Code Here

public boolean satisfyMax(Landscape2D data){
    ArrayList<Region> ps= data.getRegions();
    if(ps==null || ps.isEmpty()){
        return false;
    }
    Region r= data.getXRange();
    double w= r.high-r.low+1;
    return w<=maxWidth;
}
View Full Code Here

public void printAll(){
    printAll(this, "");
}
   
protected void printAll(EMPeakDetector p, String tag){
    Region reg= p.data.getXRange();
    ArrayList<EMPeakDetector> spds= p.subs;
    double sthr= p.thr;
    int l= (int) reg.low;
    int h= (int) reg.high;
    System.out.println(tag+" "+l+" - "+h+"  thr: "+sthr);
View Full Code Here

public void printLeaf(String tag){
    printLeaf(tag, this);
}

protected void printLeaf(String t, EMPeakDetector p){
    Region reg= p.data.getXRange();
    ArrayList<EMPeakDetector> spds= p.subs;
    int l= (int) reg.low;
    int h= (int) reg.high;
    if(spds!=null && spds.size()>0){
        for( int i=0; i<spds.size() ; i++ ){
View Full Code Here

    }

    public Landscape2D(ArrayList<Double> vs, ArrayList<Double> poss) throws RegionException, Landscape2DException{
        regs= new ArrayList<>();
        for( int i=0; i<vs.size()-1 ; i++ ){
            Region r= new Region(poss.get(i), poss.get(i+1));
            r.attr= vs.get(i);
            add(r);
        }
        init();
    }
View Full Code Here

    }
   
    public Landscape2D(ArrayList<Point2D> ps) throws RegionException, Landscape2DException{
        regs= new ArrayList<>();
        for( int i=0; i<ps.size()-1 ; i++ ){
            Region r= new Region(ps.get(i).x, ps.get(i+1).x);
            r.attr= new Double(ps.get(i).y);
            add(r);
        }
        init();
    }
View Full Code Here

    }
}

public void checkAllNumeric() throws Landscape2DException{
    for( int i=0; i<regs.size() ; i++ ){
        Region r= regs.get(i);
        if(!checkNumeric(r)){
            throw new Landscape2DException();
        }
    }
}
View Full Code Here

    if(!regs.isEmpty()){
        if(!r.higherThan(regs.get(regs.size()-1))){
            System.err.println((int)r.low+"    not higher than   "+ (int)regs.get(regs.size()-1).high);
            throw new Landscape2DException();
        }
        Region lr= regs.get(regs.size()-1);
        if(r.low== lr.high+1){
            if(((Double)lr.attr).equals( (Double)r.attr)){
                try{
                    Region nr= new Region(lr.low, r.high);
                    nr.attr= lr.attr;
                    regs.set(regs.size()-1, nr);
                }catch(RegionException re){}
            }else{
                regs.add(r);
View Full Code Here

public Region getXRange(){
    if(regs==null || regs.isEmpty()){
        return null;
    }
    try{
        return new Region(regs.get(0).low, regs.get(regs.size()-1).high);
    }catch(RegionException re){
        re.printStackTrace();
        return null;
    }
}
View Full Code Here

TOP

Related Classes of fork.lib.math.algebra.elementary.set.continuous.Region

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.