// NewRank constructor retrieves a Rank pointer.
197472
func NewRank() *Rank {
	return &Rank{
		0,
		0,
		Relation{
			0,
			0,
			make(map[int]map[int]Score),
		},
		make(map[int]string),
		make(map[int]*Word),
		make(map[string]int),
	}
}
948759
func newDir(name string, children []noder.Noder) (*dir, error) {
	cloned := make([]noder.Noder, len(children))
	_ = copy(cloned, children)
	sort.Sort(byName(cloned))

	if hasChildrenWithNoName(cloned) {
		return nil, fmt.Errorf("non-root inner nodes cannot have empty names")
	}

	if hasDuplicatedNames(cloned) {
		return nil, fmt.Errorf("children cannot have duplicated names")
	}

	return &dir{
		name:     name,
		children: cloned,
	}, nil
}
1068354
func (x Vector) Rank() Vector {
	y := x.Copy()
	y.Sort()

	// equivalent to a minimum rank (tie) method
	rank := 0
	ranks := make(Vector, len(x))
	for i, _ := range ranks {
		ranks[i] = -1
	}

	for i, _ := range y {
		for j, _ := range x {
			if y[i] == x[j] && ranks[j] == -1 {
				ranks[j] = float64(rank)
			}
		}
		rank++
	}

	return ranks
}
482155
func NewGraph() *Graph {
	return &Graph{
		edges: make(map[uint32](map[uint32]float64)),
		nodes: make(map[uint32]*node),
	}
}
331503
func NewRm(ruleConfigs []*TagMatchRuleConfig, next rmsink) (*SpanTagRemoval, error) {
	rules, err := getRules(ruleConfigs)
	if err != nil {
		return nil, err
	}

	return &SpanTagRemoval{
		rules: rules,
		next:  next,
	}, nil
}
260416
func NewKnnClassifier(distfunc, algorithm string, neighbours int) *KNNClassifier {
	KNN := KNNClassifier{}
	KNN.DistanceFunc = distfunc
	KNN.Algorithm = algorithm
	KNN.NearestNeighbours = neighbours
	KNN.Weighted = false
	KNN.AllowOptimisations = true
	return &KNN
}
841399
func (rb *Bitmap) Rank(x uint32) uint64 {
	size := uint64(0)
	for i := 0; i < rb.highlowcontainer.size(); i++ {
		key := rb.highlowcontainer.getKeyAtIndex(i)
		if key > highbits(x) {
			return size
		}
		if key < highbits(x) {
			size += uint64(rb.highlowcontainer.getContainerAtIndex(i).getCardinality())
		} else {
			return size + uint64(rb.highlowcontainer.getContainerAtIndex(i).rank(lowbits(x)))
		}
	}
	return size
}
478211
func NewIndex(kind IndexKind, table string) Index {
	return &index{
		kind:  kind,
		table: table,
	}
}
1248193
func RankingEqual(o1, o2 *RankingOption) bool {
	if o1 != nil {
		return o1.Equal(o2)
	}
	if o2 != nil {
		return o2.Equal(o1)
	}
	return true
}
407128
func New() *SkipList {
	comparator := func(left, right interface{}) bool {
		return left.(Ordered).LessThan(right.(Ordered))
	}
	return NewCustomMap(comparator)

}
238208
func NewBucketer(width, growthFactor float64, numFiniteBuckets int) *Bucketer {
	b := &Bucketer{
		width:            width,
		growthFactor:     growthFactor,
		numFiniteBuckets: numFiniteBuckets,
	}
	b.init()
	return b
}
170413
func NewNodeAffinityIterator(ctx Context, source RankIterator) *NodeAffinityIterator {
	return &NodeAffinityIterator{
		ctx:    ctx,
		source: source,
	}
}
100571
func NewArray(Items []node.Node) *Array {
	return &Array{
		FreeFloating: nil,
		Items:        Items,
	}
}
39778
func NewIndex() *Index {
	return &Index{lines: map[string]string{}, charts: map[string]*repo.ChartVersion{}}
}
653904
func New(prof *profile.Profile, o *Options) *Graph {
	if o.CallTree {
		return newTree(prof, o)
	}
	g, _ := newGraph(prof, o)
	return g
}
818521
func NewFactory(buckets int) metrics.Factory {
	return adapters.WrapFactoryWithoutTags(
		&factory{
			factory: expvar.NewFactory(buckets),
		},
		adapters.Options{},
	)
}
557169
func (c Client) New(params *stripe.OrderParams) (*stripe.Order, error) {
	p := &stripe.Order{}
	err := c.B.Call(http.MethodPost, "/v1/orders", c.Key, params, p)
	return p, err
}