Examples of normalize()


Examples of org.apache.mahout.math.DenseVector.normalize()

      DoubleMatrix1D ejCol = eigenVects.viewColumn(basis.numRows() - i - 1);
      for (int j = 0; j < ejCol.size(); j++) {
        double d = ejCol.getQuick(j);
        realEigen.assign(basis.getRow(j), new PlusMult(d));
      }
      realEigen = realEigen.normalize();
      eigenVectors.assignRow(i, realEigen);
      log.info("Eigenvector {} found with eigenvalue {}", i, eigenVals.get(i));
      eigenValues.add(eigenVals.get(i));
    }
    log.info("LanczosSolver finished.");
View Full Code Here

Examples of org.apache.mahout.math.RandomAccessSparseVector.normalize()

    while (values.hasNext()) {
      VectorWritable value = values.next();
      value.get().addTo(vector);
    }
    if (normPower != PartialVectorMerger.NO_NORMALIZING) {
      vector = vector.normalize(normPower);
    }
    if (sequentialAccess) {
      vector = new SequentialAccessSparseVector(vector);
    }
    vectorWritable.set(vector);
View Full Code Here

Examples of org.apache.mahout.math.Vector.normalize()

          result.setName(id);
        } else {
          result.setName(String.valueOf(doc));
        }
        if (normPower != NO_NORMALIZING) {
          result = result.normalize(normPower);
        }
      } catch (IOException e) {
        // Log?
        throw new IllegalStateException(e);
      }
View Full Code Here

Examples of org.apache.mahout.matrix.Vector.normalize()

          result.setName(id);
        } else {
          result.setName(String.valueOf(doc));
        }
        if (normPower != NO_NORMALIZING) {
          result = result.normalize(normPower);
        }
      } catch (IOException e) {
        //Log?
        throw new IllegalStateException(e);
      }
View Full Code Here

Examples of org.apache.neethi.Assertion.normalize()

    private Assertion mockAssertion(QName name, int howMany, boolean normalize) {
        Assertion a = control.createMock(Assertion.class);       
        EasyMock.expect(a.getName()).andReturn(name).times(howMany);
        if (normalize) {
            EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION).times(howMany);
            EasyMock.expect(a.normalize()).andReturn(a).times(howMany);
        }
        return a;
    }
   
    @Test
View Full Code Here

Examples of org.apache.neethi.Policy.normalize()

                x509Token.setExplicitDerivedKeys(true);
            }


            Policy policy = builder.getPolicy(DOMUtils.getFirstElement(element));
            policy = (Policy)policy.normalize(builder.getPolicyRegistry(), false);

            for (Iterator iterator = policy.getAlternatives(); iterator.hasNext();) {
                processAlternative((List)iterator.next(), x509Token, consts);

                /*
 
View Full Code Here

Examples of org.apache.neethi.PolicyReference.normalize()

        policy = (policy == null) ? (Policy) policyElement
            : (Policy) policy.merge((Policy) policyElement);

      } else {
        PolicyReference policyReference = (PolicyReference) policyElement;
        Policy policy2 = (Policy) policyReference.normalize(
            new AxisPolicyLocator(description), false);
        policy = (policy == null) ? policy2 : (Policy) policy
            .merge(policy2);
      }
    }
View Full Code Here

Examples of org.apache.nutch.net.RegexUrlNormalizer.normalize()

  private void normalizeTest(String weird, String normal) throws Exception {
    String testSrcDir = System.getProperty("test.src.dir");
    String path = testSrcDir + "/org/apache/nutch/net/test-regex-normalize.xml";
    RegexUrlNormalizer normalizer = new RegexUrlNormalizer(path);
    assertEquals(normal, normalizer.normalize(weird));
  }
 
  public static void main(String[] args) throws Exception {
    new TestRegexUrlNormalizer("test").testNormalizer();
    new TestBasicUrlNormalizer("test").testNormalizer(); // need to make sure it passes this test too
View Full Code Here

Examples of org.apache.openmeetings.util.geom.GeomPoint.normalize()

    double halfWidth = (arrowStyle.headWidth != -1) ? arrowStyle.headWidth/2 : arrowStyle.headLength/2;
   
    //Figure out the line start/end points
    GeomPoint startNorm = new GeomPoint();
    startNorm.setLocation(fullVect.getY(),-fullVect.getX());
    startNorm.normalize(arrowStyle.shaftThickness/2);
    GeomPoint start1 = start.add(startNorm);
    GeomPoint start2 = start.subtract(startNorm);
    GeomPoint end1 = end.add(startNorm);
    GeomPoint end2 = end.subtract(startNorm);
       
View Full Code Here

Examples of org.apache.openmeetings.utils.geom.GeomPoint.normalize()

    double halfWidth = (arrowStyle.headWidth != -1) ? arrowStyle.headWidth/2 : arrowStyle.headLength/2;
   
    //Figure out the line start/end points
    GeomPoint startNorm = new GeomPoint();
    startNorm.setLocation(fullVect.getY(),-fullVect.getX());
    startNorm.normalize(arrowStyle.shaftThickness/2);
    GeomPoint start1 = start.add(startNorm);
    GeomPoint start2 = start.subtract(startNorm);
    GeomPoint end1 = end.add(startNorm);
    GeomPoint end2 = end.subtract(startNorm);
       
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.