Package org.apache.mahout.math.list

Examples of org.apache.mahout.math.list.IntArrayList.elements()


      if (value == 0) {
        DoubleArrayList valueList = values[i];
        indexList.remove(k);
        valueList.remove(k);
        int s = indexList.size();
        if (s > 2 && s * 3 < indexList.elements().length) {
          indexList.setSize(s * 3 / 2);
          indexList.trimToSize();
          indexList.setSize(s);

          valueList.setSize(s * 3 / 2);
View Full Code Here


      if (condition.apply(getQuick(i))) {
        matches.add(i);
      }
    }
    matches.trimToSize();
    return viewSelection(matches.elements());
  }

  /**
   * Construct and returns a new selection view.
   *
 
View Full Code Here

        matches.add(i);
      }
    }

    matches.trimToSize();
    return viewSelection(matches.elements(), null, null); // take all rows and columns
  }

  /**
   * Construct and returns a new selection view.
   *
 
View Full Code Here

        matches.add(i);
      }
    }

    matches.trimToSize();
    return viewSelection(matches.elements(), null); // take all columns
  }

  /**
   * Construct and returns a new selection view.
   *
 
View Full Code Here

      if (condition.apply(getQuick(i))) {
        matches.add(i);
      }
    }
    matches.trimToSize();
    return viewSelection(matches.elements());
  }

  /**
   * Construct and returns a new selection view.
   *
 
View Full Code Here

        matches.add(i);
      }
    }

    matches.trimToSize();
    return viewSelection(matches.elements(), null); // take all columns
  }

  /**
   * Construct and returns a new selection view.
   *
 
View Full Code Here

    Matrix compactedY = new DenseMatrix(Y.size(), numFeatures);
    IntArrayList indexes = Y.keys();
    indexes.quickSort();

    int row = 0;
    for (int index : indexes.elements()) {
      compactedY.assignRow(row++, Y.get(index));
    }

    return compactedY.transpose().times(compactedY);
  }
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.