Codota Logo
Vector.divide
Code IndexAdd Codota to your IDE (free)

How to use
divide
method
in
eu.monnetproject.math.sparse.Vector

Best Java code snippets using eu.monnetproject.math.sparse.Vector.divide (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: com.github.monnetproject/bliss.sparsemath

@Override
public void divide(int idx, double val) {
  v.divide(idx, val);
}
origin: com.github.monnetproject/bliss.sparsemath

@Override
public void divide(int idx, int val) {
  v.divide(idx, val);
}
origin: com.github.monnetproject/bliss.betalm

p.mu.divide(i, read);
p.df.divide(i, p.J);
p.sumMu2 += p.mu.doubleValue(i) *p.mu.doubleValue(i);
origin: com.github.monnetproject/bliss.sparsemath

/**
 * Compute the householder vector of a given vector
 *
 * Complexity: O(sparsity(n))
 *
 * @return A vector with v(1) = 1 and (I - 2vv^T /v^Tv)x is zero in all but
 * first component
 */
public static Vector<Double> house(Vector<Double> x, int j) {
  final int n = x.length();
  double mu = 0.0;
  final double[] x2 = x.toDoubleArray();
  for (int i = j; i < n; i++) {
    mu += x2[i] * x2[i];
  }
  mu = Math.sqrt(mu);
  final Vector<Double> v = x.clone();
  if (mu != 0.0) {
    final double beta = x.doubleValue(0) + Math.signum(x.doubleValue(0)) * mu;
    for (int i = 1; i < v.length(); i++) {
      v.divide(i, beta);
    }
  }
  v.put(0, 1);
  return v;
}
origin: com.github.monnetproject/bliss.betalm

public BetaLMImpl(File data) throws IOException {
  final ParallelReader pr = ParallelReader.fromFile(data);
  this.W = pr.W();
  this.x = pr.x;
  this.mu = new RealVector(this.W);
  this.mu_f = new RealVector(this.W);
  this.sumMu2 = initMu(x, this.W);
  if (method == Method.DF_DICE || method == Method.DF_JACCARD) {
    df = new RealVector(this.W);
    this.dfSp = null;
    for (int j = 0; j < x.length; j++) {
      for (int w : x[j][0].keySet()) {
        df.add(w, 1);
      }
    }
    for (int w = 0; w < this.W; w++) {
      df.divide(w,x.length);
    }
  } else {
    df = null;
    dfSp = null;
  }
}
eu.monnetproject.math.sparseVectordivide

Javadoc

Divide a value by a value in the sparse array. This will automatically remove an element if it results in the value at this index being the sparse value

Popular methods of Vector

  • entrySet
    Get all non-sparse values in the array
  • sum
    Get the sum of all the values in this vector
  • add
    Add a vector to this vector. This will automatically remove an element if it results in the value at
  • containsKey
    Is the following index in range and with non-default value
  • doubleValue
    The value at the given index. Note the default value will be returned at sparse indexes
  • keySet
    Get the set of indices with non-default value
  • length
    Get the length (i.e., number of sparse and non-sparse values) of the array
  • size
    Get the number of non-sparse values in the array
  • value
    The value at the given index. Note the default value will be returned at sparse indexes
  • clone
    Creates a copy of this vector
  • defaultValue
    Get the default value of the array
  • factory
    The factory for making more of this type of vector
  • defaultValue,
  • factory,
  • innerProduct,
  • intValue,
  • multiply,
  • norm,
  • outerProduct,
  • put,
  • sub

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • requestLocationUpdates (LocationManager)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now